POW! Language Differences

Here are a few of the things I found while learning POW!  They are not in any particular order.
1) RESERVED WORDS
All reserved words in POW! are in uppercase.  For example:
IF a = b THEN
  c := d;
ELSE
  x := y;
END;
2) The NOT EQUAL Symbol
Most languages I have used have <> as not equal - in POW you use the # character.  e.g.:
IF a # b THEN     (* IF a is not equal b THEN *)
3) Referencing VARiables and PROCEDURES in another module:
A POW! module has the following format:
MODULE modname;
IMPORT Windows, S := SYSTEM;
PROCEDURE myproc(a: aType): aType;
END;
END modname;
Notes:
a)  The module name is specified in both the MODULE and the END statement.
b)  IMPORT gives the names of other MODULEs that you need to reference.
c)  Import names can be given an abbreviation as in S for the SYSTEM MODULE.
d)  To access the procedure ADR in the SYSTEM Module you use: S.ADR( etc.....
e)  If no abbreviation - you use the full name - Windows.BeginPaint( etc .....
f)  If the PROCEDURE myproc is to be referenced by another module you must EXPORT it by placing an * after the name:
PROCEDURE myproc*(a: aType): aType;
4)  The CASE command
The format is:
CASE varname OF
  1: statement1
      statement2
      etc.
  | 2: Statement3;
  ELSE
  Statement4;
END;
Notice that the bounds of each CASE is not delimited by an END.  The | symbol is used.

5) Data Type Conversion
Since POW! uses very strict TYPEing, only VARiables of the same TYPE may be assigned.  The following functions are available for TYPE conversion (note - there is no TYPE for STRINGs - STRING in the following examples is assumed to be defined as a TYPE of ARRAY 256 OF CHAR):
CHAR to INTEGER - intType := ORD(charType);
INTEGER to CHAR- charType := CHR(intType);
STRING to
 
Home
Email Brosco