anScript

Logic

Logic values are being stored in var.i supertype. Value 0.i represents false and not 0.i is true.

If statements:

logicIf(var.i logicValue)

semi-tag, to make non-direct call add { at the and of line

If statement, block of code ends on line with closing curly brace (}).


logicIfLines(var.i logicValue, var.i howManyLines)

not recommended for beginner

If statement, block of code consists of howManyLines lines, howManyLines includes line with logicIfLine instruction and doesn’t include empty lines or lines with comments.


logicIfIdentifier(var.i logicValue, var idn)

not recommended for beginner

If statement, block of code ends on line with identifier identifier(var idn)).

Loop statements:

logicLoop(var.i logicValue)

semi-tag, to make non-direct call add { at the and of line

Loop statement, block of code ends on line with closing curly brace (}).


logicLoopF(&var i, var max)

semi-tag, to make non-direct call add { at the and of line

Loop statement, it iterates from i+1 to max, i and max must be var.i or var.f, block of code ends on line with closing curly brace (}).


logicLoopI(var.i logicValue, ins, &var arg, ...)

semi-tag, to make non-direct call add { at the and of line

Loop statement, it executes ins(&var arg, ...) and then check if logicValue is true, block of code ends on line with closing curly brace (}) .


logicLoopLines(var.i logicValue, var.i howManyLines)

not recommended for beginner

Loop statement, block of code consists of howManyLines lines, howManyLines includes line with logicLoopLine instruction and doesn’t include empty lines or lines with comments.


logicLoopIdentifier(var.i logicValue, var idn)

not recommended for beginner

Loop statement, block of code ends on line with identifier identifier(var idn)).

Switch statement:

Giving an example is the best way how switch work. Remember to add logicDefault as the last option.

logicSwitch(variable)
    logicCase(2.i)
        consolePrint(two.s)
    }
    logicCase(1.i)
        consolePrint(one.s)
    }
    logicCase(logicDefault)
        consolePrint(not_two_and_not_one.s)
    }
}

logicSwitch(var variable)

semi-tag, to make non-direct call add { at the and of line

Begin switch statement.


logicCase(var variable)

tag, must be called directly

One option in switch statement.


logicSwitchIdentifier and its companions also exists, but its really not reccomended.

Logical operations:

logicAnd(&var.i result, var a.i, var.i b)

result = a AND b.


logicOr(&var.i result, var.i a, var.i b)

result = a OR b.


logicNegation(&var.i a)

result = NOT a.