Menu

Gosub Return "Missing Sub Definition"

Help
JB
2024-04-25
2024-04-26
  • JB

    JB - 2024-04-25

    Hello,
    I was writing some code and after 1 hour, I decided to look at GCStudio manual for reference about the
    Gosub / Return command and from the manual example page : 192 I've got an error as "Missing Sub Definition".
    Maybe the compiler or something else is not up to date.

    #option explicit
     #chip 16F628A, 4 'Change this to suit your circuit
      #define SOUNDOUT PORTA.4
      #define LIGHT PORTB.0
      Dir LIGHT Out
      Do
      'Flash Light
      PulseOut LIGHT, 1 s
      Wait 1 s
      'Beep
      Gosub PlayBeep
      Loop
      PlayBeep:
      Tone 200, 10
      Tone 100, 10
      Return
    
     
  • Anobium

    Anobium - 2024-04-25

    Good spot.

    I will have just sorted this out in the compiler. The compiler was looking for a SUB definition. As I tighten up the syntax these issues can arise.

    Download this fix. You will have to accept the warning from your Browser, and, you may have to UNBLOCK in the properties of the downloaded file. Then, replace your existing EXE.

    http://gcbasic.sourceforge.net/newfiles/gcbasic.exe?latest=1

     
  • JB

    JB - 2024-04-25

    Can't get the download, does'nt respond on Chrome.

    don't rush, I'll get on the next GCStudio update.

    Thanks Evan.

     
    • Anobium

      Anobium - 2024-04-25

      Try changing the http to https

       
  • JB

    JB - 2024-04-25

    Was able download and copy to "C:\GCstudio\gcbasic\gcbasic.exe"

    tried the same code but's not working.

     
  • Anobium

    Anobium - 2024-04-25

    You will have to copy the new exe over gcbasic.exe and gcbasic64.exe. If you do not and you Starr or restart GCSTUDIO will restore the old version.

     
  • JB

    JB - 2024-04-25

    It compiled but I eard 2 beep while compiling is this normal.

     
  • JB

    JB - 2024-04-26

    can't download the 64,

    An error has been encountered in accessing this page.

    1. Server: gcbasic.sourceforge.io
    2. URL path: /newfiles/gcbasic.exe64
    3. Error notes: NONE
    4. Error type: 404
    5. Request method: GET
    6. Request query string: latest=1
    7. Time: 2024-04-26 10:12:44 UTC (1714126364)
     
  • Anobium

    Anobium - 2024-04-26

    A typo - try the link again.

     
  • JB

    JB - 2024-04-26

    link worked ,
    still error:

     
  • Anobium

    Anobium - 2024-04-26

    Attach the code please. I would be guessing without it.

     
  • JB

    JB - 2024-04-26
    ; gosub 
    #option explicit
    #chip tiny10, 1
    
     ; ----- Include library
        #include <SoftSerial.h>
    
        ; ----- Config Serial UART for sending:
        #define SER1_BAUD 4800     ; baudrate must be defined
        #define SER1_TXPORT PORTB  ; I/O port (without .bit) must be defined
        #define SER1_TXPIN 0       ; portbit  must be defined
        #define SER1_INVERT On
    
    Dim Count as byte
    Dim Count1 as byte
    
    pause 1000
    ;BackLight On/Off
      ser1send 255  ;BackLight On
      pause 1
      ser1send 8    ;8=On, 0=Off
      pause 1
    
    DO
    ; Count Char
    for count = 128 to 167
        Count1 = count - 80
        gosub main
    next
    
    for count = 192 to 231
        Count1 = count - 104
        gosub main
    next
    
    pause 1000
    ; Clear LCD
      ser1send 254
      pause 1
      ser1send 1
      pause 1
      pause 1000
    loop
    
    Main:
        ser1send 254
        pause 1
        Ser1Send count
        pause 1
        Ser1Send Count1
        pause 1
    return
    
     
  • JB

    JB - 2024-04-26

    Ecxellent it's working !

     
    • Anobium

      Anobium - 2024-04-26

      Excellent. Another improvement.

       
  • JB

    JB - 2024-04-26

    Many thanks Evan.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.