Posted: 29th Dec 2003 19:28
Here's a little code which work like a bank
+ Code Snippet
 menu:
 cls : Print "What do you want to do?" 
 Print "1.Deposit"
 Print "2.Witdrawal"
 Print "3.View your current balance"
 Print : input "Enter the number of the action >";action
 if action=1 then goto deposit
 if action=2 then goto witdrawal
 if action=3 then goto balance
 if action>3 or action<=0 then print "Invalid Entry,TRY AGAIN" : sleep 3000 : goto menu
 deposit:
 cls : set text size 20 : center text 150,0,"Deposit" : print : input "How much you want to deposit?>";deposit : balance=0 : balance=balance + deposit : Print "Press "Enter" to go to the menu" 
 if returnkey()=1 then goto menu
 witdrawal:
 cls : set text size 20 : center text 150,0,"Witdrawal" : print : input "How much you want to witdraw?>";witdraw : balance=balance-witdraw : Print "Press "Enter" to go to the menu" : if returnkey()=1 then goto menu
 balance:
 cls : set text size 20 : center text 150,0,"Balance" : print : print : print : Print "Your current balance is $";balance : print : Print "Press "Enter" to go to the menu" 
 do  
 if returnkey()=1 then goto menu  
 loop
Posted: 29th Dec 2003 21:27
nice
Posted: 29th Dec 2003 22:49
Thanks.Have some problems like when you are in the deposit area and you deposit and press enter then you jump to the witdraw area.
Posted: 30th Dec 2003 12:01
if you do something like:

r$ = input$

if r$ = "1" then stuff


The program should continue looping through without waiting for you to hit the <return>. You'll only have to hit one key.
Posted: 30th Dec 2003 17:30
or wait key and suspend for key commands
Posted: 30th Dec 2003 17:30
i'll put that to the code