条件が True の場合にコマンドブロックを実行します。
If cond
block1
[ Else
block2 ]
EndIf
入力値の説明:
cond
If で評価する条件です。
block1
cond 条件が True と評価された場合に実行されるブロックです。
block2
cond 条件が False と評価された場合に実行されるブロックです。
オブジェクト: Procedure、
Transaction、
Web Panel、
Work Panel、
Panel、
Work With for Smart Devices
ジェネレーター:
.NET、
.NET Framework 、
Java、RPG、Cobol、Ruby (GeneXus X Evolution 3 まで)、Visual FoxPro (GeneXus X Evolution 3 まで)
If コマンドを使用すると、コマンドブロックの実行に条件を加えられます。
block
1 および block
2 で、それぞれどのコマンドでも定義できます。
If &del //&del は boolean 変数
DelCustomer(CustomerId) //DelClient はプロシージャー、CustomerId はパラメーターによって送信される項目属性 (コンテキストに値を持つ)
Else
Return
EndIf
このコマンドを
Panel オブジェクトまたは
Work With パターンと Work With オブジェクトで使用する場合、
cond 構文には制限があります。
Boolean データタイプの変数、項目属性、または SDT エレメントのみを使用できます。