B4J Question Error in debug: "Too many parameters" in a method call

moster67

Expert
Licensed User
Longtime User
I get an error, "too many parameters", in Debug-mode when compiling a project in B4J in a Background Worker class .
This is the error:

B4X:
B4J Version: 6.01
Parsing code.    (0.02s)
Compiling code.    Error
Error compiling program.
Error description: Too many parameters.
Error occurred on line: 96
strBarCode = mybarcode.ReturnBarcode(Dir & "/" & f, 300)
Word: 300

mybarcode.ReturnBarcode(par1,par2) calls the following method in my java-library:
(wrapper)
B4X:
@BA.RaisesSynchronousEvents
    public String ReturnBarcode(String FilePath, float DpiValue) {
        List<BufferedImage> myImageList = conv.convert(FilePath, DpiValue);
        String myResult = "";

        for (BufferedImage img : myImageList) {
            try {
                BarCode code = new BarCode();
                code = reader.readBarcode(img, code);
                myResult = code.getBarcodes().get(0).getCode();
            } catch (NotFoundException e) {
                myResult = "error";
            }
        }
        myImageList.clear();
        return myResult;
    }

which calls
(original class)
B4X:
 public List<BufferedImage> convert(String file, float dpivalue) {
        try {
            File sourceFile = new File(file);
        //......................

In release mode, it compiles just fine and everything works (both on linux and windows).

Since it is working fine, I am not really concerned but just wanted to know if I can fix the error in debug-mode.

Thanks.
 

moster67

Expert
Licensed User
Longtime User
Not at this point although I will make it public here on the forum later on.
Can I send you the library project (classes) by e-mail?
 
Upvote 0

moster67

Expert
Licensed User
Longtime User
Yes, you're right. In a simple project it works fine.

Now, I set up a small Console server project with a background worker and this generates the previous error message while compiling in debug-mode.
In release mode it compiles fine.
Please see attached project.

Probably I am doing something wrong
 

Attachments

  • test3.zip
    1.4 KB · Views: 282
Upvote 0

moster67

Expert
Licensed User
Longtime User
Thanks! So it was just a naming conflict as you suggested.
It was just that the error message was a bit confusing and also that it compiled in release but not in debug.
Now I know something else to keep in mind.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…