GO-TO vs GO-SUB?

Startseite Foren LED-Basic GO-TO vs GO-SUB?

Ansicht von 3 Beiträgen - 1 bis 3 (von insgesamt 3)
  • Autor
    Beiträge
  • #1569
    johnsvensk
    Teilnehmer

    Hello,
    I am reading the example code to my Nixie-LED-M, and I wonder what is the difference between GOTO and GOSUB? I learnt a bit of BASIC back in the previous century, but 25 years does things to your memory… 😉

    All the best,
    John

    #1570
    ER-Tronik
    Verwalter

    GOTO simply jumps to another line, GOSUB keeps track of where it came from (on a stack, presumably), so when the interpreter encounters a RETURN, it goes back to the last place GOSUB was called.

    Found via Google:
    https://stackoverflow.com/questions/12810702/what-are-the-difference-between-a-basic-goto-and-gosub-statement

    #1571
    Vanessa
    Moderator

    Hello John,
    see you found the way to the forum.
    We are looking forward to your program code 🙂

    Vanessa

Ansicht von 3 Beiträgen - 1 bis 3 (von insgesamt 3)
  • Du musst angemeldet sein, um auf dieses Thema antworten zu können.