06-11-2024, 01:39 AM
Hi Marcus,
I was tinkering with string manipulation and came across a bit of a 'poser' in regards to the mid() command.
Here is a short example....
Defining a string then assigning a variable to a "portion" of the string, using mid(), works fine...
But, trying to replace a character, using mid() causes the compilation to fail with a syntax error.
There is no rush on this one... Whenever you are able... Present situation understood... We will "keep an eye on the store" during your break...
J
I was tinkering with string manipulation and came across a bit of a 'poser' in regards to the mid() command.
Here is a short example....
Code:
' Open a window and enable double buffering.
set window "Test", 800, 632, false
set redraw off
visible a = "ABCDEF"
visible b
visible c
' display the letters "B" to "E" inclusive...
b = mid(a, 1, 4)
pln b
' This works fine...
' But, when I try to make the third letter "D"
' an "X"...
' mid(b, 3, 1) = "X"
' pln b
' I get a syntax error on line 17 during compile
'(remove the "remarks" from lines 17 and 18
' to see what I mean...)
system "pause"
Defining a string then assigning a variable to a "portion" of the string, using mid(), works fine...
But, trying to replace a character, using mid() causes the compilation to fail with a syntax error.
There is no rush on this one... Whenever you are able... Present situation understood... We will "keep an eye on the store" during your break...
J
Logic is the beginning of wisdom.