so far so good, but I cant seem to find where to bind the enter key to a default action.
basically I want it to behave like a quit. hit enter and the program default to the end.
what Im working on is a one liner (actually Im butchering anothers previous work) and I want it to say "Want to add a quote?" Y[N] where N is the defaul key and it exits the program at that point.
Im venturing into my first real foray into Baja outside of binding keys on m main menu...
so far so good, but I cant seem to find where to bind the enter key to a default action.
basically I want it to behave like a quit. hit enter and the program default to the end.
Enter in response to what? GETSTR or GETKEY or GETCMD?
GETSTR will return a blank (empty) string in response to the user just hitti the enter key, where as GETKEY/CMD will set the current command key to '\r'.
See http://synchro.net/docs/baja.html#CommandKeyConstants for more details.
digital man (xbox-live: digitlman)
Snapple "Real Fact" #120:
The only continent without native reptiles or snakes is Antarctica.
Norco, CA WX: 58.1°F, 71% humidity, 0 mph ENE wind, 0.00 inches rain/24hrs
Enter in response to what? GETSTR or GETKEY or GETCMD?
GETSTR will return a blank (empty) string in response to the user just hitting the enter key, where as GETKEY/CMD will set the current command key to '\r'.
See http://synchro.net/docs/baja.html#CommandKeyConstants for more details.
Enter in response to what? GETSTR or GETKEY or GETCMD?
Enter in response to what? GETSTR or GETKEY or GETCMD?
the current code is for a GETCMD
-----
getcmd YN\r?
logkey
cmdkey N
goto theend
end_cmd
cmdkey Y
goto write
end_cmd
-----
hitting the return key sends me to "Y"
all I want it to do is behave the same as "N"
GETSTR will return a blank (empty) string in response to the user just hitting the enter key, where as GETKEY/CMD will set the current command k to '\r'.
so how do you set the current command key?
The Yes_no works fine, but Yes is highlighted :/
Re: Re: Enter key and quitBy: Night_Flyer to Digital Man on Sun Mar 18 2007 01:05 pm
Enter in response to what? GETSTR or GETKEY or GETCMD?
the current code is for a GETCMD
-----
getcmd YN\r?
logkey
cmdkey Ngoto theend
end_cmd
cmdkey Ygoto write
end_cmd
From baja.html:
If a RETURN or GOTO function will be
executed before the END_CMD function, then a CMD_POP function must be executed to tell the interpreter to "forget" the previous CMD_HOME function.
So looks like you're missing some CMD_POP calls in there.
From baja.html:
If a RETURN or GOTO function will be
executed before the END_CMD function, then a CMD_POP function must be executed to tell the interpreter to "forget" the previous CMD_HOME function.
So looks like you're missing some CMD_POP calls in there.
all the examples I looked at didnt have that in there (that I noticed any wa
the "cmdkey \r" call worked so ill leave that in... Thanks.
dont know how much more of this I want to play with considering its mosly doing what I want.
Since this is for a one liner wall, is there a way to get the length of the _useron.alias?
and with that info cut off the number of characters available in the get lin
X = 50
getline line1 X K_UPPER|K_ALPHA|NOCRLF
Use STRLEN
Use STRLEN
when I compile I get an error stating that _useron.alias is an INT?!?
heres what Im trying to do
80 characters - overhead (7 characters) - username length = input box size
the above should be simple... but for some reason it isnt...
Re: Re: Enter key and quitBy: Night_Flyer to Digital Man on Mon Mar 19 2007 07:00 pm
Use STRLEN
when I compile I get an error stating that _useron.alias is an INT?!?
heres what Im trying to do
the above should be simple... but for some reason it isnt...
Past the code you're trying to compile and the error message.
and with that info cut off the number of characters available in the get lin
X = 50 getline line1 X K_UPPER|K_ALPHA|NOCRLF
--- Synchronet 3.14b-Win32 NNTP Service 1.101 * Vertrauen - Riverside County, California - telnet://vert.synchro.net
Sysop: | Eric Oulashin |
---|---|
Location: | Beaverton, Oregon, USA |
Users: | 94 |
Nodes: | 16 (0 / 16) |
Uptime: | 09:34:49 |
Calls: | 5,138 |
Calls today: | 5 |
Files: | 8,491 |
D/L today: |
1 files (279K bytes) |
Messages: | 352,555 |