Page 1 of 1

Plugin max parameters bug?

PostPosted: Tue Aug 16, 2016 4:53 am
by luishp
I get an error whenever I try to add more than 9 parameters to an action in a plugin.
Is there a limit or is it a bug?.

Also MessageBox action seems to lack the "variable to store result" parameter.

Thanks!

Re: Plugin max parameters bug?

PostPosted: Wed Aug 17, 2016 1:03 pm
by Neosoft Support
The description of the MessageBox action is incorrect. Since JavaScript won't allow us to wait for the message box to close, you have to use a callback subroutine to determine which button the use clicked. To do this create a Subroutine with one Integer parameter and pass that to the MessageBox action. For example:

MessageBox "Hello" "How are you today?" "Poor|Fair|Average|Good|Excellent" "MsgBoxCallbackSub"

The parameter of the callback subroutine will contain the number of the button clicked.

There is no fixed limit on the number of parameters you can add to a plug-in action. I was able to add more than 9 here without an error. What is the error message you're receiving?

Re: Plugin max parameters bug?

PostPosted: Thu Aug 18, 2016 4:05 am
by luishp
It is possible to add as many parameters as you want but, whenever you add the number 10 into any action, the page just not render and the console shows a JavaScript error: missing ')'.

Re: Plugin max parameters bug?

PostPosted: Thu Aug 18, 2016 7:41 pm
by Neosoft Support
This error appears inside the PlugIn Generator? I'm not able to reproduce it here.

Re: Plugin max parameters bug?

PostPosted: Thu Aug 18, 2016 10:42 pm
by luishp
No, the plugin generator does not fires any error. It is later when using the plugin on browser.
First time it happened to me, I thought it was my fault, but I have seen this on two different plugins.
Take a look at this screencast:



Thank you!

Re: Plugin max parameters bug?

PostPosted: Sat Aug 20, 2016 1:15 pm
by Neosoft Support
Thanks for the video. That was very helpful.

You're right there is a bug in the compiler that fails to properly parse actions when they contain more than nine parameters. I'll correct this in the next update.