Active Forums => QB64 Discussion => Topic started by: badger on October 04, 2020, 03:30:15 pm
Title: another question about line input
Post by: badger on October 04, 2020, 03:30:15 pm
Hello
Sorry to post so many questions but i have not use qb since the 90s. This new version has some things i dont even know are there...
Question is there any way to trap chr$(13) <enter> from a line input as far as i know you cant
Badger
Title: Re: another question about line input
Post by: SMcNeill on October 04, 2020, 03:34:00 pm
Trap it from it? CHR$(13) is the ENTER key, and designates the end of input; it’s not included in the input itself.
What exactly are you attempting/wanting to do?
Title: Re: another question about line input
Post by: badger on October 04, 2020, 03:39:54 pm
Hello
I am using only one input in my program. I do not want the ? mark that input puts in. So when the user hits enter the input sr should have the value of chr$(13) instead line input used the enter to end the string. so here is what i want to do
if a$=chr$(13) then do something else
Badger
Title: Re: another question about line input
Post by: bplus on October 04, 2020, 03:51:31 pm
Sounds like you want INKEY$ (the old way) or _KEYHIT the new way or _KEYDOWN for key combos.
Title: Re: another question about line input
Post by: FellippeHeitor on October 04, 2020, 04:11:37 pm
On the other hand, if the variable is empty, that means the user just pressed enter.
Title: Re: another question about line input
Post by: badger on October 04, 2020, 04:18:19 pm
Hello
@FellippeHeitor that is try but i am unable to trap that condition in a case statement any suggestions
this is a condition i sorta need to fix .. i dont like to have loop holes in my programs LOL
Badger
Title: Re: another question about line input
Post by: bplus on October 04, 2020, 04:45:11 pm
Title: Re: another question about line input
Post by: badger on October 05, 2020, 11:30:45 am
Hello
I am so embarrassed i figured out why that was not working.. i had left out a gosub so sr was equal to the value it received when from the main menu which was 1. so i figured that out and all is fine thanks so much for your the help i received. i cant get over what i did LOL. i am sorta cleaning up some code going from a bunch of if/then to case i cut to much.
Badger
Title: Re: another question about line input
Post by: bplus on October 05, 2020, 11:38:27 am
Me, I have 1 - 3 stupid blunders a day usually. @!%# Why isn't this working... oh!
Title: Re: another question about line input
Post by: badger on October 06, 2020, 02:23:54 pm
Hello
Yes that is exactly what happened .. just sorta look at another spot that worked and there it was ok should have had a v8