"The arguments are the wrong number of arguments for..." when using long-values

1,956 views
Skip to first unread message

Arne Mailand

unread,
Oct 17, 2016, 2:30:59 PM10/17/16
to App Inventor Open Source Development
Hey,

when I try to use long-values between methods, I get this pop-up-toast-error-message during runtime:

"The arguments are the wrong number of arguments for SendASCII"

So, what did I do wrong? Here is what I did:




Can anybody tell me what I did wrong?

Big thanks.

Arne Mailand

unread,
Oct 17, 2016, 2:32:00 PM10/17/16
to App Inventor Open Source Development
With runtime, I mean when I press the button.

Thilanka Munasinghe

unread,
Oct 21, 2016, 2:37:05 AM10/21/16
to armai...@gmail.com, app-inventor-o...@googlegroups.com
Hi Arne,

I think if you post the entire log, which will have more info than the pop up error you see during runtime, it will be easier for the developer community to the understand where the problem might be. Also try adding debug statements in your code to check which section of the code did not get executed, and may be problematic. 

best,

Thilanka



On Mon, Oct 17, 2016 at 11:32 AM, Arne Mailand <armai...@gmail.com> wrote:
With runtime, I mean when I press the button.

--
You received this message because you are subscribed to the Google Groups "App Inventor Open Source Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-open-source-dev+unsubs...@googlegroups.com.
To post to this group, send email to app-inventor-open-source-dev@googlegroups.com.
Visit this group at https://groups.google.com/group/app-inventor-open-source-dev.
For more options, visit https://groups.google.com/d/optout.

Arne Mailand

unread,
Oct 21, 2016, 1:30:40 PM10/21/16
to App Inventor Open Source Development
Big Thanks Thilanka!

this helped to me:

return (long) file.size();

How can I easily implement debug statements in a AI component?

Thilanka Munasinghe

unread,
Oct 21, 2016, 8:07:39 PM10/21/16
to app-inventor-o...@googlegroups.com
Hi Arne, 

There are multiple ways to apply debug statements in your code. 

Most simple way to check your code is to use of 
1) System.out.println(" some text here.. ");  in between your method-body and out of the method. (So that you know where your code get stuck, if your System.out.println statements don't get printed on the console. you get an idea where your code not get executed.) As an example:

@SimpleFunction(discreption = " Gibt die Grobe en......long aus ")
  public long GetFileLength( String path) {
      System.out.println(" Inside the GetFileLength() method " );
File file = new File(path);
      System.out.println(" code line containing ... File file = new File(path); .... got executed  " );
return file.length; 
      System.out.println(" code line containing ... return file.length;  .... got executed  " );
}
      System.out.println(" out of the GetFileLength() method  " );



2) You can use the Debugging with Logcat (take a look at this video tutorial to get an idea of Logcat). 


Also  check out this free course on Udacity Software debugging. This might help down the road with many things  :) 


Good Luck

best,

Thilanka

--
You received this message because you are subscribed to the Google Groups "App Inventor Open Source Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-open-source-dev+unsub...@googlegroups.com.

Arne Mailand

unread,
Oct 22, 2016, 5:12:08 PM10/22/16
to App Inventor Open Source Development
Big Thx Thilanka!

I'm right about to try that out.
Reply all
Reply to author
Forward
0 new messages