Has anyone programmed a Baja based voting booth?
I'm doing a light bar read prompt (saw one on another board, and had to have it).. Similar to a logon matrix, the command is highlighted and kept track o with a variable (i for instance)... the variable is then passed along to a switch statement, which in turn will pass the correct command key "A,B,C" al to the bbs to preform the command.
My question, I need the switch to return the appropriate command key to the bbs, what function is best suited to do this? i.e. return str (where str is command key needed to do what is needed)
Re: Question
By: Frozen Fire to All on Sat Aug 03 2002 07:20 pm
I'm doing a light bar read prompt (saw one on another board, and had to h it).. Similar to a logon matrix, the command is highlighted and kept trac with a variable (i for instance)... the variable is then passed along to switch statement, which in turn will pass the correct command key "A,B,C" to the bbs to preform the command.
My question, I need the switch to return the appropriate command key to t bbs, what function is best suited to do this? i.e. return str (where str command key needed to do what is needed)
Actually, I think you want to use UNGETKEY.
digital man
My question, I need the switch to return the appropriate command key t bbs, what function is best suited to do this? i.e. return str (where s command key needed to do what is needed)
Actually, I think you want to use UNGETKEY.
I tried UNGETKEY, and the module went into a loop.. here's the tiny mod..
!include sbbsdefs.inc
!define LAST 3
int m
cmd_home
print "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\ \b\b"
compare m 0
if_true
print "[ Reply"
else
print "[ Reply"
end_if
compare m 1
if_true
print " Reply Mail"
else
print " Reply Mail"
end_if
compare m 2
if_true
print " Next"
else
print " Next"
end_if
compare m 3
if_true
print " Abort ] (?) "
else
print " Abort ] (?) "
end_if
Re: Question
By: Frozen Fire to Digital Man on Sun Aug 04 2002 03:25 pm
My question, I need the switch to return the appropriate command ke bbs, what function is best suited to do this? i.e. return str (wher command key needed to do what is needed)
Actually, I think you want to use UNGETKEY.
I tried UNGETKEY, and the module went into a loop.. here's the tiny mod..
!include sbbsdefs.inc
!define LAST 3
int m
cmd_home
print "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b \b\b"
compare m 0
Stop right there. Why would you be comparing the value of 'm' when you haven even set it to anything?
if_true
print "[ Reply"
else
print "[ Reply"
end_if
compare m 1
if_true
print " Reply Mail"
else
print " Reply Mail"
end_if
compare m 2
if_true
print " Next"
else
print " Next"
end_if
compare m 3
if_true
print " Abort ] (?) "
else
print " Abort ] (?) "
end_if
You should use a switch/case block rather than all these compares.
digital man
Re: Questionman now everyone wants to rip my mods off :), j/k, if u want the check it out i put a part of it on my board.. check it out.
By: Frozen Fire to All on Sat Aug 03 2002 07:20 pm
I'm doing a light bar read prompt (saw one on another board, and had to h it).. Similar to a logon matrix, the command is highlighted and kept trac with a variable (i for instance)... the variable is then passed along to switch statement, which in turn will pass the correct command key "A,B,C" to the bbs to preform the command.
My question, I need the switch to return the appropriate command key to t bbs, what function is best suited to do this? i.e. return str (where str command key needed to do what is needed)
Actually, I think you want to use UNGETKEY.
digital man
Re: Question
By: Digital Man to Frozen Fire on Sun Aug 04 2002 03:27:00
Re: Question
By: Frozen Fire to All on Sat Aug 03 2002 07:20 pm
I'm doing a light bar read prompt (saw one on another board, and had t it).. Similar to a logon matrix, the command is highlighted and kept t with a variable (i for instance)... the variable is then passed along switch statement, which in turn will pass the correct command key "A,B to the bbs to preform the command.
My question, I need the switch to return the appropriate command key t bbs, what function is best suited to do this? i.e. return str (where s command key needed to do what is needed)
Actually, I think you want to use UNGETKEY.
digital man
I tried UNGETKEY, and the module went into a loop.. here's the tiny mod..
!include sbbsdefs.inc
!define LAST 3
int m
cmd_home
print "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\ \b\b"
compare m 0
if_true
print "[ Reply"
else
print "[ Reply"
end_if
compare m 1
if_true
print " Reply Mail"
else
print " Reply Mail"
end_if
compare m 2
if_true
print " Next"
else
print " Next"
end_if
compare m 3
if_true
print " Abort ] (?) "
else
print " Abort ] (?) "
end_if
getkey
cmdkey ^F
add m 1
compare M LAST
if_greater
set m 0
end_if
pause_reset
end_cmd
cmdkey ^]
sub m 1
compare m 0
if_less
set m LAST
end_if
pause_reset
end_cmd
switch m
case 0
setstr A
end_case
case 1
setstr W
end_case
case 2
setstr ^M
end_case
case 3
setstr Q
end_case
end_switch
printf "it was %d\r\n" m
cmd_pop
The end being a debug just to let me know the pointers are straight. You'll notice I am attempting to use setstr to have the BBS message read section pi up the command key, how would I use ungetkey to accomplish this?
Thanks for your help.
z
man now everyone wants to rip my mods off :), j/k, if u want the check
it out i put a part of it on my board.. check it out.
OK here a blank MSG again. Is it me or them ANYBODY? cause it's starting to me!!!!
Thats what I did. Since a defined int defaults to zero, and zero denoted the first line on the light bar.. well :)
In any event, its working now. Thanks again :)
Re: Question
By: yahwe to Yahwe on Tue Aug 06 2002 04:30 am
OK here a blank MSG again. Is it me or them ANYBODY? cause it's starting to me!!!!
Re: Question
By: Frozen Fire to Digital Man on Mon Aug 05 2002 15:30:00
Thats what I did. Since a defined int defaults to zero, and zero denoted first line on the light bar.. well :)
In any event, its working now. Thanks again :)
It may _work_ but it is still what they call _erroneous_.
You should not rely on the un-initialized value of a variable unless the language specification specifically states what that value will be.
Or unless you are writing drivers for Microsoft...
Re: Question
By: Deathridder to yahwe on Tue Aug 06 2002 10:07:00
Re: Question
By: yahwe to Yahwe on Tue Aug 06 2002 04:30 am
OK here a blank MSG again. Is it me or them ANYBODY? cause it's starting me!!!!
Blank message?
Damn! I thought he had finally posted a message worthy of his IQ...
You should not rely on the un-initialized value of a variable unless the language specification specifically states what that value will be.
In most of the source files that came with SBBS, I
did not see any variables initialized, so I assumed the default for anything declared was off, or zero, save for things such as "str", which are used internally.
No,imgetting them as well, and yes,it is annoying
Re: Question
By: Frozen Fire to Angus Mcleod on Wed Aug 07 2002 03:48:00
You should not rely on the un-initialized value of a variable unless t language specification specifically states what that value will be.
In most of the source files that came with SBBS, I
did not see any variables initialized, so I assumed the default for anyth declared was off, or zero, save for things such as "str", which are used internally.
It's always a good idea to program as though there is a gun pointed at
your foot.
if ($x < 0) {
# Negative $x
. . .
} elsif ($x == 0) {
# Zero $x
. . .
} elsif ($x > 0) {
# Positive $x
. . .
} else {
# impossible
print "Eeeeeeek!!!";
exit 1;
}
Just because it's physically and mathematically impossible for something
to happen, doesn't mean it WON'T happen! :-)
Sysop: | Tandy |
---|---|
Location: | New York, USA |
Users: | 15 |
Nodes: | 13 (0 / 13) |
Uptime: | 64:55:00 |
Calls: | 335 |
Messages: | 113,197 |