Menu

RE: [gcbasic:discussion] Stack Depth?

joe rocci
2017-10-14
2017-10-14
  • joe rocci

    joe rocci - 2017-10-14

    I've never seen this style before. What does it accomplish?

    -------- Original message --------
    From: stan cartwright stanleyella@users.sf.net
    Date: 10/13/2017 7:40 PM (GMT-05:00)
    To: "[gcbasic:discussion]" 579125@discussion.gcbasic.p.re.sf.net
    Subject: [gcbasic:discussion] Stack Depth?

    How to get 50 subs. Not really.

    goto sub1

    retsub1:

    end
    sub1

    goto sub2

    retsub2: goto retsub1
    sub2

    goto sub3

    retsub3: goto retsub2
    sub3

    code..47 more subs

    goto retsub3

    Stack Depth?

    Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/gcbasic/discussion/579125/
    To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

     
  • stan cartwright

    stan cartwright - 2017-10-14

    A gosub returns to the next basic line. Goto could do the same but it looks messy code but no stack use.
    I was joking about goto but not about putting subs in line.
    Take the glcd line code for ssd1306. Every pixel in the line is plotted from pset sub. The pset sub could be in line instead of repeatedly being called and would draw lines faster.

     

Log in to post a comment.