' Operator

Used to add comments to code.

# Notes

# Syntax

' text string

REALbasic's compiler will ignore any comments you enter following the ' operator. Comments are not included in stand-alone applications.

The // operator or Rem statement can be used to comment code as well. Comments can appear on separate lines or on the same line as executable code, provided they are to the right of any code that will execute. Valid comments appear in the Code Editor in red.

The Control-' keyboard shortcut (Command-' on Macintosh) toggles the selected lines of code between commented out and 'live' states. If the insertion point is somewhere in the middle of the line when you press Control-' or Command-', the entire line is commented out. If you only want to comment out the text to the right of the insertion point, press, ' or use // or Rem.

# Example

The following code uses comments to document the results of Boolean comparisons:

Dim a As Boolean
Dim b As Boolean
Dim c As Boolean
Dim d As Boolean
a= True
b= False
d=a Or b ' Evaluates to True
d=b And c ' Evaluates to False

# See Also

Rem statement; // operator.