Macro programming
Macro programming

Supported operations on expressions

3min

Unary operations

Operation

Description

abs

Absolute Value

acos

Arc cosine

asin

Arc sine

atan[y][x]

Arc tangent

cos

Cosine

exp

e raised to

fix

Round down

fup

Round up

int

Integer part

ln

Natural log of

round

Round

sin

Sine

sqrt

Square root

tan

tangent

not

Logical not

ResetModulo

[A|B|C] reset a rotation axis to its modulo position

Binary Operations

Operation

Description

/

Divided by

mod

Modulo

**

Power

*

Times

and

Logic AND

xor

Logic exclusive OR

-

Minus

or

logic nonexclusive OR

+

Plus

>

Greater then

>=

Greater than or equeal

<

Less then

<=

Less than or equal

==

Is equel

<>

Not equeal

band

Bitwise AND

bxor

Bitwise exclusive OR

bor

Bitwise nonexeclusive OR

<<

Shift left

>>

Shift right

Example

This example drills holes at a circle with a radius of 10, each 30 degrees. The code that performs this is put in a subroutine, which can be called as many times as needed in the main program.

sub do_circle_holes #100=0 g0 z1 x0 y0 while [#100 <> 360] #102 = [10 * sin[#100]] #103 = [10 * cos[#100]] g0 x[#103] y[#102] g1 z-1 g1 z1 #100 = [#100 + 30] if [#100 == 360] msg "Done" else msg "processing at angle "#100 endif endwhile endsub gosub do_circle_holes M30