據我所知如果then後面的敘述式不只一個, 就會用begin..end的寫法, 例如
If Close > Open Then
Begin
Value1 = Close - Open;
Value2 = High - Low;
End;
那如果敘述式也是if的話, 一樣要用begin...end嗎? 如下:
If Close > Open Then
Begin
If Open>Close[1] Then
Value1 = Close - Open;
End;
以上是否可以寫成不用begin...end, 如下:
If Close > Open Then
If Open>Close[1] Then
Value1 = Close - Open;
2 評論