Shop OBEX P1 Docs P2 Docs Learn Events
Error message: expected ',', end-of-line, or ',' — Parallax Forums

Error message: expected ',', end-of-line, or ','

NB_NesquikNB_Nesquik Posts: 35
edited 2012-01-21 17:43 in BASIC Stamp
Hello,

Im new to BASIC Stamp and one of my programs displayed the error message: expected ',', end-of-line, or ',' ;and I have tried all that i could to fix the problem. The message appears when i go to run the program and it highlights DATA after Dots.

Attachment not found. This is my program

Thanks

Comments

  • NB_NesquikNB_Nesquik Posts: 35
    edited 2012-01-21 17:37
    The error message is also displayed and highlights VAR after index, offset, noteLetter, etc.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-01-21 17:43
    You have some extraneous commas (highlighted in red):
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    Notes     DATA   "F", "A", "B", "F", "A", "B", "F", "A", "B", "E", "D",
                     "B", "C", "B", "G", "E", "E", "D", "E", "G", "E", "F",
                     "A", "B", "F", "A", "B", "F", "A", "B", "E", "D", "B",
                     "C", "E", "B", "G", "G", "B", "G", "D", "E", "D", "E",
                     "F", "G", "A", "B", "C", "B", "E", "E", "F", "G", "A",
                     "B", "C", "D", "E", "F", "D", "E", "F", "G", "A", "B",
                     "C", "B", "E", "E", "D", "F", "E", "G", "F", "A", "G",
                     "B", "A", "C", "B", "D", "C", "D", "E", "C", "D", "R",
                     "R", "E", "R", "Q"
    Octaves   DATA     6,   6,   6,   6,   6,   6,   6,   6,   6,   7,   7,
                       6,   7,   6,   6,   6,   6,   6,   6,   6,   6,   6,
                       6,   6,   6,   6,   6,   6,   6,   6,   7,   7,   6,
                       7,   7,   6,   6,   6,   6,   6,   6,   6,   6,   6,
                       6,   6,   6,   6,   7,   6,   6,   6,   6,   6,   6,
                       6,   7,   7,   7,   7,   6,   6,   6,   6,   6,   6,
                       7,   6,   6,   6,   6,   6,   6,   6,   6,   6,   6,
                       6,   6,   7,   6,   7,   7,   7,   7,   7,   7,   6,
                       6,   7,   6
    
    Durations DATA     8,   8,   4,   8,   8,   4,   8,   8,   8,   8,   4,
                       8,   8,   8,   8,   2,   8,   8,   8,   8,   2,   8,
                       8,   4,   8,   8,   4,   8,   8,   8,   8,   4,   8,
                       8,   8,   8,   2,   8,   8,   8,   8,   2,   8,   8,
                       4,   8,   8,   4,   8,   8,   2,   8,   8,   4,   8,
                       8,   4,   8,   8,   2,   8,   8,   4,   8,   8,   8,
                       8,   8,   2,   8,   8,   8,   8,   8,   8,   8,   8,
                       8,   8,   8,   8,   8,   8,  16,   8,  16,   1,   2,
                       4,   8,   8[b][color=red], <- Extraneous comma[/color][/b]
    
    Dots      DATA     0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
                       0,   0,   0,   0,   0,   0,   0,   0,   0,   1,   0,
                       0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
                       0,   0,   0,   0,   0,   0,   0,   0,   1,   0,   0,
                       0,   0,   0,   0,   0,   0,   1,   0,   0,   0,   0,
                       0,   0,   0,   0,   1,   0,   0,   0,   0,   0,   0,
                       0,   0,   1,   0,   0,   0,   0,   0,   0,   0,   0,
                       0,   0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
                       0,   1,   0[b][color=red], <- Extraneous comma[/color][/b]
    
    index         VAR     Byte
    offset        VAR     Nib
    
    noteLetter    VAR     Byte
    noteFreq      VAR     Word
    noteDuration  VAR     Word
    noteOctave    VAR     Nib
    noteDot       VAR     Bit
    DO UNTIL noteLetter = "Q"
      READ Notes + index, noteLetter
      LOOKDOWN noteLetter, [ "C",  "D",  "E",  "F",  "G",
                             "A",  "B",  "R",  "Q"], offset
      LOOKUP offset,       [4186, 4699, 5274, 5588, 6272,
                            7040, 7902,    0,   0 ], noteFreq
    
      READ Octaves + index, noteOctave
      noteOctave = 8 - noteOctave
      noteFreq = noteFreq / (DCD noteOctave)
    
      READ Durations + index, noteDuration
      noteDuration = 1000 / noteDuration
    
      READ Dots + index, noteDot
      IF noteDot = 1 THEN noteDuration = noteDuration * 3 / 2
    
      FREQOUT 4, noteDuration, noteFreq
    
      index = index + 1
    LOOP
    
    END
    

    -Phil
Sign In or Register to comment.