Welcome, Guest. Please login or register.

Author Topic: AmigaBASIC structural question...  (Read 1606 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline blakespotTopic starter

  • Hero Member
  • *****
  • Join Date: Dec 2003
  • Posts: 880
  • Country: us
  • Thanked: 8 times
  • Gender: Male
  • Visit ByteCellar.com
    • Show all replies
    • ByteCellar - The Vintage Computing Blog
AmigaBASIC structural question...
« on: October 11, 2013, 10:13:16 PM »
I've got a question for anyone that ever played around with AmigaBASIC. (Not ABasiC, but AmigaBASIC that came after.)

I have a program that is doing some GOSUBs to a subroutine. Inside that subroutine, I need to do a GOTO to a sub-section of the subroutine code, depending on a variable state. How is this done, with labels?

I try:

MySubroutine:
x=0:y=0
read x,y....blabla
...
...
...
...
if x > whatever then goto (that read line above)
RETURN

Whenever I change that read line to...

ReadLine: read x,y .....blablabla

and then...

...goto ReadLine

I get undefined routine error. Not wanting to use line numbers for this - AmigaBASIC wasn't setup for that, really.

Basically, how does on goto inside a subroutine, is the question?

Thanks!





bp
:: ByteCellar.com - The Vintage Computing Weblog
:: Amigas: 1000, 2000 '020, SAM440ep-Flex