Variables
Functions
Flow of Control
Other Items of Interest
fred =
long(14.5);
local integer selection;
selection =
ask("How do you like them
apples", "Not at all",
"Somewhat",
"Love 'em");
in integer x;
in integer y;
result = x
+ y;
result = Add2Numbers(10, 20);
inout integer y;
y = x + y;
y = 20;
call AddXtoY, 10, y;
[I really don't like the way its the procedure that
determines the by-reference or by-value status]
Optional parameters can be specified using the
optional keyword (optional in integer X)
and detected using the missing() function.
Optional parameters are not restricted to being the last items in the
parameter list, but it is recommended. If the optional parameter is not
specified by the caller and it is not the last parameter in the list a
placeholder must be included by the called (e.g. call myfunc, x,,z;)
If a
parameter is passed as an out to procedure A
then procedure A can only pass it to procedure B as an out.
in and inout are
not restricted in any way.
warning("X is bigger than 100!");
warning("No block deliminators required for multiple statements");
else
warning("X is 100 or less!");
end if;
'X' = 'X" + i;
end for;
for i = 1 to 10 by 2 do
'X' = 'X" + i;
end for;
'loop' = 0;
while 'loop' < 10 do
'loop' = 'loop' + 1;
end while;
repeat
'loop' = 'loop' -1;
until loop < 1;
in [-10 to 10]
warning ("X is between -10 and 10 inclusive");
in [11 to 20]
warning ("X is between 11 and 20 inclusive");
else
warning("default!");
end case;
{
// Beep prototype from user32.lib (but lives in kernel32.dll)
BOOL Beep(DWORD dwFreq, DWORD dwDuration)
}
out integer result;
in long dwFreq;
in long dwDuration;
in long frequency;
in long duration;
extern 'Beep@kernel32.dll',
result, frequency,
duration * 2;
{ sixteenth,eighth,quarter,half,whole }
local long s = 50; local long o = 100; local long q = 200;
local long tq = 300; local long h = 400; local long th = 500;
local long w = 800;
local long lC = 262; local long lD = 294; local long lE = 330;
local long lF = 350; local long lG = 392; local long lA = 440;
local long lB = 494; local long lCs= 277; local long lDs= 311;
local long lFs= 370; local long lGs= 415; local long lAs= 466;
local long C = 523; local long D = 587; local long E = 659;
local long F = 698; local long G = 784; local long A = 880;
local long B = 988; local long Cs = 554; local long Ds = 622;
local long Fs = 740; local long Gs = 830; local long As = 932;
local long hC = 1046;
Play (C,h); Play (G,h); Play (F,s); Play (E,s); Play (D,s);
Play (hC,h); Play (G,h); Play (F,s); Play (E,s); Play (D,s);
Play (hC,h); Play (G,h); Play (F,s); Play (E,s); Play (F,s);
Play (D,h); Play (lG,s); Play (lG,s); Play (lG,s); Play (C,h);
Play (G,h); Play (F,s); Play (E,s); Play (D,s); Play (hC,h);
Play (G,h); Play (F,s); Play (E,s); Play (D,s); Play (hC,h);
Play (G,h); Play (As,s); Play (A,s); Play (As,s); Play (G,h);
Play (G,h); Play (lG,h); Play (lG,s); Play (lA,th);Play (lA,o);
Play (F,o); Play (E,o); Play (D,o); Play (C,o); Play (C,s);
Play (D,s); Play (E,s); Play (D,s); Play (lA,o); Play (lB,q);
Play (lG,tq);Play (lG,s); Play (lA,th); Play (lA,o); Play (F,o);
Play (E,o); Play (D,o); Play (C,o); Play (G,o); Play (D,th);
Play (lG,tq);Play (lG,s); Play (lA,th); Play (lA,o); Play (F,o);
Play (E,o); Play (D,o); Play (C,o); Play (C,s); Play (D,s);
Play (E,s); Play (D,s); Play (lA,o); Play (lB,q); Play (G,tq);
Play (G,s); Play (hC,tq);Play (As,s); Play (Gs,tq);Play (G,s);
Play (F,tq); Play (Ds,s); Play (D,tq); Play (C,tq); Play (G,h);
Play (G,tq); Play (G,s); Play (G,s); Play (G,s); Play (G,s);
Play (hC,o); Play (C,s); Play (C,s); Play (C,s); Play (C,th);