Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo Pascal - <b> error 41 syntax error or incorrect identifier pp 322</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Error 41           Syntax Error or Incorrect Identifier              pp 322

 Source:  Compiler

 Cause:   Syntax Error:
              Incorrectly spelled or unknown identifier.
              First character of identifier is not letter or underscore.
          Incorrect Identifier:


 Remedy:  Examine the statement ahead of the error cursor for the above
          condition.

 Notes:   Legal characters for identifiers are letters, digits, and the
          underscore.

          An identifier must begin with either a letter or underscore.



 Example:
       CONST
          WSpace : Set of Char =    { Wrong   - CHR use illegal with SET    }
                   [Chr(9),Chr(10),
                   Chr(13),Chr(32)];

          WSpace : Set of Char =    { Correct - use Ordinals with SET       }
                   [#9,#10,#13,#32];

          Drive  = 'A'            ; { Constant value of 'A'                 }

       VAR
          BVar   :  Byte          ; { Byte type                             }
          CVar   :  Char          ; { Char type                             }
          IVar   :  Integer       ; { Integer type                          }
          SVar   :  String [10]   ; { String type                           }
          RVar   :  Real          ; { Real type                             }

       BEGIN
          RVar   :=  .1234        ; { Wrong - needs leading zero            }
          RVar   := 0.1234        ; { Correct                               }

          Drive  := 'B'           : { Wrong - can't reassign a constant     }
       END.

See Also: Boolean Byte Char Integer Real String

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson