Switch 多分支条件语句
来自tradeStar帮助系统
| 函数 | Switch |
| 别名 | 无 |
| 所属类别 | 控制语句 |
| 参数数量 | 0 |
| 运行模式 | 逐根/逐行 |
| 说明 | 多分支条件语句 |
| 用法 | 语法:
switch ( expression ) begin case constant-expression : statement case constant-expression : statement ... [default : statement] end 当express等于不同的case值时,执行不同的动作”
switch( x ) begin case 1: a:=20; case 3: a:=50; case 100: a:=H; default: a:=c; end 当x等于1时a赋值20,当x等于3时a赋值50;当x等于100时a赋值最高价,其他的a赋值收盘价 |