Im running Xojo 2016 r4.1 on an iMac. I can run Windows 10 using Parallels.
I have a project which successfully runs on Mac and Linux, with no problems to date. Windows has a peculiar problem. My project uses RBScript, so the user enters his script in a TextArea. With a good script the Windows program works perfectly. With a bad script, such as just a, the Windows program puts up a MsgBox saying
Line Number 361: Undefined identifier.
But the Mac and Linux programs for the same bad script put up
Line Number 1: Undefined identifier.
which is what I wanted. Why did Windows put in 361 rather than 1?
In the RBScript error handling here is the code to generate that message:
errorString="Line Number "+Str(line+1-numLinesPrefix)+": "+errorString
MsgBox(errorString)
numLinesPrefix is a global Integer property belonging to main Window1. It is initialized in the Open event of Window1 by:
TextAreaPrefix.text = ReplaceLineEndings(TextAreaPrefix.text, EndOfLine.OSX)
numLinesPrefix = CountFields(TextAreaPrefix.text, EndOfLine.OSX)
I did it that way so if I changed the prefix to the user script, then numLinesPrefix would be adjusted to the proper value.
In order to check things out I inserted a single line into my error reporting code, so it read
errorString="Line Number "+Str(line+1-numLinesPrefix)+": "+errorString
MsgBox "numLinesPrefix = " + Str(numLinesPrefix)
MsgBox(errorString)
When the new built programs were run on Mac and Linux, they reported the error as
numLinesPrefix = 361
and then
Line Number 1: Undefined identifier.
as expected.
But the Windows program crashed on opening with a Runtime error saying
Common\Loaders\LoaderWindows.cpp: 139
Failure Condition: bytesRead == mImportSection.DataLength
Ive repeated the process of inserting and removing that single line of code
MsgBox "numLinesPrefix = " + Str(numLinesPrefix)
several times and gotten the same results.
Why is Windows giving this problem?
Bob