Vbscript-decisions

提供:Dev Guides
移動先:案内検索

VBScript-意思決定

意思決定により、プログラマはスクリプトまたはそのセクションの実行フローを制御できます。 実行は、1つ以上の条件ステートメントによって管理されます。

以下は、ほとんどのプログラミング言語で見られる典型的な意思決定構造の一般的な形式です-

VBScriptの意思決定ステートメント

VBScriptは、次の種類の意思決定ステートメントを提供します。

Statement Description
if statement An *if *statement consists of a Boolean expression followed by one or more statements.
if..else statement An* if else statement consists of a Boolean expression followed by one or more statements. If the condition is True, the statements under the If statements are executed. If the condition is false, then the Else *part of the script is Executed
if…​elseif..else statement An* if statement followed by one or more ElseIf *Statements, that consists of Boolean expressions and then followed by an optional else statement, which executes when all the condition becomes false.
nested if statements An* if or elseif statement inside another if or elseif *statement(s).
switch statement A* switch* statement allows a variable to be tested for equality against a list of values.