User login

  

Punctuation

Mark

Description

Usage and Examples

;

semicolon

 

1) Ends a statement:

int var1;
    if(var1 > var2)
        return var1
    else
        return var2;  

2) Separates descriptive names and values in predefined value pairs in input type variable declarations:
{"Close"; CLOSE}

()

parentheses

1) In expressions, group values to modify the order of operations:
var1 = (a + b)/c;

2) Enclose descriptive names of variables and functions:
double var1 = 2.5 ("This is a descriptive name");

,

comma

 

1) Separates formal parameters in function definition:
function int GetMaxPeriod(int shortPeriod, int middlePeriod, int longPeriod)

2) Separates arguments at function call:
state = CompareMA(shortMa, middleMa, longMa);

 

.

dot

Separates module and variable names when referring to an external variable:
system.var1

 

" "

 

double quotation marks

Enclose text strings:
string var1 = "text";

 

' '

 

single quotation marks

Enclose characters:
char var1 = 'a';

[]

square brackets

Enclose array indices:
sum += Array[arrayNumber][i];

 

{}

curly brackets

 

1) Compound statement brackets. Enclose a block of statements, such as function body, a While loop body or an If statement body:

 if(price > high)
 {
     high = price;
     perHigh = period;
 };

2) Enclose predefined value pairs in input type variable declarations:
input int SourcePrice = CLOSE ("Source prices for MA")
{"Close"; CLOSE}
{"Open"; OPEN}
{"High"; HIGH}
...

12345

Comments