Search code examples
delphidelphi-4

what does underscore mean in Delphi4


I come across the following in code.

_name1
_name2
smeEGiGross:  

In general, what does _name1 underscore mean in Delphi 4?


Solution

  • I think it's just a common practice to begin variable names with underscores.

    Rules for variable (and component) names in Delphi:

    • Name can be any length but Delphi uses only first 255 characters.
    • First character must be letter or underscore not a number.
    • You cannot use any special characters such as a question mark (?), but you can use an underscore (_).
    • No spaces area allowed in the name of a variable.
    • Reserved words (such as begin, end, if, program) cannot be used as variables.
    • Delphi is case insensitive – it does not matter whether capital letters are used or not. Just make sure the way variables or components are used is consistent throughout the program.