Hi to everyone,
i'm writing my first library and i made some test.
I'm using POI library to semplify some function to write in word documents.
This is Eclipse code where method work:
package com.rwblinn.rlstrings;
import anywheresoftware.b4a.BA;
import java.io.File;
import java.io.FileOutputStream;
import org.apache.poi.xwpf.usermodel.XWPFDocument;
@BA.DesignerName("Build 20140101")
@BA.Version(0.10F)
@BA.Author("PnK")
@BA.ShortName("WordUtility")
public class WordUtility {
public void CreateBlankDocument(String dir,String fileName) throws Exception{
String path = new String();
path = dir+"/"+fileName;
XWPFDocument document= new XWPFDocument();
FileOutputStream out = new FileOutputStream(new File(path));
document.write(out);
document.close();
out.close();
}
public static void main(String[] args) throws Exception {
WordUtility word = new WordUtility();
word.CreateBlankDocument("C:/Users/kdrills01/Desktop", "a.docx");
System.out.println("createdocument.docx written successully");
}
}
This is B4J code:
Sub Process_Globals
Private fx As JFX
Private word As WordUtility
End Sub
Sub AppStart (Form1 As Form, Args() As String)
word.CreateBlankDocument("C:/Users/xxxxx/Desktop","a.docx")
End Sub
'Return true to allow the default exceptions handler to handle the uncaught exception.
Sub Application_Error (Error As Exception, StackTrace As String) As Boolean
Return True
End Sub
When i compile my program in release mode there isn't any problems but in debug mode B4J give me an error message:
B4J version: 5.51
Parsing code. (0.00s)
Compiling code. Error
Error compiling program.
Error description: Too many parameters.
Occurred on line: 7
word.CreateBlankDocument("C:/Users/xxxxx/Desktop","a.docx")
Word: a.docx
But i don't understand where is the problem.