Menu

Passing a string to a sub

Help
jackjames
2020-10-28
2020-10-29
  • jackjames

    jackjames - 2020-10-28

    I don't know if it's a compiler bug or (most likely) I'm doing something wrong.
    I have to pass some data to a sub including, as an option, a byte variable and a string.
    When I go to compile this message comes out:
    Error: GCASM: Symbol 00 has not been defined at MOVLW LOW SALTRO
    Error: GCASM: Symbol 00 has not been defined at MOVLW HIGH SALTRO

    Where am I wrong?
    I don't insert the source because there are over 6000 lines of code ...

    This is the offending routine:

    '       -
    '       -
    '       ========================================================================
    '       Stampa il messaggio alla locazione n
    '       ------------------------------------------------------------------------
    Sub PrintMes (In NumMes As Byte, Optional In NumCrLf As Byte = 0, Optional In sAltro As String = "")
            Dim Lm   As Byte
            Dim MCnt As Byte
    '       -
            Lm = LeggiMessaggio (NumMes)
            For MCnt = 0 to Lm -1
               HSerPrint MESSAGGIO (MCnt)
            Next MCnt
    '       -
            If sAltro <> "" Then
               HSerPrint sAltro
            End If
    '       -
            If NumCrLf Then
               Repeat NumCrLf
                  hserprintcrlf
               End Repeat
            End If
    End Sub
    
     
  • Anobium

    Anobium - 2020-10-28

    Need the ASM please.

     
  • jackjames

    jackjames - 2020-10-28

    This is the ASM

     
  • jackjames

    jackjames - 2020-10-28

    This is the call to test:

    PrintMes 1,  2,  "Ciao"
    
     
  • stan cartwright

    stan cartwright - 2020-10-28

    For MCnt = 0 to Lm -1
    Does gcb always start at 1?

     
  • jackjames

    jackjames - 2020-10-29

    Messaggio is an array of byte. Start at address 0.

     
  • Anobium

    Anobium - 2020-10-29

    Try this, as I not idea what is happening but it may be related the optional. I have added 'erv to the code pieces.

    Sub PrintMes (In NumMes As Byte, Optional In NumCrLf As Byte = 0, Optional In sAltro As String = "")
    Dim Lm As Byte
    Dim MCnt As Byte
    'ERV
    Dim sAltro As String
    ' -
    Lm = LeggiMessaggio (NumMes)
    For MCnt = 0 to Lm -1
    HSerPrint MESSAGGIO (MCnt)
    Next MCnt
    ' -
    'erv
    if sAltro(0) <> 0 then
    If sAltro <> "" Then
    HSerPrint sAltro
    End If
    end if
    ' -
    If NumCrLf Then
    Repeat NumCrLf
    hserprintcrlf
    End Repeat
    End If
    End Sub

     
  • jackjames

    jackjames - 2020-10-29

    The exact same error occurs.

     
  • jackjames

    jackjames - 2020-10-29

    If I remove optional the exact same error occurs

     
  • Anobium

    Anobium - 2020-10-29

    I am guessing, so, I need the complete project. You know my email address.

     
  • jackjames

    jackjames - 2020-10-29

    OK, I'll prepare everything and send it to you

     
  • jackjames

    jackjames - 2020-10-29

    @Anobium:
    I sent you the files

     

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.