Post Reply 
Can INPUT input what is typed
09-14-2015, 05:28 PM (This post was last modified: 09-14-2015 05:30 PM by StephenG1CMZ.)
Post: #1
Can INPUT input what is typed
I have been trying to use INPUT to input search strings for my Z EDITOR program.

But the Prime seems to parse some inputs without passing them straight to the user program.

For example, if you type in a single bracket, INPUT shows a pair. This happens whether you enter a bracket by using the () key, then cursor right and delete left. Or by using Shift/Chars and then selecting a single bracket.

Is there a way to avoid this, so that I could search for "WAIT(" for example, rather than "WAIT()" BUT NOT "WAIT(1"?.

Code:

EXPORT TRYIN()
BEGIN
 LOCAL IN,TTL,LBL,HLP,RST,IVL;

 PRINT();
 IN:="";
 TTL:="TRYING INPUT";
 LBL:="INP";
 HLP:="HLP";
 RST:="";
 IVL:="";
 INPUT(IN,TTL,LBL,HLP,RST,IVL);
 PRINT(IN);

 PRINT(SIZE(IN));
 PRINT(DIM(IN));
 PRINT(ASC(IN));
 //PRINT(STRING(IN));
 //PRINT(QUOTE(EXPR(IN)));

 WAIT;
END;

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
Visit this user's website Find all posts by this user
Quote this message in a reply
09-14-2015, 05:46 PM
Post: #2
RE: Can INPUT input what is typed
Have you tried to limit the input to Strings only?

My website: erwin.ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
09-14-2015, 06:37 PM
Post: #3
RE: Can INPUT input what is typed
(09-14-2015 05:46 PM)eried Wrote:  Have you tried to limit the input to Strings only?

I'd tried print(string(in... Gives a pair of brackets within an extra pair of quotes.

But if the user types the quotes himself:
"()" then deletes a )
The program sees:
""(""

At last there is a single bracket - now The problem is the extra pair of quotes.

Also, I don't really want the user to have to type in the quotes - switching between in and out of Alpha should be enough. And for simple searches like WAIT without any brackets, the quotes are not necessary.

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
Visit this user's website Find all posts by this user
Quote this message in a reply
09-14-2015, 06:45 PM
Post: #4
RE: Can INPUT input what is typed
The help says that you could define String as the var type and the quotes will be hidden. It seems to be what you need but I don't know how that works. I just get error.

My website: erwin.ried.cl
Visit this user's website Find all posts by this user
Quote this message in a reply
09-14-2015, 08:34 PM
Post: #5
RE: Can INPUT input what is typed
If I simply type in "WAIT" with quotes instead of just WAIT, into my existing program, the quotes are included in the match - and no match results. I'll think some more about the syntax.

Stephen Lewkowicz (G1CMZ)
https://my.numworks.com/python/steveg1cmz
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)