STRING directive question
mynet43
Posts: 644
According to the manual, the syntax for the STRING directive is:
STRING (StringExpression) -- with a single argument.
The example given is: -- PrintStr(string("This is a test string."))
So far, so good. This all makes complete sense. This is what's in the manual.
However, I was reviewing the code in the SD read/write test routine and I noticed a variation on this syntax that uses 2 arguments.
An example is: term.str(string("Dir: ", 13)) -- i.e. two arguments, output a return after the string.
This is great, and it works! Now I'll use it that way.
OK, so does someone have a general explanation of the real calling sequence?
I.e.
Does it allow more than two arguments?
Must the second argument be the value of an output character?
Etc. etc.
Thanks for your help.
Jim
STRING (StringExpression) -- with a single argument.
The example given is: -- PrintStr(string("This is a test string."))
So far, so good. This all makes complete sense. This is what's in the manual.
However, I was reviewing the code in the SD read/write test routine and I noticed a variation on this syntax that uses 2 arguments.
An example is: term.str(string("Dir: ", 13)) -- i.e. two arguments, output a return after the string.
This is great, and it works! Now I'll use it that way.
OK, so does someone have a general explanation of the real calling sequence?
I.e.
Does it allow more than two arguments?
Must the second argument be the value of an output character?
Etc. etc.
Thanks for your help.
Jim
Comments
-Phil
Makes sense. I assume this means you can mix strings and values in any order in the arguments.
Like several lines of output in one string( ) declaration. I'll try it.
By the way, is this documented somewhere?
Thanks,
Jim
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The more I know, the more I know I don't know.· Is this what they call Wisdom?
I tried this:
And it worked great!
Printed four lines! Cool!
Jim