I have a chunk of code I'd like to re-use, because the same code can be used for adjusting 18 different process variables.
The fly in the ointment is, I want to pass a different string (str1, str2, str3, etc) in to the routine.
While the compiler is happy to accept
set ram10 str1
and
set ram10 str2
etc etc
if I then try to do this:
print1 ram10
it prints the value "1", not the string. So the compiler isn't "clever" enough to pass a pointer to the string, and clearly a 4-byte variable isn't long enough to hold a full string, can anyone think of an elegant way to achieve it?
I DON'T consider an "elegant" solution to be:
tsteq ram10 1
print1 str1
tsteq ram10 2
print1 str2
....
tsteq ram10 18
print1 str18
The fly in the ointment is, I want to pass a different string (str1, str2, str3, etc) in to the routine.
While the compiler is happy to accept
set ram10 str1
and
set ram10 str2
etc etc
if I then try to do this:
print1 ram10
it prints the value "1", not the string. So the compiler isn't "clever" enough to pass a pointer to the string, and clearly a 4-byte variable isn't long enough to hold a full string, can anyone think of an elegant way to achieve it?
I DON'T consider an "elegant" solution to be:
tsteq ram10 1
print1 str1
tsteq ram10 2
print1 str2
....
tsteq ram10 18
print1 str18