Subj : Question
To   : Digital Man
From : Frozen Fire
Date : Sun Aug 04 2002 04:25 pm

 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 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

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
\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 pick
up the command key, how would I use ungetkey to accomplish this?

Thanks for your help.



  � � � � z � �  � � � � �




---
� Synchronet � The Impact Matrix (impactmatrix.darktech.org)