|
Post by votan on Aug 8, 2008 11:47:57 GMT -5
Just wondering, why using the underscore in stringnames results in a sysntax error!? Like "mystring$" is ok, while "my_string$" returns a syntax error. Didn't know that the underscore is treated in a special way that it causes these problems.... So not sure if this actually is a bug or if it is supposed to be this way!?
|
|
|
Post by Janet on Aug 8, 2008 12:22:47 GMT -5
In Liberty BASIC, the use of an underscore with a variable is reserved for Windows constants. A simple windows constant is VK_ESCAPE which holds the ascii value for the tab key (27). Liberty BASIC expects the Windows constant to be preceded with an underscore as well, so that the output of
Print _VK_ESCAPE
would be
27
Run BASIC doesn't appear to have any Windows constants built in. Print _VK_ESCAPE results in a Compile Error, but it may be that RB follows the same rules as LB: underscores aren't allowed as part of user defined variables. Perhaps you could use a modification?
myString$ MyString$ my.string$
|
|
|
Post by Carl Gundel - admin on Aug 9, 2008 10:45:59 GMT -5
Just wondering, why using the underscore in stringnames results in a sysntax error!? Like "mystring$" is ok, while "my_string$" returns a syntax error. Didn't know that the underscore is treated in a special way that it causes these problems.... So not sure if this actually is a bug or if it is supposed to be this way!? Underscores are not valid in Run BASIC variable names. This is not a bug in the compiler. -Carl
|
|
|
Post by StefanPendl on Aug 13, 2008 4:42:10 GMT -5
Just to clear things up, RB and LB5 are sharing the same basic code base, since variable handling is one of the basics, the LB5 syntax takes precedence, this way Carl does not need to change too many things.
|
|
|
Post by Carl Gundel - admin on Aug 13, 2008 13:53:59 GMT -5
That's right. RB is a version of LB. LB has never supported underscores in variable names. Could it? Yes, but I'm not ready to make that decision.
-Carl
|
|