|
Post by shakeygames on Jul 9, 2020 5:48:40 GMT -5
Hello, for some reason I'm unable to set the INPUT prompt to a string variable. Example:
prompt$ = "Please enter the upper limit:"
input prompt$; limit
That's supposed to ask "Please enter the upper limit". But, the compile halts at a syntax error.
That code was taken straight from the documentation, yet it does not run.
Is this an issue with LibertyBASIC or...?
|
|
|
Post by shakeygames on Jul 9, 2020 7:55:25 GMT -5
Anyone else face this issue?
|
|
|
Post by mknarr on Jul 9, 2020 7:55:36 GMT -5
It should be
prompt$ = "Please enter the upper limit; limit"
|
|
|
Post by Rod on Jul 9, 2020 8:01:40 GMT -5
It is a known bug, here is a work round to use variable text rather than literal text.
prompt$ = "Please enter the upper limit:"
input "";prompt$; limit
print limit
You need a preceding ""; to make it work.
|
|
|
Post by tenochtitlanuk on Jul 9, 2020 8:03:39 GMT -5
You are confusing the text that will be used to prompt for input, and the command to create a poopup promt.
limit =666 prompt "Current value of upper limit"; limit
input "Please enter new upper limit "; limit print limit
prompt "Current value of upper limit"; limit
EDIT WOW!! THree interpretaions of what you are trying!!
|
|
|
Post by shakeygames on Jul 9, 2020 9:38:31 GMT -5
Thank you all for your helpful answers, works like a charm now.
|
|
|
Post by Rod on Jul 9, 2020 11:10:35 GMT -5
Yep, but he is following the help file example of input using a variable for the prompting text which uses the "prompt$" label (bad) and in fact does not work (bad).
|
|