if <wert1> <operator> <wert2> then

beasscript-logo-small

 

Operators

The following operators are supported

 

<        lower than

>        greater than

>=        greater equal than

<=        lower equal than

=        equal

<>        not equal

n<        numeric smaller than

n>        numeric greater than

n<>        numeric not equal

n=        numeric equal ( up top 4 positions )

n>=        numeric greater equal

n<=        numeric lower equal

in        check, if operator 1 in operator 2. Operator 2 must be in {...}. Example: if a in {1,5,20,10} then ...

 

Operators must begin and end with a whitespace.

 

Ok: 5 > 4

Error: 5>4                // "space" missing!

Ok:  55.3 n> 9.4    // numeric values with n-Operator!

 

 

Logical Operator

and        Logical "and"

or        Logical "or"

 

help-achtungsetting of brackets not allowed

This will not work:

if (<value1> = P or <value2> = X) then

 .....

end if

 

 

help-achtungUp to this point nested if .. then are not supported.

This will not work:

if .. then

 if .. then

 end if

end if

 

If you need a nested if than you have to use a sub-function.

if .. then

  myfunction()

end if

end

 

function myfunction

if ... then

end if

return true

end

 

 

help-achtungcombinations with "and" and "or" are not allowed

if <value1> = P or <value2> = X and <value3> = Y then

 .....

end if

 

// Workaround: A possible way via SQL-Statemend could be:

setvar=wert1=0

select 1 where (<value1,dbstring> = 'P' or <value2,dbstring> = 'X') and <value3,dbstring> = 'Y'

if <wert1> n= 1 then

 .....

end if

 

 

help-achtungcombinations of more then 1 value with empty contents could be perform a wrong result

if <value1> <> or <value2> = then

 .....

end if

 

// Workaround: A possible way via SQL-Statemend could be:

setvar=wert1=0

select 1 where (isnull(<value1,dbstring>,'') <> '' or isnull(<value2,dbstring>,'') = ''

if <wert1> n= 1 then

 .....

end if

 

 

help-achtung Take care about  Upper / lower case and White Spaces.

 

Values:

Can be a placeholder.

<variable,formatting>

Can be a command. Use a "!" Return values are

1 = Ok

0 = Nothing

1 = Error

Can be a string.

 

 

Execution:

The execution can be a command, beginning with an "!".

It can be a goto mark or a function().

 

Examples:

// Color insertion

input=Please insert a color name=c_color==return false

if <c_color> = red then

  messagebox=You've inserted 'red'

elseif <c_color> = yellow then

  messagebox=You've inserted 'yellow'

else

  messagebox=You've inserted a not possible color

end if

return

 

// Number selection

input=Please insert a number=c_number=0=return false

if <c_number> n> 10 then

  messagebox=You've inserted a number greater 10

elseif <c_number> n<= 10 and <c_number> n=> 5 then

  messagebox=You've inserted a number between 5 an 10

else

  messagebox=You've inserted a number less 5

end if

return