c_if

Top  Previous  Next

Branching procedure for the command line.

With c_if, a branch can be executed when executing multiple complex expressions. A branch can also be empty.

The input lines are read until a c_else or c_endIf is evaluated as the command interpreter. New main loops start with a parameter as the input line.

Parameter

/H

Help is provided for the c_if function. The help text contains a brief description of the function and instructions for calling it.

The parameter is optional and is specified in the form -H or /H (equivalent inputs).

Syntax

c_if   „Condition“

< Commands >

c_else

< Commands >

c_endIf

with n, k, m IN,, k m

The specified condition must be a function with a return value ∈ {0, 1}. There is no restriction on the number or complexity of the expressions executed depending on the branch selected.

c_if   „Condition“

< Commands >

c_elseif "Bedingung"

< Commands >

c_else

< Commands >

c_endIf

with n, k, m IN,, k m

The conditions are evaluated sequentially, and the first one with a numeric return value other than 0 is executed.

The c_elseif <statement> block can occur multiple times; c_else is optional.

Example

Input:

c_if m_eq (A B) !wenn A = B

 Echo 0 !dann gib mir  0

c_else

 c_if m_gt (A B) !wenn A > B

   Echo 1 !dann gib mir 1

 c_else m_lt (A B) !wenn A < B

   Echo –1 !dann gib mir –1

 C_endIf        

c_endIf

 

Structure always is like:

c_if

c_else

c_endIf

See also:

Option