I'm back att Qbasic again after 20 years... I'm trying to have a value changed several times, depending on input. This is a very newbie-app, and I'm sure there's an simple answer but this is rubbing my brain.
I want the CREDIT to change with +10 or -10 and have the CREDIT changed there after. Now if I press B it only subtract -10 one time (result CREDIT 90), it stays at 90. I want CREDIT to change every time, according to my input of choice. Let's say I press B the first time, result is CREDIT 90. After that it goes back to line 101 so that I can choose if I want to B or S again, so if I choose to B again, I want the CREDIT to be 80. It just stays at 90. It's of course the same but add instead if I choose S (result CREDIT 110).
Code:
1
CLS
credit = 100
sell = credit + 10
buy = credit - 10
101
CLS
PRINT " (Q)uit"
PRINT " Your credit: "; credit
PRINT: PRINT
INPUT " (B)uy for 10 or (S)ell for 10"; bs$
bs$ = LCASE$(bs$)
IF bs$ = "b" THEN GOTO 2
IF bs$ = "s" THEN GOTO 3
IF bs$ = "q" THEN END ELSE GOTO 101
2
credit = buy
GOTO 101
3
credit = sell
GOTO 101
Thanks for any help!