Skip to content

Latest commit

 

History

History
58 lines (51 loc) · 1.48 KB

2.1_Basic.md

File metadata and controls

58 lines (51 loc) · 1.48 KB

Syntax

與 C/C++ 不同之處

  • no address arithmetic; 沒有指標
  • no goto operator; 沒有 Goto 的跳躍
  • an anonymous enumeration can't be declared; 匿名的 enum 無法宣告
  • no multiple inheritance. 無法如標準的 C++ 可多重繼承

除此之外筆者的建議是從 C/C++ 學習就可以了。

Comment (註解方式)

使用 // 或是 /**/ 將註解內文包覆

//--- Single-line comment
/*  Multi-
    line         // Nested single-line comment
    comment
*/

Identifiers (識別字)

用以對 變數(variables)函式(functions) 的命名, 規則是

  1. 小於等於 63 個字元
  2. 可使用數字 0-9、a-z、A-Z、_(底線)
  3. 大小寫視為不同
  4. 字首不能使用數字
  5. 保留字無法使用

Reserved Words (保留字)

保留字為語法本身的關鍵字, 已經具有特殊用途而無法作為其他用途再使用

參考至 官網列表
Data Type
bool
char
class
color
datetime
double
Access Specificators
const
public
Memory Classes
extern
Operators
break
case
continue
default
delete
Other
false
this
true
strict

input 為 MQL4/5 特有, 用來作為定義程式的輸入參數介面