Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parserutils.php on line 205

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parserutils.php on line 208

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parserutils.php on line 389

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parserutils.php on line 530

Deprecated: Function split() is deprecated in /var/www/siebn.de/wiki/inc/auth.php on line 154
expressions [Burning Sand Wiki]
Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead in /var/www/siebn.de/wiki/inc/template.php on line 242
 

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/parser.php on line 66

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/lexer.php on line 292

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/handler.php on line 22

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/handler.php on line 49

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/handler.php on line 213

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/handler.php on line 241

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/handler.php on line 295

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/handler.php on line 328

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/handler.php on line 575

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/siebn.de/wiki/inc/parser/xhtml.php on line 939

Operators

Available Operators

  • + Addition
  • - Subtraction
  • * Multiplication
  • / Division
  • % Modulus (remainder)
  • & Bitwise AND
  • | Bitwise OR (inclusive or)
  • && Logical AND
  • || Logical OR
  • != Relational “not equal to”
  • == Relational “equal to”
  • < Relational “less than”
  • ⇐ Relational “less than or equal to”
  • > Relational “greater than”
  • >= Relational “greater than or equal to”
  • RAND A random number.
  • PIXEL The Element ID of an Pixel.
  • INGROUP Test if an element is in a group.
  • MIN will return the lower of both values
  • MAX will return the higher of both values
  • ^ Exponents
  • TAN Tangent
  • SIN Sine
  • COS Cosine
  • TAN-1 Arctangent
  • SIN-1 Arcsine
  • COS-1 Arccosine
  • SQRT Square root

Self defined Functions

A trigger can have a return value. This trigger will return the square of the first parameter:

ON square RETURN ($0 * $0)

To call this function put an asterisk in front of the triggername. For example:

SET a (*square 7)

will set a to 49.

Self defined functions should always be surrounded with parentheses. For example:

SET a (*square (*square 7))

will return (7*7)*(7*7) = 2401.

Floating Point Operations

SIN and COS are floating point operations, but BS2 doesn't have floating point variables, so you have to multiply the parameters by 1000 and devide the result by 1000. This way you get 3 decimal digits. For example “SET a (SIN 7000)” will set “a” to the sin 7 multiplied by 1000. So “a” will be 121. The real value for sin 7 would be 0,121869…

Examples

SET tutorialvar 7

will set tutorialvar to 7.

SET tutorialvar (7 * 7)

will set tutorialvar to 49.

SET tutorialvar (5 == 7)

will set tutorialvar to 0.

SET tutorialvar (5 == 5)

will set tutorialvar to 1.

SET tutorialvar (SIN 7000)

will set tutorialvar to sin(7) * 1000 = 121.

 

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead in /var/www/siebn.de/wiki/inc/template.php on line 785
expressions.txt · Last modified: 2008/08/08 14:19 (external edit)
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki