Page 1 of 1

basic : I'm looking for a quick key query and jump with gosub

Posted: Mon Mar 25, 2024 9:32 am
by funkheld
Hi good afternoon.

I'm looking for a quick key query and jump with gosub.
How can my key query be made faster please?

Thanks.
greeting

Code: Select all

START:
  GET A$ 
  B=ASC(A$)
  IF B=88 THEN GOTO WEITER
  IF B=81 THEN GOSUB SPRLI
  IF B=69 THEN GOSUB SPRRE
  IF B=87 THEN GOSUB SPRUP
  IF B=83 THEN GOSUB SPRDOWN
  IF B=82 THEN GOSUB SCRLINKS
  IF B=84 THEN GOSUB SCRRECHTS
GOTO START

SPRLI:
...
...
return

SPRRE:
.....
......
return


Re: basic : I'm looking for a quick key query and jump with gosub

Posted: Mon Mar 25, 2024 11:36 am
by ahenry3068
Look at the ON (X) GOTO/GOSUB STATEMENT. You'll have to rearrange your code a little but it will give you better response than the IF / THENS

Re: basic : I'm looking for a quick key query and jump with gosub

Posted: Mon Mar 25, 2024 12:02 pm
by funkheld
hello thanks for info.


greeting