home *** CD-ROM | disk | FTP | other *** search
- Using Personal Pascal with a CLI
- --------------------------------
-
- Several Command Line Interpreters are
- now available for the ST, including
- (for example only) Micro C-Shell.
-
- Several of you have asked for a way
- to use PPascal from such a CLI. Well
- it turns out the PPascal was designed
- from the start to work this way, and
- the use from GEM menus is actually
- accomplished using the CHAIN function
- of GEMDOS! If you prefer, you can
- ignore the PASCAL.PRG "shell" and
- use COMPILER.PRG, EDITOR.PRG, and
- LINKER.PRG directly. Each of these
- programs has some options, summarized
- below:
-
- =====================================
-
- EDITOR fnm [ line [ col [ err ] ] ]
-
- You MUST pass a file name ("fnm") to
- the editor. You may optionally pass
- a line number, in which case when the
- editor loads and runs the cursor will
- be positioned at the specified line
- number. (CAUTION: be sure to use a
- line number that exists in the file!)
-
- If you pass a line number, you may
- also pass a column number. Again, if
- you do so, the cursor will be placed
- at that column in the given line.
-
- Finally, only if you specify a line
- number and a column number, you may
- also specify an error number. If you
- do so, and if that error number is
- the same as one in the file named
- "ERRORS.TXT" then the corresponding
- error message will appear at the top
- of the editor screen.
-
- Example:
-
- EDITOR MYPROG.PAS 20 10 167
-
- Causes the Editor to load the file
- MYPROG.PAS, set the cursor at line 20
- and column 10, and displays the error
- message "Undeclared Label" at the top
- of the screen.
-
- =====================================
-
- COMPILER fnm [/GEM] [/NOCODE] [/ACC]
- [/DEBUG] [/NOCHECK]
- [/CHECK] [/CLEAR]
-
- You MUST pass a file name ("fnm") to
- the compiler. The source file MUST
- have the extension ".PAS" (as in
- MYPROG.PAS). The object file produced
- by the compiler WILL be given a name
- of the same form as the source file
- (in the same directory) but with the
- extension ".O" (e.g., MYPROG.O).
-
- You may pass one of several optional
- parameters. Each must be preceded by
- a slash ("/") and they must be separ-
- ated from each other by a space. All
- the options are INDEPENDENT of each
- other, and each overrides whatever
- the compiler's default condition is!
-
- Each option is explained below:
-
- -------------------------------------
-
- /GEM
-
- Compile for GEM. Default is compile
- for TOS. Roughly same as coding the
- compiler directive $U10 (reserve 10kb
- or memory for GEM, in other words).
-
- -------------------------------------
-
- /NOCODE
-
- Do not produce an object file! This
- is really handy when you are doing
- the first few compiles of a program,
- when you're expecting several errors.
- Obviously, the default is DO produce
- an object file.
-
- -------------------------------------
-
- /ACC
-
- Make this program a desk accessory.
- Default is a GEM or TOS program.
- This has the same effect as coding
- the compiler directive "$A+" in your
- program.
-
- CAUTION:: Do NOT use this option if
- you do not have version 1.10 or later
- of the Personal Pascal compiler.
-
- -------------------------------------
-
- /DEBUG
-
- Causes compiler to generate the code
- needed for the "debug" mode (see PP
- manual). Same as compiler directive
- "$D+".
-
- -------------------------------------
-
- /NOCHECK
-
- Same as using the compiler directive
- "$T-". That is, it turns of stack/
- heap overlap checking. This checking
- is NOT a lot of overhead, so we do
- not recommend using this option until
- your code if pretty well finalized.
-
- -------------------------------------
-
- /CHECK
-
- Same as using BOTH of the compiler
- directives "$P+" and "$R+".
-
- NOTE:: This directive is definitely
- NOT the opposite of /NOCHECK. The
- two are completely separate and inde-
- pendent!
-
- Pointer and range checking DO use
- considerable system overhead, but we
- still recommend that you use them
- until you are reasonably sure that
- your program is not pointing off into
- never-never land.
-
- -------------------------------------
-
- /CLEAR
-
- Same as compiler directive "$C+".
-
- Clearing variables to zero is NOT a
- thing that most Pascal compilers do,
- so for compatibility you should not
- use this directive. Exception: if
- you are converting from Turbo Pascal,
- this might be handy.
-
- -------------------------------------
-
- EXAMPLE:
-
- COMPILER MYPROG /GEM /CHECK /DEBUG
-
-
-
- =====================================
-
- LINKER fnm1,fnm2,fnm3,...fnmN
- or
- LINKER fnm.ext=fnm1,fnm2,fnm3...,fnmN
-
- The LINKER has no specifiable options
- but it does have two ways to specify
- the files to be linked and the name
- of the resultant output file.
-
- The first form shown above will cause
- all the specified files to be linked
- together. The files may be either
- object (".O") files or library files
- (such as PASLIB and PASGEM). The
- output file will ALWAYS be named
- "fnm1.PRG". That is, it will have
- the same name as the first file in
- the list but will have the extension
- ".PRG". If the program is not a GEM
- program, we recommend renaming the
- file after it is produced.
-
- The second form shown allows you to
- specify ANY file name for the output
- file. This is handy when you want
- the output file to be in some other
- directory or to have some extension
- other than ".PRG". (For example, the
- PASCAL GEM-based shell specifies
- ".TOS" when you click on the "link
- for TOS" button.)
-
- REMEMBER: PASLIB should probably be
- the last file linked in any case.
- If you are linking for GEM, then
- PASGEM should be the next to last
- file in the list.
-
- BUG: Although you may specify almost
- any pathname for each of the given
- files, you can NOT use a name that
- starts with "..\". If you need to
- go up a level in the directory, you
- will have to do so by giving the path
- more explicitly.
-
- =====================================
-
- And that's it. There are a few other
- options for the COMPILER that are
- only useful if you are running in a
- GEM shell environment (e.g., as does
- PASCAL.PRG). If you are writing a
- replacement GEM type shell, contact
- us for more info.
-
- =====================================
- =====================================
-