Grammar




Program body:

A program body consist either of a single command or of a list of commands
separate by a semicolon ';'.
Note! The last command in a list must not have the semicolon after the command.

Example:
{Single command}
show "Example" at 1,1

{List of commands}
i%=10;
j%=20;
show "Example" at i%,j%



Assignments:

You assign a varible by its name and data type and then with a '=' sign,
then the value or an expression you want to assign to.

Examples:
i%=10; {Assign the value 10 to the number i%}
a$="Example"; {Assign the text 'Example' to the text a$}
t!=23:15; {Assign the time quater past eleven p.m to the time t!}
d?=12/25/1998; {Assign the date christmas day 1998 to the date d?}

{Mathematical functions for numbers}
{Example:}
j%=i%+10; {This will add the number ten to i%, i% must have an value.}
k%=0-10; {This will set k% to the value -10, Note! you must have the 0 before the '-' sign.}
l%=i%*2; {This will set l% to the double value of i%.}
m%=j%/2; {This will devide the number j% in two.}

{Text function for text strings}
{Example:}
b$="Test "+a$ {This will set b$ to the text value 'Test Example'.}



Logical Expressions:

General:
You can have a single comparison or a multiple comparisons with 'and' or 'or'
separating them and you can use the brackets () to change the order.

Examples:
if i%=10 then show "True" at 1,1 endif; {Check if i%=10}
if i%=10 or i%=20 then show "True" at 1,1 endif; {Check if i%=10 or if i%=20}
if i%=10 and j%=20 then show "True" at 1,1 endif; {Check if i%=10 and if j%=20}
if (i%=10 or i%=20) and (j%=10 or j%=20) then show "True" at 1,1 endif;
{Above checks if (i%=10 or i%=20) and if (j%=10 or j%=20)}
if (i%=10 and j%=10) or (i%=20 and j%=20) then show "True" at 1,1 endif;
{Above checks if (i%=10 and j%=10) or if (i%=20 and j%=20)}



Numeric and Date Comparisons:
x%=y% : Equal, check if x% have the same value as y%.
x%>y% : Greater, check if x% is greater than y%.
x% x%>=y% : Greater/Equal, check if x% is greater or equil than y%.
x%<=y% : Less/Equal, check if x% is less or equal than y%.
x%<>y% : Not Equal, check if x% is not equal to y%.

Text Comparisons:
a$=b$ : Equal, check if the text in a$ is the same in b$, case sensitive.
a$<>b$ : Not Equal, check if the text in a$ is not the same in b$, case sensitive.

Time Comparisons:
Time comparisons are not implemented in this version of WebBase.



Home

Last Updated: July 1998.