LB Booster
Programming >> Liberty BASIC language >> Compatibility problem http://lbb.conforums.com/index.cgi?board=lblang&action=display&num=1500867207 Compatibility problem
Post by mmiscool on Jul 24th, 2017, 03:33am
Running the following code in LB produces different results.
Code:
MYSTRING$ = CHR$(34);"SOME TEXT";CHR$(34);";";CHR$(34);" SOME MORE TXT";CHR$(34)
NOTICE MYSTRING$
NOTICE EVAL$(MYSTRING$)
I would expect the strings to concatenated with each other in the eval$() function.
Re: Compatibility problem
Post by Richard Russell on Jul 24th, 2017, 08:14am
I would expect the strings to concatenated with each other in the eval$() function.
No. This is what it says in the LBB help file: "The EVAL function works only with simple expressions containing 'standard' BASIC functions". The use of the semicolon to concatenate strings is far from standard, in fact as far as I know it is unique to Liberty BASIC and Just BASIC.
To make it compatible with LBB you would need to replace the semicolons with the standard means of concatenating strings in BASIC, which is the plus sign:
Code:
MYSTRING$ = CHR$(34)+"SOME TEXT"+CHR$(34)+"+"+CHR$(34)+" SOME MORE TXT"+CHR$(34)
NOTICE MYSTRING$
NOTICE EVAL$(MYSTRING$)
Richard.
Re: Compatibility problem
Post by tsh73 on Jul 24th, 2017, 08:44am
It's easy to forget that things you used to are not in fact "standard". Nice to know that one, thanks.