REM

Category: Instructions

The REM keyword in ProBuilder language is used to introduce comments within the code. Comments are lines that are not executed as part of the program but are used to provide explanations or annotations about the code, making it easier to understand and maintain. Comments can be particularly useful for explaining the purpose of specific code segments, variables, or complex logic.

Syntax:

REM This is a comment
// This is another way to comment the code
/* This is another way to comment the code 
with multiple lines */

Example:

REM Calculate the simple moving average (SMA) for the last 10 periods of high prices
i1 = average[10](high)
// i1 now holds the SMA value
/* 
this is another 
comment of my code 
*/

In the example above, the first line starting with REM is a comment explaining what the following line of code does. The second line calculates the simple moving average of the high prices over the last 10 periods and stores it in the variable i1. The third line, starting with //, is another form of comment used to explain that i1 now contains the SMA value.

Additional Information:

  • Comments are essential for documenting your code and making it easier for others (or yourself at a later time) to understand.
  • Both REM and // are valid for adding comments, but they cannot be nested within each other.
  • Comments do not affect the performance of your code as they are ignored during the execution.

Using comments effectively can greatly enhance the readability and maintainability of your code in ProBuilder.

Logo Logo
Loading...