HELP REQUIRED
Root / Programming Questions / [.]
randoCreated:
Actually, it is working.
Then:
heres what i have.That's not what you have.input"X:",X$
So, I was playing around with this, trying to make INPUT return to me an illegal function call error, when I noticed this:
INPUT "ABC"[0],X$gives a type mismatch error, while
INPUT "ABC"[0];X$does not. All strings can use Subscripts like arrays, and
"ABC"[0]should be compacted into its own literal at compile time, right? The manual says this on INPUT: "Only when ; is used, a string variable can be used for the guided text string" The guided text string is "ABC", however, it is not a string variable. Does this mean that when subscripts are used on a string literal, it is no longer a string literal?
INPUT string,variable isn't allowed at all. You have to use a semicolon to separate the text from the variable list.Not true. Take this from the manual: "If , (comma) is used instead of ; after guiding text string, a ? mark will not be displayed" The discrepancy I'm referring to is that, according to the manual which describes how the INPUT syntax works, "ABC"[0] is treated as a string variable instead of a string literal.
It looks like you can only use plain string literals , and not expressions like "A"*2 or "ABC"[0]
And somehow inputting to a CHARACTER is allowed...
INPUT Q$[0]
Even though this is NOT passed as a reference, which you can test using a function.
This is an important lesson on why using weird syntax should be done carefully to avoid ambiguity and bugs.