Jump to content
IGNORED

on ... gosub does not work with bankswitching?


Recommended Posts

I need help :( 

 

This works:

 

on e gosub szene1 szene2 szene3...

 

This doesn´t work:

 

on e gosub szene1 bank2 szene2 bank2 szene3 bank2...

 

Will i have to put all szene´s into bank1? Or is it possible to jump to another bank and there is a syntax error in my code?

 

On..gosub and on..goto don't work across different banks. One workaround would be to have the on...gosub go to something in the same bank that then uses goto to go to the other bank. So like

 

 on e gosub jumpszene1 jumpszene2 jumpszene3...

jumpszene1

 gosub szene1 bank2

jumpszene2

 gosub szene2 bank2

 

 

Or put the on...gosub in bank2, something like

 

goto pickszene bank2

.

.

.

pickszene

 on e gosub szene1 szene2...

  • Like 2

Also, watch out for putting too many labels in your on .. goto/gosub statements.

https://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#ongosub

 

I keep the labels under 45 per R.T.s hints in the link.  Also, make the labels VERY short just in case the parser doesn't like VERY long single line statements.  I don't really know how many characters are allowed, but, yeah.

 

Not the problem you were having BUT it's often the very next to come up :)

  • Like 2

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...