« Thoughts on the 14.1 … | Home | Xojo Desktop License … »

XojoScript Errors


Today I had a job with XojoScript and wanted to have a textual message for the error.
So I joined some information from the documentation and the xojoscript plugin's interface to build a list of errors and their documented error message.

The function looks like this and I think it's very useful:
Function ErrorToText(error as XojoScript.Errors) As string Select case error case xojoscript.Errors.Syntax // 1 return "Syntax does not make sense." case xojoscript.Errors.TypeMismatch // 2 return "Type mismatch." case xojoscript.Errors.ParserStackOverflow // 5 return "The parser's internal stack has overflowed." case xojoscript.Errors.TooManyParameters // 6 return "Too many parameters for this function." case xojoscript.Errors.NotEnoughParameters // 7 return "Not enough parameters for this function call." ... end Select End Function

Download includes enumerations, text from wiki and the complete function: errordetails.zip
05 04 14 - 22:48
nine comments

Or open the XojoScript example included with Xojo and copy the ErrorCodeToString method from ScriptWindow.
Paul Lefebvre (Email) (URL) - 05 04 14 - 23:19

Now I feel like I wasted time :-(
Christian Schmitz (URL) - 05 04 14 - 23:21

Would it be possible to have it as an rbp file too? Thanks. Markus
Markus Wnter (Email) - 07 04 14 - 19:46

Didn’t you see Paul’s comment?
There is a project file from Xojo for that already.
And you can copy & paste my function from the text file into Xojo project, too.
Christian Schmitz (URL) - 07 04 14 - 20:16

Saw his comment but wanted to compare the two – that’s how I learn ;-)
Markus Wnter (Email) - 07 04 14 - 21:43

> And you can copy & paste my function from the text file into Xojo project, too.
Pain in the neck. Where do I copy it to? xojoscript.errors seems to be an enumeration? Can’t simply copy it. Import doesn’t do it either – just imports it as a text file.
Markus Wnter (Email) - 07 04 14 - 22:02

You can copy the select case statement right from my “Error Function.txt” file.
Christian Schmitz (URL) - 07 04 14 - 22:10

I already did. But I cannot do the same with the enumeration in xojoscript Errors.txt. As I said: Pain in the neck.
Markus Wnter (Email) - 08 04 14 - 14:40

Thanks to Christian! Turns out xojoscript.Errors.DuplicateLabel is unknown in Xojo 2013 R3, so that’s why I had problems.
Markus Wnter (Email) - 10 04 14 - 17:17


  
Remember personal info?

Emoticons / Textile


Notify:
Hide email:

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.