I'm trying to tidy up the manual before releasing the new version of ugBASIC (v1.15) and I found myself faced with a rather questionable implementation of the LEFT$(..) and RIGHT$(..) commands.
I'll try to explain better.
In general, BASIC has facilities for extracting substrings from a string. For example,
Code: Select all
a$ = LEFT$("pippo", 3) : PRINT a$: REM prints "pip"
Code: Select all
a$ = "punto": LEFT$(a$, 3) = "plu": PRINT a$: REM prints "pluto"
For those who are curious... to date the assignment only works if the string to be replaced is as long as the numeric parameter of LEFT$(..) / RIGHT$(..).