home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ipo-101.zip / user.txt < prev   
Text File  |  1999-03-09  |  116KB  |  2,924 lines

  1. Copyright (c) 1998, 1999 Stuart King. All rights reserved.
  2.  
  3.        Welcome to the Irie Pascal for OS/2 User's Manual.
  4.  
  5. -----------------
  6. Table Of Contents
  7. -----------------
  8. 1   Introduction
  9.     1.1 How To Register
  10.     1.2 License/Redistribution Rights
  11.     1.3 Disclaimer - Agreement
  12.     1.4 How to install/uninstall
  13.     1.4.1 Minimum system requirements
  14.     1.4.2 Installing Irie Pascal
  15.           1.4.2.1 Installing from the zip file
  16.     1.4.3 Uninstalling Irie Pascal
  17.     1.5 Product support
  18.     1.6 Contacting the author
  19.     1.7 Compliance with Standard Pascal
  20. 2   Editing/Creating Pascal Programs
  21. 3   Using the Irie Pascal Compiler
  22.     3.1 Compiler messages
  23.     3.2 Compiler options
  24.     3.2.1 Compiler options list
  25.     3.3 Compiler directives
  26.     3.3.1 Compiler directives list
  27. 4   Using the Irie Virtual Machine Interpreter
  28. 5   Using the Irie Upgrade Utility
  29. Appendix A. Deviations from ISO/IEC 7185
  30.     A.1 end-of-line characters
  31.     A.2 Termination of all lines in text files
  32.     A.3 new(p, c1..CN)
  33.     A.4 dispose(q, k1..kM)
  34.     A.5 Carriage returns
  35.     A.6 Documentation of extensions
  36. Appendix B. Implementation limits
  37.     B.1 Length of source lines
  38.     B.2 Number and nesting of statement sequences
  39.     B.3 Nesting of functions/procedures
  40.     B.4 Range of variant selector's type & Number of variants
  41.     B.5 Range of case-index's type & Number of case-list-elements
  42.     B.6 Size of integer constants
  43.     B.7 Size of real constants
  44.     B.8 Size of code and data
  45.     B.9 Number of set elements
  46.     B.10 Nesting of statements
  47.     B.11 Stack size
  48. Appendix C. Implementation-defined features
  49.     C.1 String-elements
  50.     C.2 Provision of tokens and delimiting characters
  51.     C.3 Size and precision of real values
  52.     C.4 Character set
  53.     C.5 Ordinal values of characters
  54.     C.6 Characters prohibited from text files
  55.     C.7 When I/O is performed
  56.     C.8 Value of maxint
  57.     C.9 Accuracy of real operations and functions
  58.     C.10 Default value of TotalWidth for integer-type
  59.     C.11 Default value of TotalWidth for real-type
  60.     C.12 Default value of TotalWidth for Boolean-type
  61.     C.13 Number of digits written in exponents
  62.     C.14 Use of "e" or "E" as exponent character on output
  63.     C.15 Case of characters used on output of Boolean values
  64.     C.16 Effect of built-in procedure "page"
  65.     C.17 Binding of file-type program-parameters
  66.     C.18 Effect of "reset" and "rewrite" on "input" and "output"
  67. Appendix D. Implementation-dependent features
  68.     D.1 Effect of writing 'prohibited' characters
  69.     D.2 Order of evaluation of index-expressions
  70.     D.3 Order of evaluation of expressions of a member-designator
  71.     D.4 Order of evaluation of member-designators
  72.     D.5 Order of evaluation of operands of dyadic operators
  73.     D.6 Order of evaluation of actual-parameters for function calls
  74.     D.7 Order of evaluating components of assignment statements
  75.     D.8 Order of evaluation of actual-parameters for procedure calls
  76.     D.9 Effect of reading a text file to which "page" has been applied
  77.     D.10 Binding of non-file program-parameters
  78. Appendix E. Errors
  79.     E.1 Array index out of bounds
  80.     E.2 Accessing inactive variant
  81.     E.3 Dereferencing nil pointers
  82.     E.4 Dereferencing undefined pointers
  83.     E.5 Dangling pointers
  84.     E.6 Altering file-variables
  85.     E.7 Using out-of-range value parameters
  86.     E.8 Using out-of-range set value parameters
  87.     E.9 Output to file not open for writing
  88.     E.10 Output to undefined file
  89.     E.11 Writing to middle of file
  90.     E.12 Using Put on undefined buffer-variables
  91.     E.13 Resetting undefined files
  92.     E.14 Input from file not open for reading
  93.     E.15 Input from undefined file
  94.     E.16 Reading past end-of-file
  95.     E.17 Reading out of range values
  96.     E.18 Writing out of range values
  97.     E.19 new(p, c1..cN) constraints violated
  98.     E.20 Incompatible use of dispose(p)
  99.     E.21 Incompatible use of dispose(p, k1..kM)
  100.     E.22 dispose(p, k1..kM) constraint violations
  101.     E.23 disposing nil pointer
  102.     E.24 disposing undefined pointer
  103.     E.25 new(p, c1..cN) constraints violated
  104.     E.26 Invalid use of pack
  105.     E.27 Invalid use of pack
  106.     E.28 Invalid use of pack
  107.     E.29 Invalid use of unpack
  108.     E.30 Invalid use of unpack
  109.     E.31 Invalid use of unpack
  110.     E.32 Square of large numbers
  111.     E.33 ln(x) and x <= 0
  112.     E.34 Square root of negative number
  113.     E.35 Problems with trunc
  114.     E.36 Problems with round
  115.     E.37 Problems with chr
  116.     E.38 Problems with succ
  117.     E.39 Problems with pred
  118.     E.40 Using eof on undefined files
  119.     E.41 Using eoln on undefined files
  120.     E.42 Using eoln at end-of-file
  121.     E.43 Using undefined variables
  122.     E.44 Division by zero
  123.     E.45 Division by zero
  124.     E.46 Modulus of zero or negative
  125.     E.47 Integer overflow/underflow
  126.     E.48 Returning undefined value from function
  127.     E.49 Assigning out of range ordinal values
  128.     E.50 Assigning out of range set values
  129.     E.51 Non-matching case index
  130.     E.52 For loops initial value out of range
  131.     E.53 For loops final value out of range
  132.     E.54 Reading invalid integer values
  133.     E.55 Reading out of range integer values
  134.     E.56 Reading invalid numeric values
  135.     E.57 Reading when file is not open
  136.     E.58 Writing with TotalWidth or FracDigits less than one
  137.     E.59 Problems with program-parameters
  138.     E.60 Problems with conformant arrays
  139. Appendix F. I/O error codes
  140. NoErrors              I/O operation completed successfully
  141. FileEraseFailure      Attempt to erase a file failed
  142. FileRenameFailure     Attempt to rename a file failed
  143. FileIsUndefined       Attempt to operate on an undefined file
  144. FileIsOpen            Using assign, erase, or rename on an open file
  145. FileIsNotOpen         Attempt to perform I/O on a closed file
  146. FileModeUndefined     THIS SHOULD NEVER OCCUR
  147. FileNameTooLong       Attempt to give a file a name too long
  148. FileNameNotDefined    Attempt to erase or rename a file with no name
  149. FilePosFailure        Attempt to use pos on a file failed
  150. FileSeekFailure       Attempt to use seek on a file failed
  151. NotOutputFile         Attempt to write to a file not open for writing
  152. UnexpectedEOF         Attempt to read past end-of-file
  153. WriteFailure          Attempt to write to file failed
  154. WidthTooLarge         Attempt to write a field too wide
  155. NotInputFile          Attempt to read from a file not open for reading
  156. ReadFailure           Attempt to read from file failed
  157. ClosingFailure        Attempt to close a file failed
  158. OpeningFailure        Attempt to open a file failed
  159. FileBufferIsEmpty     Attempt to use put and the file-buffer is empty
  160. ChDirFailure          Attempt to change directory failed
  161. FileExpandFailure     Attempt to use "fexpand" failed
  162. FileSplitFailure      Attempt to use "fsplit" failed
  163. FileSizeFailure       Attempt to obtain size of file failed
  164. FileOpenDirFailure    Attempt to open directory failed
  165. FileReadDirFailure    Attempt to read directory entry failed
  166. DirectoryIsUndefined  Attempt to access directory variable failed
  167. FileCloseDirFailure   Attempt to close directory failed
  168. FileRewindDirFailure  Attempt to rewind directory failed
  169. FileMkDirFailure      Attempt to create directory failed
  170. FileRmDirFailure      Attempt to remove directory failed
  171. FileGetDateFailure    Attempt to get the date a file was last modified failed
  172. FileGetModeFailure    Attempt to get the "mode" of a file failed
  173. FileGetTimeFailure    Attempt to get the time a file was last modified failed
  174. FileSetDateFailure    Attempt to set the date a file was last modified failed
  175. FileSetTimeFailure    Attempt to set the time a file was last modified failed
  176. FileRawReadFailure    Attempt to use "rawread" failed
  177. FileRawWriteFailure   Attempt to use "rawwrite" failed
  178.  
  179. ----------------
  180. 1   Introduction
  181. ----------------
  182. Irie Pascal is designed for beginners, who want to learn to program in
  183. Pascal, as well as for experienced programmers, who want to write small
  184. to medium-sized scripts and utility programs.
  185.  
  186. Irie Pascal is highly compatible with Standard (ISO/IEC 7185) Pascal
  187. (see "1.7 Compliance with Standard Pascal" below). This high level of
  188. compatibility means that Irie Pascal shares Standard Pascal's strengths as
  189. a first language for beginners. These strengths include readable syntax,
  190. and extensive compile-time and run-time checking.
  191.  
  192. Irie Pascal supports extensions to Standard Pascal, particularly in the
  193. areas of string and file/directory processing, which make it useful for
  194. creating scripts and utilities. Irie Pascal's support for automatic
  195. run-time checking make it useful for creating "quick and dirty" programs
  196. (i.e. programs that are expected to be run only a few times or by only a
  197. few people and may not be worth spending a lot of time on).
  198.  
  199. Irie Pascal consists of a compiler (called the Irie Pascal Compiler) and
  200. an interpreter (called the Irie Virtual Machine Interpreter). The compiler
  201. translates Pascal programs into Irie Virtual Machine executables (IVM
  202. executables). IVM executables can not be directly executed but instead must
  203. be executed by the interpreter. Most other compilers generate "native-code"
  204. executables (i.e. executables which can be directly executed on a single
  205. computer platform but usually can not be executed at all on any other
  206. computer platform). The main advantage of IVM executables is that unlike
  207. "native-code" executables, IVM executables can be run on any computer
  208. platform on which the interpreter exists.
  209. Currently the interpreter exists on five computer platforms:
  210.     1) Win32 (i.e. Win95/98/NT)
  211.     2) DOS
  212.     3) Linux
  213.     4) OS/2
  214.     5) FreeBSD
  215.  
  216. Another advantage to IVM executables is that they tend to be much smaller
  217. than their "native-code" equivalents. I have found that IVM executables
  218. tend to be roughly 20 times smaller than equivalent "native-code"
  219. executables.
  220.  
  221. The main disadvantage to IVM executables is speed or rather the lack of it.
  222. This is because IVM executables are not directly executed, but are executed
  223. by the Interpreter. I have found that IVM executables tend to run roughly
  224. 50 times slower than equivalent "native-code" executables. While there are
  225. many kinds of programs where this speed is perfectly acceptable, there are
  226. others where this is just too slow. I expect Irie Pascal to be used mainly
  227. to create utility programs, and programs for learning purposes (if you are
  228. learning Pascal you don't need your test programs to be the fastest possible,
  229. you probably need good compile-time and run-time diagnostics more).
  230.  
  231. You should be aware that although I claim Irie Pascal complies with
  232. ISO/IEC 7185 Level 0 (since it does according to my tests) it has not been
  233. formally certified by an external body.
  234.  
  235. Irie Pascal is shareware (see the file "sharewar.txt" which accompanies
  236. this manual for more information) and as such there is an evaluation
  237. version and a registered version. The evaluation version of Irie Pascal is
  238. provided at not charge, for the purposes of evaluating Irie Pascal and
  239. deciding whether to continue using it. Feel free to share the evaluation
  240. version with your friends, but do not give it away altered or as part of
  241. another system. You are not authorized to share the registered version.
  242. The essence of "user-supported" software is to provide personal computer
  243. users with quality software without high prices, and yet to provide an
  244. incentive for programmers to continue to develop new products. If you find
  245. the evaluation version of Irie Pascal useful and find that you are using
  246. it and continue to use it after a reasonable trial period, you must
  247. register it (See "1.1 How to Register").
  248.  
  249. The evaluation and registered versions of Irie Pascal are functionally
  250. identical except for two differences. The first difference is that the
  251. registered version uses an improved code generation technique to generate
  252. smaller programs. The second difference is that programs compiled by the
  253. evaluation version expire one day after they are compiled, while programs
  254. compiled by the registered version never expire. These differences are
  255. intended to encourage users of the evaluation version to pay the
  256. registration fee and receive a copy of the registered version.
  257. NOTE: Irie Pascal does not prevent users of the evaluation version from
  258. recompiling expired programs as many times as they wish to keep them
  259. running indefinitely.
  260.  
  261. -------------------
  262. 1.1 How To Register
  263. -------------------
  264. To register Irie Pascal complete the appropriate order form, and mail it
  265. in along with a check or money order for the registration fee. If you wish
  266. to pay the registration fee in US dollars then use the order form in
  267. "orderus.txt". If you wish to pay the registration fee in Canadian dollars
  268. then use the order form in "orderca.txt". If you wish to pay the
  269. registration fee in UK pounds then use the order form in "orderuk.txt".
  270. If you include an email address then I will email you when I ship the
  271. registered version to you. I respect the privacy of my customers and will
  272. NEVER sell or otherwise distribute any information you give me to anyone
  273. without your consent.
  274.  
  275. The check or money order should be made out to "Stuart King" and sent to
  276.  
  277.    Stuart King
  278.    MB #247
  279.    221 S. State Road 7
  280.    Ft. Lauderdale, Fl 33317
  281.    U.S.A.
  282.  
  283. Please do not send cash.
  284.  
  285. All registered users will receive a copy of the latest registered version
  286. of Irie Pascal on 3 1/2" disks, so you will need a 3 1/2" floppy drive
  287. to install Irie Pascal.
  288.  
  289. Registered users of Irie Pascal for OS/2 are entitled to receive
  290. free (regular shipping and handling charges may apply) upgrades to all
  291. registered versions of Irie Pascal for OS/2 released after they register.
  292. Registered users of Irie Pascal for OS/2 may use the Irie Upgrade Utility
  293. to upgrade to the latest registered version at any time. Whenever a new
  294. registered version of Irie Pascal for OS/2 is released a special upgrade
  295. file will be placed on the IrieTools Website. Registered users may download
  296. this upgrade file without charge and perform the upgrade (see the User's
  297. Manual "user.txt" for more information on using the Irie Upgrade Utility).
  298.  
  299. Registered users may also receive upgrades by mail. To receive upgrades
  300. by mail, fill out the appropriate order form and mail in the completed
  301. order form along with a check of money order for the shipping and handling
  302. fee to the address above.
  303.  
  304. Educational institutions should enquire about the educational discount
  305. (See "1.6 Contacting the author").
  306.  
  307. Commercial users of Irie Pascal must register and pay for their copies of
  308. the Software within 30 days of first use or their license is withdrawn.
  309. Site-License arrangements may be made by contacting the author
  310. (see "1.6 Contacting the author").
  311.  
  312. Anyone distributing Irie Pascal for any kind of remuneration must first
  313. contact the author (see "1.6 Contacting the author" below) for
  314. authorization.
  315.  
  316. ---------------------------------
  317. 1.2 License/Redistribution Rights
  318. ---------------------------------
  319. Subject to payment of the registration fee, the author grants you the
  320. following:
  321.  
  322. A non-exclusive license to use the number of copies of Irie Pascal
  323. covered by the registration fee. The order forms indicate the fee per
  324. copy of Irie Pascal as well as the shipping and handling charge. You must
  325. treat the registered version just like a book.  An example is that the
  326. registered version may be used by any number of people and may be freely
  327. moved from one computer location to another, so long as there is no
  328. possibility of the number of copies in use at it one time exceeding the
  329. number of copies covered by the registration fee.
  330.  
  331. A non-exclusive, royalty-free right to reproduce and distribute programs
  332. compiled by Irie Pascal.
  333.  
  334. A non-exclusive, royalty-free right to reproduce and distribute unaltered
  335. copies of the Irie Virtual Machine Interpreter.
  336.  
  337. --------------------------
  338. 1.3 Disclaimer - Agreement
  339. --------------------------
  340. Users of Irie Pascal must accept this disclaimer of warranty:
  341. "Irie Pascal is supplied as is.  The author disclaims all warranties,
  342. expressed or implied, including, without limitation, the warranties of
  343. merchantability and of fitness for any purpose. The author assumes no
  344. liability for damages, direct or consequential, which may result from the
  345. use of Irie Pascal."
  346.  
  347. ----------------------------
  348. 1.4 How to install/uninstall
  349. ----------------------------
  350.  
  351. ---------------------------------
  352. 1.4.1 Minimum system requirements
  353. ---------------------------------
  354. - OS/2 2.0 or later
  355. - 1 MB disk space
  356.  
  357. ----------------------------
  358. 1.4.2 Installing Irie Pascal
  359. ----------------------------
  360. Irie Pascal for OS/2 is distributed as a zip file "ipo-101.zip".
  361.  
  362. NOTE: Installing Irie Pascal requires manual modifications to your
  363. config.sys. If you have never modified your config.sys or if you are
  364. uncomfortable doing so then have someone who has done this before assist
  365. you. If you decide to modify your config.sys remember to use a text
  366. editor and not a word processor. You may wish to make a backup copy of
  367. your config.sys before you begin making modifications to help you recover
  368. from mistakes.
  369.  
  370. ------------------------------------
  371. 1.4.2.1 Installing from the zip file
  372. ------------------------------------
  373. The recommended installation procedure is as follows:
  374. A) Create a directory (I suggest "C:\IRIE") to store Irie Pascal.
  375. B) Copy the zip file into this directory.
  376. C) Use your unzip utility to extract the files.
  377. D) Add the directory created in A) to the path
  378.    (i.e. edit your config.sys).
  379. E) Create a directory to store the sample pascal programs
  380.    (I suggest "C:\IRIE\SAMPLES").
  381. F) Copy the zip file containing the samples "samples.zip" in to the
  382.    directory you just created.
  383. G) Unzip the sample files.
  384. H) Reboot your computer.
  385.  
  386. ------------------------------
  387. 1.4.3 Uninstalling Irie Pascal
  388. ------------------------------
  389. Irie Pascal does not make any behind the scenes modifications to your
  390. system. Irie Pascal does not modify any system files or install files
  391. on you hard disk so uninstalling is very simple. Just delete the
  392. directory, you created to store Irie Pascal, and remove it from the path.
  393.  
  394. -------------------
  395. 1.5 Product support
  396. -------------------
  397. I am very interested in all your comments about Irie Pascal, but
  398. most especially in your comments about its usefulness, any problems
  399. you encounter installing or using Irie Pascal, and any changes you
  400. would like to see.
  401.  
  402. The latest information and updates of Irie Pascal are available at
  403. the Irie Tools web site at    http://www.irietools.com
  404.  
  405. You can also contact me directly with your technical support
  406. questions.
  407.  
  408. -------------------------
  409. 1.6 Contacting the author
  410. -------------------------
  411. For the quickest response contact me by e-mail at support@irietools.com
  412.  
  413. If you prefer you can contact me by regular mail (but this takes longer) at:
  414.    Stuart King
  415.    MB #247
  416.    221 S. State Road 7
  417.    Ft. Lauderdale, Fl 33317
  418.    U.S.A.
  419.  
  420. -----------------------------------
  421. 1.7 Compliance with Standard Pascal
  422. -----------------------------------
  423. Irie Pascal complies with the requirements of level 0 of ISO/IEC 7185,
  424. with the following exceptions: (see "Appendix A").
  425.  
  426. ------------------------------------
  427. 2.0 Editing/Creating Pascal Programs
  428. ------------------------------------
  429. You will need to use a text editor to create and edit your Pascal
  430. programs. Unfortunately Irie Pascal does not yet include a text editor
  431. so you will need one from another source. Two basic text editors
  432. "e" and "epm" are included with OS/2 and can be used with
  433. Irie Pascal.
  434.  
  435. There are numerous other text editors (freeware, shareware, and commercial)
  436. which can also be used with Irie Pascal.
  437.  
  438. ----------------------------------
  439. 3.0 Using the Irie Pascal Compiler
  440. ----------------------------------
  441. The Irie Pascal Compiler translates Pascal programs into Irie Virtual
  442. Machine executables (IVM executables). The compiler should be run from
  443. a command-line prompt.
  444.  
  445. Syntax: ipc [options] filename
  446.     or  ipc ?
  447.     or  ipc
  448.  where  [options]    modify the behavior of the compiler.
  449.     filename     specifies the file to compile.
  450. NOTE: [x] indicates that x is optional.
  451.  
  452. If you enter
  453.    ipc
  454. then the compiler displays a brief help screen showing the proper syntax.
  455. If you enter
  456.    ipc ?
  457. then the compiler displays a more detailed help screen listing all the
  458. options you can use.
  459. If you enter
  460.    "ipc [options] filename"
  461. then the compiler attempts to compile the file specified by "filename"
  462. taking into account the options specified if any.
  463. NOTE: "filename" can include path information.
  464.  
  465. If we ignore the compiler options for the time being then to
  466. compile a program you enter "ipc filename".
  467.  
  468. For example to compile the sample "hello.pas" program enter
  469.    "ipc hello"
  470. or
  471.    "ipc hello.pas"
  472. (assuming of course that "hello.pas" is in the current directory).
  473.  
  474. The compiler will generate a file called "hello.ivm" which contains an
  475. IVM executable. You can run it by entering
  476.    "ivm hello"
  477. or
  478.    "ivm hello.ivm".
  479.  
  480. NOTE: If you do not specify a path for the executable (as in the example
  481. above) the interpreter will first look in the current directory and if
  482. not found the interpreter will search the path.
  483.  
  484. ------------------------
  485. 3.1    Compiler messages
  486. ------------------------
  487. The compiler can display four different classes of messages:
  488. 1) Fatal error messages
  489. 2) Error messages
  490. 3) Warning messages
  491. 4) Informatory messages
  492.  
  493. Fatal error messages are displayed when the compiler detects a problem
  494. that is so serious it can not continue. After displaying a fatal error
  495. message the compiler deletes the Irie Virtual Machine Executable if one
  496. is being created and then stops immediately. For example if the compiler
  497. runs out of memory it generates a fatal error message.
  498.  
  499. Error messages are displayed when the compiler detects a problem
  500. that prevents it from generating a reliable executable. After displaying
  501. an error message the compile deletes the Irie Virtual Machine Executable
  502. and continues compiling in order to detect other problems. For example
  503. if the compiler detects invalid syntax, it will generate an error message.
  504.  
  505. Warning messages are generated when the compiler detects something
  506. which may indicate a problem with your program. For example if you
  507. declare a variable and never use it, the compile displays a warning
  508. message.
  509.  
  510. Informatory messages display information which may be interesting
  511. but not really necessary. For example there are informatory messages
  512. which show the speed of compilation.
  513.  
  514. Here is an example of what I mean.
  515. If you compile the following program which is one of the sample programs
  516. "bad.pas"
  517.  
  518.    program bad(output);
  519.    begin
  520.       writelm('Hello') (* writelm used instead of writeln *)
  521.    end.
  522.  
  523. then the compiler produces the following output
  524.  
  525.    Irie Pascal Compiler 1.01 for OS/2
  526.    Copyright (c) 1998, 1999 Stuart King. All rights reserved.
  527.    Error #76: "samples\bad.pas" (line 3, col 4): Procedure identifier expected.
  528.       writelm('Hello') (* writelm used instead of writeln *)
  529.       ^
  530.    Warning #44: "samples\bad.pas" (line 1, col 13): Variable is never used.
  531.    program bad(output);
  532.            ^
  533.    1 error(s) and 1 warning(s) were issued.
  534.    5 lines compiled in  0.020 seconds.
  535.    Compilation speed   249 lines/sec,  14940 lines/min.
  536.  
  537. The first two lines are the copyright notice.
  538. The third line is an error message
  539.    The word "Error" indicates that this is an error or fatal error message.
  540.    The #76 is the message number.
  541.    Then comes the name of the file with the error.
  542.    Then comes the location where the error was detected
  543.       (line 3, column 4).
  544.    Finally the text of the message.
  545. The fourth line shows the line where the error was detected.
  546. The fifth line has a ^ pointing to the location in the fourth line where
  547.    the error was detected.
  548. The sixth, seventh, and eigth lines display warning messages with
  549. essentially the same layout as the error message.
  550. The final three lines are informatory messages.
  551. NOTE: The speed of compilation will vary.
  552.  
  553. Tip: Sometimes a single problem can confuse the compiler and make it
  554. report problems later on that don't really exist. So pay special
  555. attention to the problem reported by the first message and try to fix
  556. this one first.
  557.  
  558. -----------------------
  559. 3.2    Compiler options
  560. -----------------------
  561. Compiler options are instructions to the compiler to somehow modify it's
  562. behavior (usually they are instructions to enable or disable a particular
  563. compiler feature). Compiler options are entered on the command-line when
  564. you invoke the compiler (see "3.0 Using the Irie Pascal Compiler" above).
  565. NOTE: Compile options are case-sensitive so for example "i" and "I" are
  566. different options.
  567.  
  568. There are two kinds of compiler options
  569. 1) Flag options
  570. 2) Value options
  571.  
  572. Flag options are used to enable or disable a compiler feature.
  573. To enable the feature use
  574.    -option    or -option+
  575. where
  576.    option is the particular compiler option.
  577. To disable the feature use
  578.    -option-
  579.  
  580. For example the "nc" option is used to enable/disable the processing of
  581. nested comments. So -nc or -nc+ is used to enable the processing of nested
  582. comments and -nc- is used to disable the processing of nested comments.
  583.  
  584. Value options are used to specify the value of some quantity.
  585. To specify a value option use
  586.    -optionVALUE
  587. where
  588.    option is the particular compiler option
  589. and
  590.    VALUE is the value being specified.
  591.  
  592. For example the "mw" option is used to specify the maximum number of
  593. warnings that the compiler should process.
  594. So -mw2 is used to set the maximum number of warnings to 2.
  595.  
  596. More than one option can be specified so if you want to compile
  597. the program "bad.pas" using brief messages and nested comments then
  598. you can enter    "ipc -b -nc bad.pas".
  599.  
  600. Options can be combined so you can also enter
  601.    "ipc -bnc bad"
  602. or
  603.    "ipc -ncb bad"
  604.  
  605. To turn off nested comment processing and brief message then
  606. you can enter "ipc -nc- -b- bad" or "ipc -ncb- bad".
  607.  
  608. -------------------------------
  609. 3.2.1     Compiler options list
  610. -------------------------------
  611. Option:  'a'
  612. Purpose: Specifies the maximum alignment used by the compiler.
  613. Syntax:  -aN     Set maximum alignment to N.
  614. Default: Maximum alignment 4.
  615. Notes:
  616. N must be between 0 and 8
  617. N=0 is treated like N=1.
  618.  
  619. Some CPUs (including those in the 80x86 family) access data faster if it
  620. is aligned on an address which is a multiple of the size of the data.
  621. Suppose the CPU is accessing a real which is 8 bytes long then for
  622. fastest access the real should be on an address which is a multiple
  623. of 8 (for example 0, 8, 16, 24, 32, etc).
  624.  
  625. The compiler stores variables in memory at the lowest available address
  626. which is a multiple of either the variable's size or the maximum alignment,
  627. whichever is smaller.
  628.  
  629. For example suppose you compile the following program and the maximum
  630. alignment is 4.
  631.  
  632.     program x(output);
  633.     var
  634.        c : char;
  635.        i : integer;
  636.        b : boolean;
  637.        r : real;
  638.     begin
  639.     end.
  640.  
  641. The compiler needs to decide where to store the variables
  642. "c", "i", "b" and "r".
  643.  
  644. The first variable "c" gets stored at address 0, and since "c" is
  645. a char variable (which are 1 byte long) the available addresses are
  646. from 1 upwards.
  647.  
  648. The second variable "i" is an integer variable (which are 4 bytes long).
  649. The lowest available address which is a multiple of the variable size
  650. is 4 and the lowest available address which is a multiple of the maximum
  651. alignment is also 4. So the compiler stores "i" at address 4, and the
  652. available address are from 8 upwards (since "i" is 4 bytes long).
  653.  
  654. The third variable "b" is a boolean variable (which are 4 bytes long).
  655. The lowest available address which is a multiple of the variable size
  656. is 8 and the lowest available address which is a multiple of the maximum
  657. alignment is also 8. So the compiler stores "b" at address 8, and the
  658. available address are from 12 upwards (since "b" is 4 bytes long).
  659.  
  660. The fourth variable "r" is a real variable (which are 8 bytes long).
  661. The lowest available address which is a multiple of the variable size
  662. is 16 but the lowest available address which is a multiple of the maximum
  663. alignment is 12. So the compiler stores "r" at address 12 (since 12 is
  664. less than 16).
  665.  
  666. In general if you set maximum alignment to 1 then you waste no memory
  667. but you get fastest access only for chars. If you set the maximum alignment
  668. to 4 you may waste memory when storing all variables except char, but
  669. you get the fastest access to all variables except real. If you set the
  670. maximum alignment to 8 you may waste memory when storing all variables
  671. except char, but you get the fastest access to variables of all types.
  672.  
  673. If you are not sure about the setting of this option just leave the default.
  674.  
  675.          ------------------------------
  676.  
  677. Option:  'ao'
  678. Purpose: Enables/disables assignment overflow checking.
  679. Syntax:  -ao[+|-]
  680. Default: Enabled
  681. Notes:
  682. When assignment overflow checking is enabled the compiler generates code
  683. to check that variables are large enough to contain the values
  684. assigned to them. The generated code will display a run-time error
  685. message and stop your program if an assignment overflow error is detected.
  686. Assignment overflow errors are only possible when assigning to string
  687. variables or set variables using the array representation
  688. (See "B.9 Number of set elements" for more information).
  689.  
  690. I recommend you leave this option enabled.
  691.  
  692.          ------------------------------
  693.  
  694. Option: 'A'
  695. Purpose: Enables/disables asserts.
  696. Syntax: -A[+|-]
  697. Default: Enabled
  698. Notes:
  699. This compiler option controls whether or not code is generated for the
  700. built-in procedure assert.
  701. NOTE: Since the compiler parses assert procedures whether or not this
  702. option is enabled, compile-time errors in assert procedures are reported
  703. regardless of the setting of this option (See "7.2.2 assert" in the
  704. Irie Pascal Programmers Reference Manual for more information).
  705.  
  706.          ------------------------------
  707.  
  708. Option:  'b'
  709. Purpose: Enables/disables the brief format for messages.
  710. Syntax:  -b[+|-]
  711. Default: Disabled
  712. Notes:
  713. The verbose format for Fatal error and Error messages (which is used by
  714. default) is
  715.      Error #nn: "name" (Line l, Col c): text
  716. where
  717.      "nn" is a number identifying the message
  718.      "name" is the file where the problem as detected
  719.      "l" is the line where the problem was detected
  720.      "c" is the column where the problem was detected
  721.      "text" is the text of the message
  722. The verbose format for warning messages is similar except that "Warning"
  723. is used instead of "Error".
  724.  
  725. The brief format for Fatal error and Error messages is
  726.     Enn: "name" l:text
  727. where
  728.      "nn" is a number identifying the message
  729.      "name" is the file where the problem as detected
  730.      "l" is the line number of the line where the problem was detected
  731.      "text" is the text of the message
  732. The brief format for warning messages are similar except that "W" is
  733. used instead of "E".
  734.  
  735.          ------------------------------
  736.  
  737. Option:  'C'
  738. Purpose: Enables/disables case-sensitive compilation.
  739. Syntax:  -C[+|-]
  740. Default: Disabled
  741. Notes:
  742. This compiler option controls whether or not the case of identifiers
  743. is significant. So for example when case-sensitive compilation is
  744. enabled "hi", "Hi", "hI", and "HI" are all different identifiers, but
  745. when case-sensitive compilation is disabled then they are all the same
  746. identifier.
  747.  
  748. This option is disabled by default since Pascal is normally not
  749. case-sensitive. If you enable this option then remember to use all
  750. lowercase for keywords and built-in identifiers
  751. (e.g. var, integer, input, writeln).
  752.  
  753.          ------------------------------
  754.  
  755. Option:  'ead'
  756. Purpose: Enables/disables auto-declaration of input and output.
  757. Syntax:  -ead[+|-]
  758. Default: Enabled
  759. Notes:
  760. See also "B.9 Input & Output automatically declared" in the Programmers
  761. Reference Manual.
  762.  
  763.          ------------------------------
  764.  
  765. Option:  'ebh'
  766. Purpose: Enables/disables binary and hexadecimal integer constants.
  767. Syntax:  -ebh[+|-]
  768. Default: Enabled
  769. Notes:
  770. See also "B.7 Binary integer constants" & "B.8 hexadecimal integer constants"
  771. in the Programmers Reference Manual.
  772.  
  773.          ------------------------------
  774.  
  775. Option:  'eco'
  776. Purpose: Enables/disables extended constants.
  777. Syntax:  -eco[+|-]
  778. Default: Enabled
  779. Notes:
  780. See also "B.14 Extended constants" in the Programmers Reference Manual.
  781.  
  782.          ------------------------------
  783.  
  784. Option:  'ecr'
  785. Purpose: Enables/disables constant ranges.
  786. Syntax:  -ecr[+|-]
  787. Default: Enabled
  788. Notes:
  789. This compiler option enables and disables support for constant ranges.
  790. See also "B.2 Constant ranges" in the Programmers Reference Manual.
  791.  
  792.          ------------------------------
  793.  
  794. Option:  'edq'
  795. Purpose: Enables/disables double quoted literals.
  796. Syntax:  -edq[+|-]
  797. Default: Enabled
  798. Notes:
  799. See also "B.10 Double-quoted literals" in the Programmers Reference Manual.
  800.  
  801.          ------------------------------
  802.  
  803. Option:  'efn'
  804. Purpose: Enables/disables extended functions.
  805. Syntax:  -efn[+|-]
  806. Default: Enabled
  807. Notes:
  808. See also "7.1 Built-in Functions" in the Programmers Reference Manual.
  809.  
  810.          ------------------------------
  811.  
  812. Option:  'enn'
  813. Purpose: Enables/disables support for non-numeric statement labels.
  814. Syntax:  -enn[+|-]
  815. Default: Enabled
  816. Notes:
  817. See also "B.5 Non-numeric statement labels" in the Programmers Reference
  818. Manual.
  819.  
  820.          ------------------------------
  821.  
  822. Option:  'eop'
  823. Purpose: Enables/disables support for extended operators.
  824. Syntax:  -eop[+|-]
  825. Default: Enabled
  826. Notes:
  827. See also "8.1.1 Not operator", "8.1.6 And operator",
  828. "8.1.7 and_then operator", "8.1.8 + operator", "8.1.10 or operator",
  829. "8.1.11 or_else operator", "8.1.12 xor operator", 8.1.13 shl operator",
  830. and "8.1.14 shr operator" in the Programmers Reference Manual.
  831.  
  832.          ------------------------------
  833.  
  834. Option:  'eow'
  835. Purpose: Enables/disables support for otherwise.
  836. Syntax:  -eow[+|-]
  837. Default: Enabled
  838. Notes:
  839. See also "B.3 Otherwise" in the Programmers Reference Manual.
  840.  
  841.          ------------------------------
  842.  
  843. Option:  'epr'
  844. Purpose: Enables/disables extended procedures.
  845. Syntax:  -epr[+|-]
  846. Default: Enabled
  847. Notes:
  848. See also "7.2 Built-in Procedures" in the Programmers Reference Manual.
  849.  
  850.          ------------------------------
  851.  
  852. Option:  'erd'
  853. Purpose: Enables/disables relaxed declarations.
  854. Syntax:  -erd[+|-]
  855. Default: Enabled
  856. Notes:
  857. See also "B.1 Relaxed declarations" in the Programmers Reference Manual.
  858.  
  859.          ------------------------------
  860.  
  861. Option:  'ety'
  862. Purpose: Enables/disables extended types.
  863. Syntax:  -ety[+|-]
  864. Default: Enabled
  865. Notes:
  866. See also "B.15 Extended types" in the Programmers Reference Manual.
  867.  
  868.          ------------------------------
  869.  
  870. Option:  'eui'
  871. Purpose: Enables/disables underscores in identifiers.
  872. Syntax:  -eui[+|-]
  873. Default: Enabled
  874. Notes:
  875. See also "B.6 Underscores in identifiers" in the Programmers Reference Manual.
  876.  
  877.          ------------------------------
  878.  
  879. Option:  'eva'
  880. Purpose: Enables/disables extended variables.
  881. Syntax:  -eva[+|-]
  882. Default: Enabled
  883. Notes:
  884. See also "B.16 Extended variables" in the Programmers Reference Manual.
  885.  
  886.          ------------------------------
  887.  
  888. Option:  'E'
  889. Purpose: Enables/disables extensions.
  890. Syntax:  -E[+|-]
  891. Default: Enabled
  892. Notes:
  893. This compiler option enables and disables support for all Irie Pascal
  894. extensions to Standard Pascal.
  895.  
  896.          ------------------------------
  897.  
  898. Option:  'i'
  899. Purpose: Enables/disables I/O trapping.
  900. Syntax:  -i[+|-]
  901. Default: Enabled
  902. Notes:
  903. When I/O trapping is enabled the compiler generates code which checks each
  904. I/O operation and issues a run-time error if an I/O error is detected.
  905.  
  906.          ------------------------------
  907.  
  908. Option:  'I'
  909. Purpose: Enables/disables informatory messages.
  910. Syntax:  -I[nn][+|-]
  911. Default: All informatory message enabled.
  912. Notes:
  913. Use -I or -I+ to enable all informatory messages.
  914. Use -I- to disable all informatory messages.
  915. Use -Inn or -Inn+ to enable the informatory message with message number "nn".
  916. Use -Inn- to disable the informatory message with message number "nn".
  917.  
  918.          ------------------------------
  919.  
  920. Option:  'ln'
  921. Purpose: Enables/disables line number information.
  922. Syntax:  -ln[+|-]
  923. Default: Enabled
  924. Notes:
  925. When line number information is enabled, the compiler stores the address
  926. of the code generated for each source line, inside the Irie Virtual
  927. Machine Executable. Enabling line number information makes the executable
  928. bigger, but allows for more meaningful run-time error messages since the
  929. number of the source line that caused the error is displayed in the message.
  930.  
  931. When line number information is not enabled, the executable is smaller
  932. but run-time error messages display only the address of the code that caused
  933. the error, which is unlikely to be very useful to you.
  934.  
  935. I recommend leaving this option enabled unless you really need to make the
  936. executable as small as possible.
  937.  
  938.          ------------------------------
  939.  
  940. Option:  'mb'
  941. Purpose: Enables/disables Borland compatible messages
  942. Syntax:  -mb[+|-]
  943. Default: Disabled
  944. Notes:
  945. When this compiler option is enabled the compiler displays messages
  946. in the format used by Borland compilers. This option can be used to
  947. make it easier to integrate the Irie Pascal Compiler with third-party
  948. editors and IDE's which already know how to process Borland compiler
  949. messages.
  950. NOTE: This option automatically suppresses the 'mc' compiler option.
  951. Related compiler option(s): 'mc', 'mm'.
  952.  
  953.          ------------------------------
  954.  
  955. Option:  'mc'
  956. Purpose: Enables/disables message context information
  957. Syntax:  -mc[+|-]
  958. Default: Enabled
  959. Notes:
  960. When this compiler option is enabled the compiler shows the position
  961. in the source file referred to by error and warning messages.
  962. NOTE: Some error and warning messages do not refer to a particular
  963. position in the source file and therefore context information is not
  964. displayed for those messages.
  965.  
  966.          ------------------------------
  967.  
  968. Option:  'me'
  969. Purpose: Specifies that the compiler stop after N error messages.
  970. Syntax:  -meN
  971. Default: N = 25
  972. Notes:
  973. Suppose you want the compiler to stop after 5 error messages then
  974. use -me5
  975.  
  976.          ------------------------------
  977.  
  978. Option:  'mm'
  979. Purpose: Enables/disables Microsoft compatible messages
  980. Syntax:  -mm[+|-]
  981. Default: Disabled
  982. Notes:
  983. When this compiler option is enabled the compiler displays messages
  984. in the format used by Microsoft compilers. This option can be used to
  985. make it easier to integrate the Irie Pascal Compiler with third-party
  986. editors and IDE's which already know how to process Microsoft compiler
  987. messages.
  988. NOTE: This option automatically suppresses the 'mc' compiler option.
  989. Related compiler option(s): 'mb', 'mc'.
  990.  
  991.          ------------------------------
  992.  
  993. Option:  'mw'
  994. Purpose: Specifies that the compiler stop after N warning messages.
  995. Syntax:  -mwN
  996. Default: N = 100
  997. Notes:
  998. Suppose you want the compiler to stop after 5 warning messages then
  999. use -mw5
  1000.  
  1001.          ------------------------------
  1002.  
  1003. Option:  'nc'
  1004. Purpose: Enables/disables nested comments.
  1005. Syntax:  -nc[+|-]
  1006. Default: Disabled
  1007. Notes:
  1008. Nested comments are comments inside other comments.
  1009. For example
  1010.  
  1011.    (* outer (* inner comment *) comment *)
  1012.  
  1013. When this compiler option is disabled the example comment above will
  1014. terminate at the first *) so only
  1015.  
  1016.    (* outer (* inner comment *)
  1017.  
  1018. will be treated as a comment.
  1019. When this compiler option is enabled the compiler recognizes the end of
  1020. comments only when the number of close comment markers matches the number
  1021. of open comment markers. So the example comment above will terminate only
  1022. after the second *).
  1023.  
  1024. Both open comment markers (* and { are considered to be equivalent.
  1025. Both close comment markers *) and } are considered to be equivalent.
  1026. So attempting to trick the compiler into accepting nested comments with
  1027. something like
  1028.  
  1029.    (* outer { inner comment } comment *)
  1030.  
  1031. will not work.
  1032.  
  1033. Nested comments are disabled by default since in Standard Pascal comments
  1034. do not nest.
  1035.  
  1036.          ------------------------------
  1037. Option:  'p'
  1038. Purpose: Enables/disables mandatory parentheses mode.
  1039. Syntax:  -p[+|-]
  1040. Default: Disabled
  1041. Notes:
  1042. The one thing I dislike about Pascal is that parentheses are not used
  1043. when calling or declaring functions or procedures with no parameters.
  1044. So for example in the following statement
  1045.     a := b;
  1046. it is not clear whether "b" is a function that takes no parameters or
  1047. whether "b" is a variable.
  1048.  
  1049. When mandatory parentheses mode is enabled then parentheses are required
  1050. when declaring or calling all functions and procedures even those with
  1051. no parameters. Parentheses are also required after the program name even
  1052. if there are no program parameters.
  1053.  
  1054. So for example to declare a procedure that takes no parameters you would
  1055. use the following
  1056.  
  1057.     procedure name();
  1058.     ...
  1059.     begin
  1060.     ...
  1061.     end;
  1062.  
  1063. And when calling it you would use
  1064.  
  1065.     name();
  1066.  
  1067. The problem with using this option is that your programs are not strictly
  1068. speaking Pascal programs any longer and they probably could not be compiled
  1069. by another compiler without being modified.
  1070.  
  1071.          ------------------------------
  1072.  
  1073. Option:  'r'
  1074. Purpose: Enables/disables range checking.
  1075. Syntax:  -r[+|-]
  1076. Default: Enabled
  1077. Notes:
  1078. When range checking is enabled the compiler generates code to check
  1079. for range errors. The generated code will display a run-time error
  1080. message and stop your program if a range error is detected.
  1081. The possible causes of range errors are:
  1082. A) Attempts to assign or read in values which are not assignment
  1083.    compatible with a particular type to a variable of that type.
  1084.    e.g. given   var bit : 0..1;
  1085.     using   bit := 2 is a range error.
  1086. B) Attempts to access element outside of array bounds.
  1087.    e.g. given   var x : array[-4..10] of integer;
  1088.     using   x[-5] is a range error
  1089. C) Attempts to use width or fraction specifiers in write/writeln
  1090.    which are less than 1.
  1091.    e.g.
  1092.       writeln(1234.56677:x, y);
  1093.    is a range error if x or y is less than 1.
  1094.  
  1095.          ------------------------------
  1096.  
  1097. Option:  's'
  1098. Purpose: Enables/disabled strict checking of var string parameters.
  1099. Syntax:  -s[+|-]
  1100. Default: Enabled
  1101. Notes:
  1102. When strict checking is enabled it is an error to pass a string variable
  1103. by reference if the length of the variable's string type is not equal to
  1104. the length of the formal parameter's string type.
  1105.  
  1106. When strict checking is disabled you can pass a string variable by reference
  1107. even if the length of the string variable is not equal to the length of the
  1108. formal parameter.
  1109.  
  1110. For example if you compile the following program and strict checking is
  1111. enabled
  1112.  
  1113.    program p(output);
  1114.    type
  1115.       string8 = string[8];
  1116.    var
  1117.       x : string16;
  1118.  
  1119.       procedure print(var s : string8);
  1120.       begin
  1121.       writeln(s)
  1122.       end;
  1123.  
  1124.    begin
  1125.       x := 'Hello';
  1126.       print(x)          (* Error only if strict checking is enabled *)
  1127.    end.
  1128.  
  1129. then the compiler will report an error with the call print(x) since the
  1130. length of x's string type is 16 and the length of the formal parameter's
  1131. sting type is 8 (i.e. they are not equal). If strict checking is disabled
  1132. then no errors are reported.
  1133.  
  1134.          ------------------------------
  1135.  
  1136. Option:  'sc'
  1137. Purpose: Enables/disables short-circuit evaluation for "and" and "or"
  1138. Syntax:  -sc[+|-]
  1139. Default: Enabled
  1140. Notes:
  1141. The Boolean operators "and" and "or" are both binary operators and
  1142. take two Boolean operands, one on the left and one on the right.
  1143. Like 
  1144.      left "and" right         and left "or" right
  1145. where left and right are Boolean expressions.
  1146.  
  1147. Remember that the result of the "and" operator is true only if both the
  1148. left operand and the right operand are true. Short-circuit evaluation
  1149. takes advantage of the fact that if the left operand of "and" is
  1150. evaluated and found to be false then there is no need to evaluate the
  1151. right operand since the final result must be false.
  1152.  
  1153. Similarly the result of the "or" operator is false only if both the
  1154. left operand and the right operand are false. Short-circuit evaluation
  1155. takes advantage of the fact that if the left operand of "or" is evaluated
  1156. and found to be true then there is no need to evaluate the right operand
  1157. since the final result must be true.
  1158.  
  1159. You might want to disable short-circuit evaluation if you need the
  1160. side-effects of evaluating the right operand. For example suppose the
  1161. right operand is a call to a function which modifies some global variables
  1162. (a side-effect) in addition to returning a Boolean value. Then short-circuit
  1163. evaluation might cause the function not to be called and therefore the
  1164. global variables will not get modified. If you want to make sure that the
  1165. right operand is always evaluated then disable short-circuit evaluation.
  1166.  
  1167. On the other hand short-circuit evaluation is sometimes useful. For example
  1168. suppose you have a pointer to an integer and you want to perform some
  1169. calculations if the integer is greater than 100, but you don't know whether
  1170. the pointer is equal to Nil, then with short-circuit evaluation you can
  1171. write:
  1172.  
  1173.      if (p <> Nil) and (p^ > 100) then ... perform calculations ...
  1174.  
  1175. If p is Nil then (p <> Nil) is false and the right operand (p^ > 100) is
  1176. not evaluated which is good since evaluating the (p^ > 100) will cause
  1177. an run-time error when p (which is equal to Nil) is dereferenced.
  1178. Without short-circuit evaluation you would have to write something like:
  1179.  
  1180.      if p <> Nil then
  1181.     if p^ > 100 then ... perform calculations ...
  1182.  
  1183. One solution is to disable short-circuit evaluation using this compiler
  1184. option and use "and_then" instead of "and" and "or_else" instead of "or"
  1185. when you want short-circuit evaluation.
  1186.  
  1187. See "Extensions to Pascal as specified by ISO/IEC 7185" for a
  1188. description of the "and_then" and "or_else" operators.
  1189.  
  1190.          ------------------------------
  1191.  
  1192. Option:  'so'
  1193. Purpose: Enables/disables detailed stack overflow checking
  1194. Syntax:  -so[+|-]
  1195. Default: Disabled
  1196. Notes:
  1197. The interpreter automatically checks for stack overflow at the beginning
  1198. and end of each procedure/function call and when large values are placed
  1199. on the stack. These checks should suffice for most purposes, however you
  1200. can enable this option if you want the interpreter to check for stack
  1201. overflow before every statement is executed.
  1202.  
  1203.          ------------------------------
  1204.  
  1205. Option:  'S'
  1206. Purpose: Specifies the number of kilobytes to allocate for your program's
  1207.      stack.
  1208. Syntax:  -Snn
  1209. Default: nn = 64
  1210. Notes:
  1211. The default stack size (64K) should be more than enough for the vast
  1212. majority of programs. However if your program is heavily recursive or has
  1213. functions that need a large amount of space for local variables or
  1214. parameters then you can increase this value up to a maximum of 1024K (1MB).
  1215. On the other hand you can also use this options to reduce the size of your
  1216. program's stack (not really recommended).
  1217.  
  1218.          ------------------------------
  1219.  
  1220. Option:  'u'
  1221. Purpose: Enables/disables checking for undefined values.
  1222. Syntax:  -u[+|-]
  1223. Default: Enabled
  1224. Notes:
  1225. When this option is enabled the compiler generates code which checks
  1226. each time your program gets a value from a variable to make sure that
  1227. the value is not undefined. If your program does get an undefined value
  1228. from a variable then the code generated by the compiler will issue a
  1229. run-time error message and terminate your program.
  1230. So for example if you compile and run the following program
  1231.    program bad(output);
  1232.    var
  1233.       r : real;
  1234.    begin
  1235.       writeln(r) (* The value of "r" is undefined *)
  1236.    end.
  1237. The program will terminate with a run-time error message because of the
  1238. attempt to print the value of "r" which is undefined.
  1239.  
  1240. Unfortunately not all variable accesses can be checked, checks are only
  1241. made for accesses to variables of the following types:
  1242.    enumerated types (including boolean)
  1243.    subranges of enumerated types
  1244.    subranges of integer that do not include -1
  1245.    file
  1246.    list
  1247.    pointer
  1248.    real
  1249.    set (array representation) (See "B.9 Number of set elements"
  1250.                    for more information).
  1251.  
  1252. Accesses to variables of types "char", "integer", "record" and "set"
  1253. (Bit set representation) are not checked.
  1254.  
  1255. Checking for undefined values is performed as follows:
  1256. A) All memory is initialized by setting all bits to 1.
  1257. B) When accessing a variable a check is performed to see if all bits
  1258. are set and if they are this variable is undefined.
  1259.  
  1260. This doesn't work for "char", "integer" or "set" (bit set representation)
  1261. variables since a value with all bits set is valid for these variables.
  1262. Record are not checked because they may contain fields which can not be
  1263. checked.
  1264.  
  1265.          ------------------------------
  1266.  
  1267. Option:  'v'
  1268. Purpose: Enables/disables variant checking.
  1269. Syntax:  -v[+|-]
  1270. Default: Enabled
  1271. Notes:
  1272. When variant checking is enabled the compiler generates code to check each
  1273. reference to a variant to make sure the variant is active.
  1274.  
  1275.          ------------------------------
  1276.  
  1277. Option:  'W'
  1278. Purpose: Enables/disables warning messages.
  1279. Syntax:  -W[nn][+|-]
  1280. Default: All warning messages enabled.
  1281. Notes:
  1282. Use -W or -W+ to enable all warning messages.
  1283. Use -W- to disable all warning messages.
  1284. Use -Wnn or -Wnn+ to enable warning message number nn.
  1285. Use -Wnn- to disable warning message number nn.
  1286.  
  1287.          ------------------------------
  1288.  
  1289. --------------------------
  1290. 3.3    Compiler directives
  1291. --------------------------
  1292. Compiler directives are special comments that can be placed in a program
  1293. to enable or disable certain compiler features.
  1294. The compiler will treat any comment that begins with a '$' as a compiler
  1295. directive.
  1296.  
  1297. To enable the feature use
  1298.    {$D+} or (*$D+*)
  1299. where
  1300.    D specifies the particular compiler directive.
  1301. To disable the feature use
  1302.    {$D-} or (*$D-*)
  1303.  
  1304. For example the '$I' directive is used to enable/disable I/O checking.
  1305. So use {$I+} or (*$I+*) to enable I/O checking and
  1306. use {$I-} or (*$I-*) to disable I/O checking.
  1307.  
  1308. ----------------------------------
  1309. 3.3.1     Compiler directives list
  1310. ----------------------------------
  1311. Directive: '$B'
  1312. Purpose:   Enables/disables short-circuit evaluation of "and" and "or".
  1313. Syntax:    {$B+} or (*$B+*) or {$B-} or (*$B-*)
  1314. Notes:
  1315. see option "sc" in the compiler options list for more information on
  1316. short-circuit evaluation.
  1317.  
  1318.          ------------------------------
  1319.  
  1320. Directive: '$I'
  1321. Purpose:   Enables/disables I/O checking.
  1322. Syntax:    {$I+} or (*$I+*) or {$I-} or (*$I-*)
  1323. Notes:
  1324. When I/O checking is enabled the compiler generates code to check each
  1325. I/O operation. The generated code will display a run-time error message
  1326. and stop your program if an I/O error is detected.
  1327.  
  1328.          ------------------------------
  1329.  
  1330. Directive: '$P'
  1331. Purpose:   Enables/disables mandatory parentheses mode.
  1332. Syntax:    {$P+} or (*$P+*) or {$P-} or (*$P-*)
  1333. Notes:
  1334. see the "p" option in the compiler options list for more information.
  1335.  
  1336.          ------------------------------
  1337.  
  1338. Directive: '$R'
  1339. Purpose:   Enables/disables range checking.
  1340. Syntax:    {$R+} or (*$R+*) or {$R-} or (*$R-*)
  1341. Notes:
  1342. see the "r" option in the compiler options list for more information.
  1343.  
  1344.          ------------------------------
  1345.  
  1346. Directive: '$S'
  1347. Purpose:   Enables/disabled strict checking of var string parameters.
  1348. Syntax:    {$S+} or (*$S+*) or {$S-} or (*$S-*)
  1349. Notes:
  1350. see the "s" option in the compiler options list for more information.
  1351.  
  1352.          ------------------------------
  1353.  
  1354. Directive: '$U'
  1355. Purpose:   Enables/disables checking for undefined values.
  1356. Syntax:    {$U+} or (*$U+*) or {$U-} or (*$U-*)
  1357. Notes:
  1358. see the "u" option in the compiler options list for more information.
  1359.  
  1360.          ------------------------------
  1361.  
  1362. Directive: '$V'
  1363. Purpose:   Enables/disables variant checking.
  1364. Syntax:    {$V+} or (*$V+*) or {$V-} or (*$V-*)
  1365. Notes:
  1366. see the "v" option in the compiler options list for more information.
  1367.  
  1368.          ------------------------------
  1369.  
  1370. Directive: '$W'
  1371. Purpose:   Enables/disables warning messages.
  1372. Syntax:    {$W[nn]+} or (*$W[nn]+*) or {$W[nn]-} or (*$W[nn]-*)
  1373. Notes:
  1374. Use $W+ to enable all warning messages.
  1375. Use $W- to disable all warning messages.
  1376. Use $WnnWnn+ to enable warning message number nn.
  1377. Use $Wnn- to disable warning message number nn.
  1378.  
  1379.          ------------------------------
  1380.  
  1381. ----------------------------------------------
  1382. 4.0 Using the Irie Virtual Machine Interpreter
  1383. ----------------------------------------------
  1384. The Irie Virtual Machine Interpreter is used to run Irie Virtual
  1385. Machine executables.
  1386. The interpreter should be run from a command-line prompt.
  1387. Syntax: ivm [filename] [arguments]
  1388.  where
  1389.    filename      specifies the Irie Virtual Machine Executable to run.
  1390.  and
  1391.    [arguments]   are program arguments passed to the executable.
  1392. NOTE: [x] indicates that x is optional.
  1393.  
  1394. For example if you compile the sample "hello.pas" program, the compiler
  1395. will generate a file called "hello.ivm" which contains an
  1396. Irie Virtual Machine Executable. You can run it by entering
  1397. "ivm hello" or "ivm hello.ivm".
  1398.  
  1399. NOTE: If you do not specify a path for the executable (as in the example
  1400. above) the interpreter will first look in the current directory and if
  1401. not found the interpreter will search the path.
  1402.  
  1403. ----------------------------------
  1404. 5.0 Using the Irie Upgrade Utility
  1405. ----------------------------------
  1406. The Irie Patch Utility allows registered users to upgrade Irie Pascal
  1407. using special upgrade files available from the IrieTools website.
  1408. The syntax is
  1409.    ivm upgrade upgrade-file
  1410.  
  1411. For example if you are a registered user of Irie Pascal 1.00 for OS/2
  1412. and you wish to upgrade to the latest version of Irie Pascal for OS/2,
  1413. you would download the upgrade for version 1.00
  1414.    o-100.upg
  1415. and place it in the same directory as ipo-100.zip.
  1416. You then enter
  1417.    ivm upgrade o-100.upg
  1418. The Irie Upgrade Utility will generate ipo-101.zip.
  1419.  
  1420. ----------------------------------------
  1421. Appendix A. Deviations from ISO/IEC 7185
  1422. ----------------------------------------
  1423.  
  1424. ----------------------------------
  1425. A.1         end-of-line characters
  1426. ----------------------------------
  1427. ISO/IEC 7185 requires that end-of-line characters read from text files
  1428. be converted to spaces. For example given
  1429.  
  1430.    read(f, c)
  1431.    where "f" is a file at end-of-line
  1432.    and   "c" is a character variable
  1433.  
  1434. then according to ISO/IEC 7185, if "f" is at end-of-line then after the
  1435. read above "c" should contain a space character rather than an end-of-line
  1436. character. Irie Pascal does not convert end-of-line characters read from
  1437. text file, so in the example above "c" will contain an end-of-line character
  1438. (i.e. a linefeed character, chr(10)).
  1439.  
  1440. -------------------------------------------------
  1441. A.2         Termination of all lines in text files
  1442. -------------------------------------------------
  1443. ISO/IEC 7185 requires that all lines in text files (except possibly the line
  1444. that is currently being written) should be terminated by an end-of-line.
  1445. In effect this means that after a text file is closed the last line
  1446. must be terminated by an end-of-line.
  1447.  
  1448. Irie Pascal does not automatically terminate the last line in a text file.
  1449.  
  1450. --------------------------
  1451. A.3         new(p, c1..cN)
  1452. --------------------------
  1453. ISO/IEC 7185 requires support for a form of the required procedure "new"
  1454. as follows:
  1455.  
  1456.    new(p, c1..cN)
  1457.    where "p" is a pointer to a variant record and "c1" thru "cN" are
  1458.      case constants which correspond to the variants in p^.
  1459.  
  1460. Irie Pascal does not currently support this form of "new".
  1461.  
  1462. ------------------------------
  1463. A.4         dispose(q, k1..kM)
  1464. ------------------------------
  1465. ISO/IEC 7185 requires support for a form of the required procedure "dispose"
  1466. as follows:
  1467.  
  1468.    dispose(q, k1..kM)
  1469.    where "q" is a pointer to a variant record and "k1" thru "kM" are
  1470.      case constants which correspond to the variants in q^.
  1471.  
  1472. Irie Pascal does not currently support this form of "dispose".
  1473.  
  1474. ----------------------------
  1475. A.5         Carriage returns
  1476. ----------------------------
  1477. ISO/IEC 7185 requires that all characters written to a file should
  1478. appear when the file is read (the exception to this is that
  1479. implementations are allowed to designate a set of characters
  1480. "prohibited from text files" and treat these characters specially).
  1481.  
  1482. Irie Pascal does not comply fully with this requirement, since
  1483. carriage return characters do not appear when individual characters
  1484. are read from text files. This treatment of carriage return characters
  1485. is intended to convert carriage return/line feed pairs (that are used
  1486. as end-of-line markers in some text files) into a single end-of-line
  1487. character (i.e. a line feed chr(10)).
  1488.  
  1489. ---------------------------------------
  1490. A.6         Documentation of extensions
  1491. ---------------------------------------
  1492. ISO/IEC 7185 requires that implementations be accompanied by a document
  1493. that SEPARATELY (my emphasis) describes all extensions. The Irie Pascal
  1494. documentation describes all extensions, but not in a separate section.
  1495. Instead Irie Pascal describes each extension in the section that it
  1496. logically belongs (i.e. the section for similar features).
  1497. If customers demand it, I will include an additional document that
  1498. just describes extensions, but I am trying to avoid this since having
  1499. extensions described in two separate places will be more difficult to
  1500. maintain.
  1501.  
  1502. ---------------------------------
  1503. Appendix B. Implementation limits
  1504. ---------------------------------
  1505. ISO/IEC 7185 allows implementations to impose limits on the size of a
  1506. program and its data. Irie Pascal imposes various limits on the size and
  1507. complexity of programs and their data, that it will process. These limits
  1508. have been set fairly high so as not to inconvenience the user.
  1509.  
  1510. ----------------------------------
  1511. B.1         Length of source lines
  1512. ----------------------------------
  1513. The maximum length of a source line is 400 characters.
  1514.  
  1515. If you exceed this limit the compiler will issue an error message.
  1516.  
  1517. -----------------------------------------------------
  1518. B.2         Number and nesting of statement sequences
  1519. -----------------------------------------------------
  1520. Statement sequences are the statements that occur between "begin" and "end"
  1521. and between "repeat" and "until". Statement sequences are nested when one
  1522. statement sequence is contained in another.
  1523.  
  1524. The maximum number of statement sequences in a function or procedure is
  1525. 2,147,486,647.
  1526.  
  1527. If you exceed this limit the compiler issues a fatal error message
  1528. (See "3.1 Compiler messages").
  1529.  
  1530. Statement sequences can be nested to a maximum depth of 256.
  1531.  
  1532. If you exceed this limit the compiler issues a fatal error message
  1533. (See "3.1 Compiler messages").
  1534.  
  1535. -------------------------------------------
  1536. B.3         Nesting of functions/procedures
  1537. -------------------------------------------
  1538. Irie Pascal supports nested functions and procedures (i.e. functions
  1539. and procedures can contain other functions and procedures).
  1540.  
  1541. Functions and procedures can be nested to a maximum depth of 256.
  1542. NOTE: This does NOT mean that the total number of functions and
  1543. procedures in a program is 256. This limits applies only to the
  1544. depth of nesting.
  1545.  
  1546. If you exceed this limit the compiler issues a fatal error message
  1547. (See "3.1 Compiler messages").
  1548.  
  1549. -----------------------------------------------------------------
  1550. B.4         Range of variant selector's type & Number of variants
  1551. -----------------------------------------------------------------
  1552. A variant record is a record which contains a variant part.
  1553. The syntax for variant parts given below is taken from ISO/IEC 7185.
  1554.  
  1555.    variant-part = 'case' variant-selector 'of' variant { ';' variant }
  1556.    variant-selector = [ tag-field ':' ] tag-type
  1557.    tag-field = identifier
  1558.    tag-type = ordinal-type-identifier
  1559.    variant = case-constant-list ':' '(' field-list ')'
  1560.    case-constant-list = case-constant { ',' case-constant }
  1561.    case-constant = constant
  1562.    field-list = [ (fixed-part [ ';' variant-part] | variant-part) [';'] ]
  1563.    fixed-part = record-section { ';' record-section }
  1564.    record-section = identifier-list ':' type-denoter
  1565.    identifier-list = identifier { ',' identifier }
  1566.    
  1567. Now the important part of the syntax above in plain English is :
  1568. A variant part consists of the word "case" followed by a variant-selector
  1569. (which is either an identifier followed by a colon and the tag-type or just
  1570. the tag-type), followed by the word "of", and followed by one or more
  1571. variants.
  1572.  
  1573. Irie Pascal limits the maximum range of the tag-type of a variant selector
  1574. to 1024. This also indirectly limits the number of variants in a
  1575. variant-part to 1024.
  1576.  
  1577. If you exceed this limit the compiler issues a warning message and the
  1578. following checks are not performed on the variant record which exceeded
  1579. the limit(s).
  1580. 1. No case-constant should appears more than once.
  1581. 2. Each value specified by the tag-type should appear as a case-constant.
  1582. 3. Only active variants in variant records are accessed.
  1583.  
  1584. ---------------------------------------------------------------------
  1585. B.5         Range of case-index's type & Number of case-list-elements
  1586. ---------------------------------------------------------------------
  1587. A case-index is the expression that follows the word "case" in a
  1588. case statement.
  1589. case-list-elements are the choices in the case statement.
  1590. The syntax for case statements given below is taken from ISO/IEC 7185.
  1591.  
  1592.    case-statement = 'case' case-index 'of' case-list-element
  1593.                { ';' case-list-element } [';' 'end' ]
  1594.    case-index = expression
  1595.    case-list-element = case-constant-list ':' statement
  1596.    case-constant-list = case-constant { ',' case-constant }
  1597.    case-constant = constant
  1598.  
  1599. Irie Pascal limits the maximum range of the case index's type to 1024.
  1600. This also indirectly limits the number of case-list-elements to 1024.
  1601.  
  1602. If you exceed this limit the compiler issues a warning message and the
  1603. following checks are not performed on the case statement which exceeded
  1604. the limit(s).
  1605. 1. No case-constant should appears more than once.
  1606. 2. Each value specified by the type of the case-index should appear as a
  1607.    case-constant.
  1608.  
  1609. -------------------------------------
  1610. B.6         Size of integer constants
  1611. -------------------------------------
  1612. The maximum size of an integer constant is 2,147,486,647
  1613.  
  1614. If you exceed this limit the compiler will issue an error message.
  1615.  
  1616. ----------------------------------
  1617. B.7         Size of real constants
  1618. -----------------------------------
  1619. The maximum size of an real constant is approximately 1e308
  1620.  
  1621. If you exceed this limit the compiler will issue an error message.
  1622.  
  1623. ---------------------------------
  1624. B.8         Size of code and data
  1625. ---------------------------------
  1626. The maximum size of the code in a program is 4GB
  1627. The maximum size of the data in a program is 4GB
  1628.  
  1629. If you exceed this limit the compiler will issue an error message.
  1630.  
  1631. ----------------------------------
  1632. B.9         Number of set elements
  1633. ----------------------------------
  1634. Irie Pascal uses two different representations for sets depending on
  1635. the range of the sets base type, or if the base type is a subrange type
  1636. depending on the range of the subranges host type.
  1637. Suppose you have the set types
  1638.  
  1639.    "set of T"
  1640. and
  1641.    "set of S"
  1642.  
  1643. where S is a subrange of T
  1644. then if T's range is less than or equal to 256 then both sets are represented
  1645. as bit sets, if T's range is greater than 256 then the sets are represented
  1646. using an array representation of fixed size.
  1647.  
  1648. Why am I telling you all this?
  1649. Well because the fixed size of the array representation means that there is
  1650. a limit (255) on the number of set elements that can fit in set variables
  1651. that use the array representation. If you assign a set value with more
  1652. elements than the limit then the set value will overflow and overwrite
  1653. the memory that follows the variable. If assignment overflow checking is
  1654. enabled (see the -ao compiler option) then the overflow will be detected.
  1655.  
  1656. ---------------------------------
  1657. B.10        Nesting of statements
  1658. ---------------------------------
  1659. Irie Pascal limits the maximum depth of nesting of statements to 256.
  1660. NOTE: This does NOT mean that the total number of statements in a program
  1661. is 256. This limits the depth of nesting (i.e. the depth to which
  1662. statements can contain other statements which can contain other statements
  1663. etc.).
  1664.  
  1665. If you exceed this limit the compiler issues a fatal error message
  1666. (see "3.1 Compiler messages").
  1667.  
  1668. ----------------------
  1669. B.11        Stack size
  1670. ----------------------
  1671. The default stack size is 64K but you can adjust this to any value from
  1672. 1K to 1024K (1MB) using the -S compiler option.
  1673.  
  1674. If you exceed this limit the compiler will issue an error message.
  1675.  
  1676. -------------------------------------------
  1677. Appendix C. Implementation-defined features
  1678. -------------------------------------------
  1679. The Pascal Standard (ISO/IEC 7185) specifies that some features of the
  1680. Pascal language are implementation-defined. ISO/IEC 7185 further specifies
  1681. that each implementation (called a processor by ISO/IEC 7185) must provide
  1682. a definition of all implementation-defined features. The effect of this is
  1683. that the exact behavior of the implementation-defined features, may differ
  1684. between processors, but must be consistent for any particular processor.
  1685.  
  1686. Below is the definition of how this implementation/processor handles all
  1687. implementation-defined features.
  1688. Each definition has the following format:
  1689.  
  1690. First the official description of the feature is taken from ISO/IEC 7185
  1691. and placed in quotation marks.
  1692. This is followed by my interpretation of the official description if I
  1693. feel the official description is unclear or requires the reader to have
  1694. a copy of ISO/IEC 7185.
  1695. Finally a statement describing how this implementation/processor handles
  1696. the feature is at the end.
  1697.  
  1698. ---------------------------
  1699. C.1         String-elements
  1700. ---------------------------
  1701. "6.1.7 There shall be an implementation-defined one-to-one correspondence
  1702. between the set of alternatives from which string-elements are drawn and
  1703. a subset of the values of the required char-type".
  1704.  
  1705. In other words an implementation-defined subset of the character values
  1706. can be used to create character literals.
  1707.  
  1708. Irie Pascal allows character literals to be formed from any of the
  1709. "printable" characters from the IBM extended character set.
  1710.  
  1711. ---------------------------------------------------------
  1712. C.2         Provision of tokens and delimiting characters
  1713. ---------------------------------------------------------
  1714. "6.1.9 Provision of the reference tokens ^, [, and ], of the alternative
  1715. token @, and of the delimiting characters { and }, is
  1716. implementation-defined".
  1717.  
  1718. Irie Pascal provides the reference tokens, the alternative token, and the
  1719. delimiting characters.
  1720.  
  1721. ---------------------------------------------
  1722. C.3         Size and precision of real values
  1723. ---------------------------------------------
  1724. "6.4.2.2 b) The values of the real-type shall be an implementation-defined
  1725. subset of the real numbers denoted by signed-real".
  1726.  
  1727. The real numbers described by the ISO/IEC 7185 have infinite range and
  1728. infinite precision. Implementations are allowed to limit the maximum range
  1729. and precision of real numbers.
  1730.  
  1731. Irie Pascal uses 64 bit reals stored as specified by the following standard:
  1732. "IEEE standard for binary floating-point arithmetic (ANSI/IEC std 754-1985)".
  1733.  
  1734. -------------------------
  1735. C.4         Character set
  1736. -------------------------
  1737. "6.4.2.2 d) The values of char-type shall be the enumeration of a set of
  1738. implementation-defined characters, some possibly without graphic
  1739. representation".
  1740.  
  1741. Irie Pascal uses the enumeration of the IBM extended character set for
  1742. values of char-type.
  1743.  
  1744. ----------------------------------------
  1745. C.5         Ordinal values of characters
  1746. ----------------------------------------
  1747. "6.4.2.2 d) The ordinal numbers of each value of char-type are
  1748. implementation-defined".
  1749.  
  1750. Irie Pascal uses the position of each value of char-type, in the IBM
  1751. extended character set, as it's ordinal number.
  1752. So for example since the space character is at position 32 then
  1753.  ord(' ') = 32.
  1754.  
  1755. ------------------------------------------------
  1756. C.6         Characters prohibited from text files
  1757. ------------------------------------------------
  1758. "6.4.3.5 There shall be an implementation-defined subset of the set of 
  1759. char-type values, designated 'characters prohibited from text files'"
  1760.  
  1761. This seems to me to be a loophole provided by ISO/IEC 7185 to allow
  1762. implementations to get around the requirements specified for text files,
  1763. especially the requirement that all characters written to a text file
  1764. appear when the text file is read in.
  1765.  
  1766. Irie Pascal designates one character as "prohibited from text files". This
  1767. character is chr(26), also known as the EOF character.
  1768. NOTE: By prohibited I don't mean that you can't write EOF characters to
  1769. text files, but if you do then the text file will be terminated at
  1770. that point (i.e. characters written after the EOF will not appear when the
  1771. text file is read back in). Since this technically violates the standard
  1772. I have taken advantage of this loophole to "prohibit" EOF's from text
  1773. files and thus remain compliant.
  1774.  
  1775. ---------------------------------
  1776. C.7         When I/O is performed
  1777. ---------------------------------
  1778. "6.6.5.2 The point at which the file operations "rewrite", "put", "reset",
  1779. and "get" are actually performed is implementation-defined".
  1780.  
  1781. Irie Pascal implements "lazy I/O" (i.e. input operations are performed at
  1782. the latest opportunity and output operations are performed at the earliest
  1783. opportunity), which facilitates interactive terminal input and output.
  1784. So the four file operations are performed as specified below:
  1785. "append" - the file is opened but the file buffer is empty.
  1786. "rewrite" - the file is opened but the file buffer is empty.
  1787. "put" - the contents of the file buffer are appended to the file.
  1788. "reset" - the file is opened, but the file buffer is not filled until
  1789.       it is accessed.
  1790. "get" - If the file buffer is full then the file buffer is emptied to
  1791.       make room for the next file value (NOTE: In this case no I/O
  1792.       is actually performed).
  1793.     If the file buffer is empty then the next data value is skipped
  1794.       (i.e. read and ignored). The file buffer remains empty.
  1795.  
  1796. ---------------------------
  1797. C.8         Value of maxint
  1798. ---------------------------
  1799. "6.7.2.2 The required constant-identifier maxint shall denote an
  1800. implementation-defined value of integer-type".
  1801.  
  1802. Irie Pascal uses 2,147,483,647 as the value of "maxint".
  1803.  
  1804. -----------------------------------------------------
  1805. C.9         Accuracy of real operations and functions
  1806. -----------------------------------------------------
  1807. "6.7.2.2 The accuracy of the approximation of the result of the real
  1808. operations and functions to the mathematical result is
  1809. implementation-defined".
  1810.  
  1811. Irie Pascal performs real operations as specified in
  1812. "IEEE standard for binary floating-point arithmetic (ANSI/IEC std 754-1985)"
  1813. the final results are stored in 64 bit reals.
  1814.  
  1815. --------------------------------------------------------
  1816. C.10        Default value of TotalWidth for integer-type
  1817. --------------------------------------------------------
  1818. "6.9.3.1 The default value of TotalWidth for integer-type is
  1819. implementation-defined".
  1820.  
  1821. When writing integer values to text files the default width of the
  1822. output field is implementation defined.
  1823.  
  1824. Irie Pascal uses 8 as the default value of TotalWidth for integer-type.
  1825. So for example
  1826.  
  1827.    write('one=',1)
  1828.  
  1829. will cause
  1830.  
  1831.    one=       1
  1832.  
  1833. to be written (i.e. the value "1" is written as seven spaces and a "1").
  1834.  
  1835. -----------------------------------------------------
  1836. C.11        Default value of TotalWidth for real-type
  1837. -----------------------------------------------------
  1838. "6.9.3.1 The default value of TotalWidth for real-type is
  1839. implementation-defined".
  1840.  
  1841. When writing real values to text files the default width of the
  1842. output field is implementation defined.
  1843.  
  1844. Irie Pascal uses 9 as the default value of TotalWidth for real-type.
  1845.  
  1846. --------------------------------------------------------
  1847. C.12        Default value of TotalWidth for Boolean-type
  1848. --------------------------------------------------------
  1849. "6.9.3.1 The default value of TotalWidth for Boolean-type is
  1850. implementation-defined".
  1851.  
  1852. When writing boolean values to text files the default width of the
  1853. output field is implementation defined.
  1854.  
  1855. Irie Pascal uses 8 as the default value of TotalWidth for Boolean-type.
  1856.  
  1857. -------------------------------------------------
  1858. C.13        Number of digits written in exponents
  1859. -------------------------------------------------
  1860. "6.9.3.4.1 ExpDigits is an implementation-defined value representing the
  1861. number of digit-characters written in an exponent".
  1862.  
  1863. Irie Pascal uses 3 as the value of ExpDigits.
  1864. So for example
  1865.  
  1866.    write('one=', 1.0)
  1867.  
  1868. will cause
  1869.  
  1870.    one= 1.0E+000
  1871.  
  1872. NOTE: The exponent "000" has three digits.
  1873.  
  1874. ------------------------------------------------------
  1875. C.14 Use of "e" or "E" as exponent character on output
  1876. ------------------------------------------------------
  1877. "6.9.3.4.1 The value of the exponent character ('e' or 'E') used on output
  1878. of values of real-type is implementation-defined".
  1879.  
  1880. Irie Pascal uses 'E' on output of values of real-types.
  1881.  
  1882. ---------------------------------------------------------------
  1883. C.15        Case of characters used on output of Boolean values
  1884. ---------------------------------------------------------------
  1885. "6.9.3.5 The case of each character of 'True' and 'False' used on output of
  1886. values of Boolean-type is implementation-defined".
  1887.  
  1888. Irie Pascal uses 'true' and 'false' on output of values of Boolean-type.
  1889.  
  1890. -----------------------------------------------
  1891. C.16        Effect of built-in procedure "page"
  1892. -----------------------------------------------
  1893. "6.9.5 The effect of the procedure "page" when applied to a text file which
  1894. is in generation mode is implementation-defined".
  1895.  
  1896. The procedure "page" causes a form feed character (i.e. chr(12)) to be
  1897. written to text files to which it is applied.
  1898.  
  1899. ---------------------------------------------------
  1900. C.17        Binding of file-type program-parameters
  1901. ---------------------------------------------------
  1902. "6.10 The binding of a file-type program-parameter is
  1903. implementation-defined".
  1904.  
  1905. See "10 Program parameters" in the Irie Pascal Programmers Reference Manual
  1906. for a description of how file-type program parameters are handled.
  1907.  
  1908. -------------------------------------------------------------------
  1909. C.18        Effect of "reset" and "rewrite" on "input" and "output"
  1910. -------------------------------------------------------------------
  1911. "6.10 The effect of "reset" and "rewrite" on the standard files "input" and
  1912. "output" is implementation-defined".
  1913.  
  1914. "reset" and "rewrite" have no effect on the standard files "input" and
  1915. "output".
  1916.  
  1917. ---------------------------------------------
  1918. Appendix D. Implementation-dependent features
  1919. ---------------------------------------------
  1920. The Pascal Standard (ISO/IEC 7185) does not completely define all features
  1921. of the language. Some features are implementation-dependent (i.e. possibly
  1922. differing between implementations and not necessarily defined for any
  1923. particular implementation).
  1924.  
  1925. Below is the definition of how this implementation/processor treats all
  1926. implementation-dependent features.
  1927. Each definition has the following format:
  1928.  
  1929. First the official description of the feature is taken from ISO/IEC 7185
  1930. and placed in quotation marks.
  1931. This is followed by my interpretation of the official description if I
  1932. feel the official description is unclear or requires the reader to have
  1933. a copy of ISO/IEC 7185.
  1934. Finally a statement describing how this implementation/processor handles the
  1935. feature is at the end.
  1936.  
  1937. -----------------------------------------------------
  1938. D.1         Effect of writing "prohibited" characters
  1939. -----------------------------------------------------
  1940. "6.4.3.5 For any text file t, the effect of attributing to a component of
  1941. either t.L or t.R a member of the characters prohibited from text files
  1942. is implementation-dependent".
  1943.  
  1944. In other words the effect of writing any of the characters, that
  1945. implementations are allowed to prohibit from text files, to a text file is
  1946. implementation-dependent.
  1947.  
  1948. Irie Pascal "prohibits" one character from text files, the character is
  1949. chr(26) the end-of-file character. Writing the end-of-file character to a
  1950. text file causes the file to be terminated (i.e. any characters written
  1951. after the EOF character will not appear when the file is read).
  1952.  
  1953. ----------------------------------------------------
  1954. D.2         Order of evaluation of index-expressions
  1955. ----------------------------------------------------
  1956. "6.5.3.2 The order of evaluation of the index-expressions of an
  1957. indexed-variable is implementation-dependent".
  1958.  
  1959. Irie Pascal evaluates index-expressions of indexed-variables from left to
  1960. right.
  1961.  
  1962. For example given
  1963.  
  1964.      var   x[1..10, 1..20] of integer;
  1965.  
  1966. and later on
  1967.  
  1968.      x[i, j] := 20;
  1969.  
  1970. "i" will get evaluated before "j".
  1971.  
  1972. ---------------------------------------------------------------------
  1973. D.3         Order of evaluation of expressions of a member-designator
  1974. ---------------------------------------------------------------------
  1975. "6.7.1 The order of evaluation of expressions of a member-designator
  1976. is implementation-dependent".
  1977.  
  1978. Irie Pascal evaluates expressions of member-designators from left to right.
  1979.  
  1980. For example given
  1981.     const low = 'a'; high = 'z';
  1982.     var letter : set of char;
  1983. and later on
  1984.     letter := [low..high];
  1985.  
  1986. "low" will be evaluated before "high".
  1987.  
  1988. -----------------------------------------------------
  1989. D.4         Order of evaluation of member-designators
  1990. -----------------------------------------------------
  1991. "6.7.1 The order of evaluation of the member-designators of a
  1992. set-constructor is implementation-dependent".
  1993.  
  1994. Irie Pascal evaluates member-designators of set-constructors from left to
  1995. right.
  1996.  
  1997. For example given
  1998.     var yes : set of char;
  1999. and later on
  2000.     yes := ['y', 'Y']'
  2001.  
  2002. "y" will be evaluated before "Y".
  2003.  
  2004. ---------------------------------------------------------------
  2005. D.5         Order of evaluation of operands of dyadic operators
  2006. ---------------------------------------------------------------
  2007. "6.7.2.1 The order of evaluation of the operands of a dyadic operator is
  2008. implementation-dependent".
  2009.  
  2010. In other words the order of evaluation of the operands of any of the
  2011. following operators is implementation-dependent:
  2012.    * / div mod and + - or = <> < > <= >= in and_then or_else shr shl
  2013. (i.e. the operands can be evaluation left-to-right, right-to-left,
  2014. in parallel, or they may not both be evaluated).
  2015.  
  2016. Irie Pascal always evaluates the operands of the following operators from
  2017. left-to-right:
  2018.    * / div mod + - = <> < > <= >= in shr shl
  2019.  
  2020. Irie Pascal always evaluates the operands of the following operators using
  2021. short-circuit evaluation:
  2022.    and_then or_else
  2023. See the "sc" compiler option for more information on short-circuit
  2024. evaluation.
  2025.  
  2026. Irie Pascal evaluates the operands of the following operators, using
  2027. short-circuit evaluation if short-circuit evaluation is enabled,
  2028. or left-to-right if short-circuit evaluation is disabled:
  2029.    "and"   "or"
  2030. See the "sc" compiler option and the $B compiler directive for information
  2031. on enabling and disabling short-circuit evaluation.
  2032.  
  2033. -----------------------------------------------------------------------
  2034. D.6         Order of evaluation of actual-parameters for function calls
  2035. -----------------------------------------------------------------------
  2036. "6.7.3 The order of evaluation, accessing, and binding of the
  2037. actual-parameters  of a function-designator is implementation-dependent".
  2038.  
  2039. In other words the order in which the actual-parameters are evaluated
  2040. and passed to the formal-parameters during a functions call is
  2041. implementation-dependent.
  2042.  
  2043. Irie Pascal evaluates and passes actual-parameters from left to right.
  2044.  
  2045. -------------------------------------------------------------------
  2046. D.7         Order of evaluating components of assignment statements
  2047. -------------------------------------------------------------------
  2048. "6.8.2.2 The order of accessing the variable and evaluating the expression
  2049. of an assignment-statement is implementation-dependent".
  2050.  
  2051. I am not sure what is meant by "accessing the variable" so all I
  2052. can say is that the address of the variable is calculated before the
  2053. expression is evaluated.
  2054.  
  2055. ------------------------------------------------------------------------
  2056. D.8         Order of evaluation of actual-parameters for procedure calls
  2057. ------------------------------------------------------------------------
  2058. "6.7.3 The order of evaluation, accessing, and binding of the
  2059. actual-parameters  of a procedure-statement is implementation-dependent".
  2060.  
  2061. In other words the order in which the actual-parameters are evaluated
  2062. and passed to the formal-parameters during a procedure call is
  2063. implementation-dependent.
  2064.  
  2065. Irie Pascal evaluates and passes actual-parameters from left to right.
  2066.  
  2067. --------------------------------------------------------------------------
  2068. D.9         Effect of reading a text file to which "page" has been applied
  2069. --------------------------------------------------------------------------
  2070. "6.9.5 The effect of inspecting a text file to which the page procedure was
  2071. applied during generation is implementation-dependent".
  2072.  
  2073. Applying "page" to a text file during generation causes a form feed
  2074. character chr(12) to be written to the file. During inspection (i.e. when
  2075. the text file is read) the handling of the form feed character depends on
  2076. the type of data the program is trying to read. If the program is trying to
  2077. read in integer or real data then the form feed character is treated like a
  2078. space character and is therefore skipped. If the program is trying to read
  2079. in character or string data then the form feed character is read in like
  2080. any other character.
  2081.  
  2082. ---------------------------------------------------
  2083. D.10        Binding of non-file program-parameters
  2084. ---------------------------------------------------
  2085. "6.10 The binding of the non-file variables denoted by the
  2086. program-parameters to entities external to the program is
  2087. implementation-dependent".
  2088.  
  2089. See "10 Program parameters" in the Irie Pascal Programmers Reference Manual
  2090. for a description of the binding of program-parameters to entities external
  2091. to the program.
  2092.  
  2093. ------------------
  2094. Appendix E. Errors
  2095. ------------------
  2096. ISO/IEC 7185 defines an error as follows:
  2097.  
  2098. "A violation by a program of the requirements of this International
  2099. Standard that a processor is permitted to leave undetected".
  2100.  
  2101. ISO/IEC 7185 then goes on to add the following two notes:
  2102.  
  2103. "1. If it is possible to construct a program in which the violation or
  2104. non-violation of this International Standard requires knowledge of the
  2105. data read by the program or the implementation definition of
  2106. implementation-defined features, then violation of that requirement is
  2107. classified as an error. Processors may report on such violations of the
  2108. requirement without such knowledge, but there always remain some cases
  2109. that require execution, simulated execution, or proof procedures with the
  2110. required knowledge. Requirements that can be verified without such
  2111. knowledge are not classified as errors.
  2112.  
  2113. 2. Processors should attempt the detection of as many errors as possible,
  2114. and to as complete a degree as possible. Permission to omit detection is
  2115. provided for implementations in which the detection would be an excessive
  2116. burden."
  2117.  
  2118. Below is the documentation of how this implementation/processor handles
  2119. all errors. Most of the time the documentation consists only of a statement
  2120. about whether or not the error is reported. The description of each error is
  2121. taken from ISO/IEC 7185.
  2122.  
  2123. -------------------------------------
  2124. E.1         Array index out of bounds
  2125. -------------------------------------
  2126. "6.5.3.2 For an indexed-variable closest-containing a single
  2127. index-expression, it is an error if the value of the index-expression is
  2128. not assignment-compatible with the index-type of the array-type."
  2129.  
  2130. In other words it is error to access an array component that does not exist.
  2131. For example given:
  2132.  
  2133.    var a : array[1..20] of char;
  2134.  
  2135. then
  2136.  
  2137.    a[0]
  2138.  
  2139. is an error since 0 is not assignment-compatible with 1..10.
  2140. NOTE: There is no 0th component of "a".
  2141.  
  2142. This error is reported if range checking is enabled.
  2143. See also the "r" compiler option and the '$R' compiler directive.
  2144.  
  2145. --------------------------------------
  2146. E.2         Accessing inactive variant
  2147. --------------------------------------
  2148. "6.5.3.3 It is an error unless a variant is active for the entirety of each
  2149. reference and access to each component of the variant."
  2150.  
  2151. This error is reported if the following two conditions are met:
  2152. 1. Range checking is enabled
  2153. 2. The range of the variant selector's type is less than or equal to the
  2154.    implementation limit (i.e. 1024).
  2155.  
  2156. See also the "v" compiler option and the "$V" compiler directive.
  2157.  
  2158. --------------------------------------
  2159. E.3         Dereferencing nil pointers
  2160. --------------------------------------
  2161. "6.5.4 It is an error if the pointer-variable of an identified-variable
  2162. denotes a nil-value."
  2163.  
  2164. In other words it is an error to dereference a pointer variable which is
  2165. equal to nil (i.e. "p^" is an error if "p = nil").
  2166.  
  2167. This error is reported.
  2168.  
  2169. --------------------------------------------
  2170. E.4         Dereferencing undefined pointers
  2171. --------------------------------------------
  2172. "6.5.4 Is an error if the pointer-variable of an identified-variable is
  2173. undefined."
  2174.  
  2175. In other words it is an error to dereference a pointer-variable which is
  2176. undefined (i.e. "p^" is an error if "p" is undefined).
  2177.  
  2178. This error is reported.
  2179.  
  2180. -----------------------------
  2181. E.5         Dangling pointers
  2182. -----------------------------
  2183. "6.5.4 It is an error to remove from its pointer-type the identifying-value
  2184. of an identified-variable when a reference to the identified-variable
  2185. exists."
  2186.  
  2187. In other words it is an error to use "dispose" to free the memory allocated
  2188. for a pointer if other pointers to the same memory exists.
  2189.  
  2190. This error is not reported.
  2191.  
  2192. -----------------------------------
  2193. E.6         Altering file-variables
  2194. -----------------------------------
  2195. "6.5.5 It is an error to alter the value of a file-variable f when a
  2196. reference to the buffer-variable f^ exists."
  2197.  
  2198. According to ISO/IEC 7185 there are four ways of establishing a reference
  2199. to a variable.
  2200. 1. Passing the variable by reference establishes a reference to the variable
  2201.    for the life of the function/procedure call.
  2202. 2. Using an assignment-statement to assign a value to the variable
  2203.    establishes a reference to the variable starting either before or after
  2204.    the expression on the right-hand side of the assignment statement is
  2205.    evaluated, and lasting until the value has been assigned to the variable.
  2206. 3. Using the variable on a with-statement establishes a reference to the
  2207.    variable that exists during the execution of the statement in the
  2208.    with-statement.
  2209. 4. Establishing a reference to a component of the variable.
  2210.  
  2211. So for example it would be an error if you pass a file-buffer by reference
  2212. to a procedure, and that procedure performs I/O on the file associated
  2213. with the file-buffer.
  2214.  
  2215. This error is not reported.
  2216.  
  2217. -----------------------------------------------
  2218. E.7         Using out-of-range value parameters
  2219. -----------------------------------------------
  2220. "6.6.3.2 It is an error if the value of each corresponding actual value
  2221. parameter is not assignment-compatible with the type possessed by the
  2222. formal-parameter."
  2223.  
  2224. If you think about it this makes sense since passing a value to a function
  2225. or procedure is very much like assigning the value to the corresponding
  2226. formal parameter.
  2227.  
  2228. This error is reported if range checking is enabled.
  2229. See also the "r" compiler option and the '$R' compiler directive.
  2230.  
  2231. --------------------------------------------------
  2232. E.8         Using out-of-range set value parameters
  2233. --------------------------------------------------
  2234. "6.6.5.2 For a value parameter, it is an error if the actual-parameter
  2235. is an expression of a set-type whose value is not assignment-compatible
  2236. with the type possessed by the formal-parameter."
  2237.  
  2238. This is very similar to the previous error (E.7).
  2239.  
  2240. This error is reported if range checking is enabled.
  2241. See also the "r" compiler option and the '$R' compiler directive.
  2242.  
  2243. -----------------------------------------------
  2244. E.9         Output to file not open for writing
  2245. -----------------------------------------------
  2246. "6.6.5.2 It is an error if the file mode is not Generation immediately prior
  2247. to any use of put, write, writeln or page."
  2248.  
  2249. In other words it is an error to perform output on a file which is not
  2250. open for writing (i.e. either not open or open for reading).
  2251.  
  2252. This error is reported if I/O checking is enabled.
  2253. See the "i" compiler option and the '$I' compiler directive.
  2254.  
  2255. ------------------------------------
  2256. E.10        Output to undefined file
  2257. ------------------------------------
  2258. "6.6.5.2 It is an error if the file is undefined immediately prior to any
  2259. use of put, write, writeln or page."
  2260.  
  2261. This error is reported if I/O checking is enabled.
  2262. See the "i" compiler option and the '$I' compiler directive.
  2263.  
  2264. -------------------------------------
  2265. E.11        Writing to middle of file
  2266. -------------------------------------
  2267. "6.6.5.2 It is an error if end-of-file is not true immediately prior to
  2268. any use of put, write, writeln or page."
  2269.  
  2270. In other words all output must take place at the end of files.
  2271.  
  2272. Irie Pascal supports output in the middle of a file using the "seek"
  2273. procedure, and so does not consider this an error and therefore does not
  2274. report it.
  2275.  
  2276. ---------------------------------------------------
  2277. E.12        Using Put on undefined buffer-variables
  2278. ---------------------------------------------------
  2279. "6.6.5.2 It is an error if the buffer-variable is undefined immediately
  2280. prior to any use of put."
  2281.  
  2282. This error is reported if I/O checking is enabled.
  2283. See the "i" compiler option and the '$I' compiler directive.
  2284.  
  2285. ------------------------------------
  2286. E.13        Resetting undefined files
  2287. ------------------------------------
  2288. "6.6.5.2 It is an error if the file is undefined immediately prior to
  2289. any use of reset."
  2290.  
  2291. This error is reported if I/O checking is enabled.
  2292. See the "i" compiler option and the '$I' compiler directive.
  2293.  
  2294. ------------------------------------------------
  2295. E.14        Input from file not open for reading
  2296. ------------------------------------------------
  2297. "6.6.5.2 It is an error if the file mode is not inspection immediately
  2298. prior to any use of get or read."
  2299.  
  2300. In other words it is an error to perform input from a file which is not
  2301. open for reading (i.e. either not open or open for writing).
  2302.  
  2303. This error is reported if I/O checking is enabled.
  2304. See the "i" compiler option and the '$I' compiler directive.
  2305.  
  2306. -------------------------------------
  2307. E.15        Input from undefined file
  2308. -------------------------------------
  2309. "6.6.5.2 It is an error if the file is undefined immediately prior to
  2310. any use if get or read."
  2311.  
  2312. This error is reported if I/O checking is enabled.
  2313. See the "i" compiler option and the '$I' compiler directive.
  2314.  
  2315. ------------------------------------
  2316. E.16        Reading past end-of-file
  2317. ------------------------------------
  2318. "6.6.5.2 It is an error if end-of-file is true immediately prior to any
  2319. use of get or read."
  2320.  
  2321. In other words it is an error to attempt to read past the end of a file.
  2322.  
  2323. This error is reported if I/O checking is enabled.
  2324. See the "i" compiler option and the '$I' compiler directive.
  2325.  
  2326. ---------------------------------------
  2327. E.17        Reading out of range values
  2328. ---------------------------------------
  2329. "6.6.5.2 For read, it is an error if the value possessed by the
  2330. buffer-variable is not assignment-compatible with the variable-access."
  2331.  
  2332. In other words it is an error to read a value into a variable, if the value
  2333. is outside the allowed range for the variable.
  2334.  
  2335. This error is reported if range checking is enabled.
  2336. See also the "r" compiler option and the '$R' compiler directive.
  2337.  
  2338. ---------------------------------------
  2339. E.18        Writing out of range values
  2340. ---------------------------------------
  2341. "6.6.5.2 For write, it is an error if the value possessed by the expression
  2342. is not assignment-compatible with the buffer-variable."
  2343.  
  2344. In other words it is an error to write a value to a file, if the value
  2345. is not outside the allowed range of the files component type.
  2346. For example given:
  2347.  
  2348.    type
  2349.       positive = 0..maxint;
  2350.    var
  2351.       f : file of positive;
  2352.  
  2353. then
  2354.  
  2355.    write(f, -1);
  2356.  
  2357. is an error since "-1" is outside the range of "0..maxint".
  2358.  
  2359. This error is reported if range checking is enabled.
  2360. See also the "r" compiler option and the '$R' compiler directive.
  2361.  
  2362. -----------------------------------------------
  2363. E.19        new(p, c1..cN) constraints violated
  2364. -----------------------------------------------
  2365. "6.6.5.3 For new(p, c1..cN), it is an error if a variant of a variant-part
  2366. within the new variable becomes active and a different variant of the
  2367. variant-part is one of the specified variants."
  2368.  
  2369. In other words if you use this form of "new" and specify case-constants
  2370. c1 thru cN then it is an error if a variant other than those specified
  2371. by c1 thru cN become active.
  2372.  
  2373. Irie Pascal does not support this form of "new" so the error can not occur.
  2374.  
  2375. ------------------------------------------
  2376. E.20        Incompatible use of dispose(p)
  2377. ------------------------------------------
  2378. "6.6.5.3 For dispose(p), it is an error if the identifying-value had been
  2379. created using the form new(p, c1..cN)."
  2380.  
  2381. Irie Pascal does not support this form of "new" so the error can not occur.
  2382.  
  2383. --------------------------------------------------
  2384. E.21        Incompatible use of dispose(p, k1..kM)
  2385. --------------------------------------------------
  2386. "6.6.5.3 For dispose(p, k1..kM), it is an error unless the variable had
  2387. been created using the form new(p, c1..cN) and m is equal to n."
  2388.  
  2389. Irie Pascal does not support this form of "dispose" so the error can not
  2390. occur.
  2391.  
  2392. ----------------------------------------------------
  2393. E.22        dispose(p, k1..kM) constraint violations
  2394. ----------------------------------------------------
  2395. "6.6.5.3 for dispose(p, k1..kM), it is an error if the variants identified
  2396. by the pointer value of p are different from those specified by the
  2397. case-constants k1..kM."
  2398.  
  2399. Irie Pascal does not support this form of "dispose" so the error can not
  2400. occur.
  2401.  
  2402. ---------------------------------
  2403. E.23        disposing nil pointer
  2404. ---------------------------------
  2405. "6.6.5.3 For dispose, it is an error if the pointer variable has a
  2406. nil-value."
  2407.  
  2408. This error is reported.
  2409.  
  2410. ---------------------------------------
  2411. E.24        disposing undefined pointer
  2412. ---------------------------------------
  2413. "6.6.5.3 For dispose, it is an error if the pointer variable has an
  2414. undefined value."
  2415.  
  2416. This error is reported.
  2417.  
  2418. -----------------------------------------------
  2419. E.25        new(p, c1..cN) constraints violated
  2420. -----------------------------------------------
  2421. "6.6.5.3 It is an error if a variable created using the second form of new
  2422. is accessed by the identified-variable of the variable-access of a factor,
  2423. of an assignment-statement, or of an actual parameter."
  2424.  
  2425. Irie Pascal does not support this form of "new" so the error can not occur.
  2426.  
  2427. -------------------------------
  2428. E.26        Invalid use of pack
  2429. -------------------------------
  2430. "6.6.5.4 For pack, it is an error if the parameter of ordinal-type is not
  2431. assignment-compatible with the index-type of the unpacked array parameter."
  2432.  
  2433. This error is reported.
  2434.  
  2435. -------------------------------
  2436. E.27        Invalid use of pack
  2437. -------------------------------
  2438. "6.6.5.4 For pack, it is an error if any of the components of the unpacked
  2439. array are both undefined and accessed."
  2440.  
  2441. This error is not reported.
  2442.  
  2443. -------------------------------
  2444. E.28        Invalid use of pack
  2445. -------------------------------
  2446. "6.6.5.4 For pack, it is an error if the index-type of the unpacked array
  2447. is exceeded."
  2448.  
  2449. This error is reported.
  2450.  
  2451. ---------------------------------
  2452. E.29        Invalid use of unpack
  2453. ---------------------------------
  2454. "6.6.5.4 For unpack, it is an error if the parameter of ordinal-type is not
  2455. assignment-compatible with the index-type of the unpacked array parameter."
  2456.  
  2457. This error is reported.
  2458.  
  2459. ---------------------------------
  2460. E.30        Invalid use of unpack
  2461. ---------------------------------
  2462. "6.6.5.4 For unpack, it is an error if any of the components of the packed
  2463. array are undefined."
  2464.  
  2465. This error is not reported.
  2466.  
  2467. ---------------------------------
  2468. E.31        Invalid use of unpack
  2469. ---------------------------------
  2470. "6.6.5.4 For unpack, it is an error if the index-type of the unpacked array
  2471. is exceeded."
  2472.  
  2473. This error is reported.
  2474.  
  2475. -----------------------------------
  2476. E.32        Square of large numbers
  2477. -----------------------------------
  2478. "6.6.6.2 Sqr(x) computes the square of x. It is an error if such a value
  2479. does not exist."
  2480.  
  2481. In other words it is an error if sqr(x) is too large to be represented
  2482. by real.
  2483.  
  2484. This error is reported.
  2485.  
  2486. ----------------------------
  2487. E.33        ln(x) and x <= 0
  2488. ----------------------------
  2489. "6.6.6.2 For ln(x), it is an error if x is not greater than zero."
  2490.  
  2491. This error is reported.
  2492.  
  2493. ------------------------------------------
  2494. E.34        Square root of negative number
  2495. ------------------------------------------
  2496. "6.6.6.2 For sqrt(x), it is an error if x is negative."
  2497.  
  2498. This error is reported.
  2499.  
  2500. -------------------------------
  2501. E.35        Problems with trunc
  2502. -------------------------------
  2503. "6.6.6.3 For trunc(x), the value of trunc(x) is such that if x is positive
  2504. or zero then 0<=x-trunct(x)<1; otherwise 1<x-trunc(x)<=0. It is an error
  2505. if such a value does not exist."
  2506.  
  2507. In other words it is an error to use "trunc" to convert a real number to an
  2508. integer number if the real number is outside the range of integer numbers
  2509. supported by the implementation.
  2510.  
  2511. For example
  2512.  
  2513.    trunc(maxint+1.0)
  2514.  
  2515. is an error.
  2516.  
  2517. This error is not reported.
  2518.  
  2519. -------------------------------
  2520. E.36        Problems with round
  2521. -------------------------------
  2522. "6.6.6.3 For round(x), if x is positive or zero then round(x) is equivalent
  2523. to trunc(x+0.5), otherwise round(x) is equivalent to trunc(x-0.5). It is an
  2524. error if such a value does not exist."
  2525.  
  2526. In other words it is an error to use "round" to convert a real number to an
  2527. integer number if the real number is outside the range of integer numbers
  2528. supported by the implementation.
  2529.  
  2530. For example
  2531.  
  2532.    round(maxint+1.0)
  2533.  
  2534. is an error.
  2535.  
  2536. This error is not reported.
  2537.  
  2538. -----------------------------
  2539. E.37        Problems with chr
  2540. -----------------------------
  2541. "6.6.6.3 For chr(x), the function returns a result of char-type that is
  2542. the value whose ordinal number is equal to the value of the expression x
  2543. if such a character value exists. It is an error if such a character value
  2544. does not exist."
  2545.  
  2546. This error is reported.
  2547.  
  2548. ------------------------------
  2549. E.38        Problems with succ
  2550. ------------------------------
  2551. "6.6.6.4 For succ(x), the function yields a value whose ordinal number is
  2552. one greater than that of x, if such a value exists. It is an error if such
  2553. a value does not exist."
  2554.  
  2555. This error is reported if range checking is enabled.
  2556. See also the "r" compiler option and the '$R' compiler directive.
  2557.  
  2558. ------------------------------
  2559. E.39        Problems with pred
  2560. ------------------------------
  2561. "6.6.6.4 For pred(x), the function yields a value whose ordinal number
  2562. is one less than that of x, if such a value exists. It is an error if such
  2563. a value does not exist."
  2564.  
  2565. This error is reported if range checking is enabled.
  2566. See also the "r" compiler option and the '$R' compiler directive.
  2567.  
  2568. ----------------------------------------
  2569. E.40        Using eof on undefined files
  2570. ----------------------------------------
  2571. "6.6.6.5 When eof(f) is activated, it is an error if f is undefined."
  2572.  
  2573. This error is reported if I/O checking is enabled.
  2574. See the "i" compiler option and the '$I' compiler directive.
  2575.  
  2576. -----------------------------------------
  2577. E.41        Using eoln on undefined files
  2578. -----------------------------------------
  2579. "6.6.6.5 When eoln(f) is activated, it is an error if f is undefined."
  2580.  
  2581. This error is reported if I/O checking is enabled.
  2582. See the "i" compiler option and the '$I' compiler directive.
  2583.  
  2584. -------------------------------------
  2585. E.42        Using eoln at end-of-file
  2586. -------------------------------------
  2587. "6.6.6.5 When eoln(f) is activated, it is an error if eof(f) is true."
  2588.  
  2589. This error is not reported.
  2590.  
  2591. -------------------------------------
  2592. E.43        Using undefined variables
  2593. -------------------------------------
  2594. "6.7.1 An expression denotes a value unless a variable denoted by a
  2595. variable-access contained by the expression is undefined at the time of
  2596. its use, in which case that use is an error."
  2597.  
  2598. In other words it is an error to use an undefined variable in an expression.
  2599.  
  2600. This error is reported only if checking for undefined values is enabled
  2601. and the variable's type is one of the supported types
  2602. (See the "u" compiler option and the "$U" compiler directive).
  2603.  
  2604. ----------------------------
  2605. E.44        Division by zero
  2606. ----------------------------
  2607. "6.7.2.2 A term of the form x/y is an error if y is zero."
  2608.  
  2609. In other words for real division, it is an error if the denominator is zero.
  2610.  
  2611. This error is reported.
  2612.  
  2613. ----------------------------
  2614. E.45        Division by zero
  2615. ----------------------------
  2616. "6.7.2.2 A term of the form i div j is an error if j is zero."
  2617.  
  2618. In other words for integer division, it is an error if the denominator is
  2619. zero.
  2620.  
  2621. This error is reported.
  2622.  
  2623. ---------------------------------------
  2624. E.46        Modulus of zero or negative
  2625. ---------------------------------------
  2626. "6.7.2.2 A term of the form i mod j is an error if j is zero or negative."
  2627.  
  2628. In other words for the modulus operation, it is an error if the right
  2629. operand is zero or negative."
  2630.  
  2631. This error is reported if the right operand is zero.
  2632. This error is not reported if the right operand is negative.
  2633.  
  2634. --------------------------------------
  2635. E.47        Integer overflow/underflow
  2636. --------------------------------------
  2637. "6.7.2.2 It is an error if an integer operation or function is not performed
  2638. according to the mathematical rules for integer arithmetic."
  2639.  
  2640. I think this means that it is an error if integer operations or functions
  2641. overflow or underflow. So for example
  2642.  
  2643.    maxint+maxint
  2644.  
  2645. should be an error since
  2646.  
  2647.    maxint = 2,147,486,647
  2648.  
  2649. but due to integer overflow
  2650.  
  2651.    maxint+maxint = -2
  2652.  
  2653.  
  2654. This error is not reported.
  2655.  
  2656. ---------------------------------------------------
  2657. E.48        Returning undefined value from function
  2658. ---------------------------------------------------
  2659. "6.7.3 It is an error if the result of an activation of a function is
  2660. undefined upon completion of the algorithm of the activation."
  2661.  
  2662. In other words it is an error if result of a function call is undefined.
  2663.  
  2664. This error is reported if checking for undefined values is enabled and
  2665. the type of the functions result is one of the supported types
  2666. (See the "u" compiler option and the "$U" compiler directive).
  2667.  
  2668. -------------------------------------------------
  2669. E.49        Assigning out of range ordinal values
  2670. -------------------------------------------------
  2671. "6.8.2.2 For an assignment-statement, it is an error if the expression is of
  2672. an ordinal-type whose value is not assignment-compatible with the type
  2673. possessed by the variable or function-identifier."
  2674.  
  2675. In other words it is an error to assign an out of range ordinal value
  2676. to a variable or a function result.
  2677.  
  2678. This error is reported if range checking is enabled.
  2679. See the "r" compiler option and the '$R' compiler directive.
  2680.  
  2681. ---------------------------------------------
  2682. E.50        Assigning out of range set values
  2683. ---------------------------------------------
  2684. "6.8.2.2 For an assignment-statement, it is an error if the expression is of
  2685. a set-type whose value is not assignment-compatible with the type
  2686. possessed by the variable."
  2687.  
  2688. In other words it is an error to assign an out of range set value
  2689. to a variable.
  2690. NOTE: The previous error said "... the variable or function-identifier"
  2691. but this one just says  "... the variable". Which seems to imply that it
  2692. is not an error to assign an out of range set value to a function result.
  2693. I don't see the point of allowing such assignments so this implementation
  2694. treats them as errors also and reports both types of assignments.
  2695.  
  2696. This error is reported if range checking is enabled.
  2697. See the "r" compiler option and the '$R' compiler directive.
  2698.  
  2699. -----------------------------------
  2700. E.51        Non-matching case index
  2701. -----------------------------------
  2702. "6.8.3.5 For a case-statement, it is an error if none of the case-constants
  2703. is equal to the value of the case-index upon entry to the case-statement."
  2704.  
  2705. NOTE: As an extension Irie Pascal supports the "otherwise" keyword which
  2706. matches the case-index if none of the case-constants match the case-index.
  2707. So technically in that situation this error is not reported.
  2708. (See the "E" compiler option).
  2709.  
  2710. This error is reported if the range of the case-index's type is less
  2711. than a certain implementation limit
  2712. (See "B.5 Range of case-index's type & Number of case-list-elements").
  2713.  
  2714. ------------------------------------------------
  2715. E.52        For loops initial value out of range
  2716. ------------------------------------------------
  2717. "6.8.3.9 For a for-statement, it is an error if the value of the
  2718. initial-value is not assignment-compatible with the type possessed by
  2719. the control-variable, if the statement of the for-statement is executed."
  2720.  
  2721. In other words it is an error if the initial value specified on a for
  2722. statement is not in the range specified by the type of the control variable
  2723. and the loop is started.
  2724. For example given:
  2725.  
  2726.    type num = 1..100;
  2727.    var n : num;
  2728.  
  2729. then the following are errors:
  2730.  
  2731.    for n := 0 to 100 do writeln(n);
  2732. or
  2733.    for n := 101 downto 1 do writeln(n);
  2734.  
  2735. But the following are not errors since the for loops are never started
  2736. (and therefore no assignments are made to "n").
  2737.  
  2738.    for n := 101 to 1 do writeln(n);
  2739. or
  2740.    for n := 0 downto 100 do writeln(n);
  2741.  
  2742. This error is reported if range checking is enabled.
  2743. See the "r" compiler option and the '$R' compiler directive.
  2744.  
  2745. ----------------------------------------------
  2746. E.53        For loops final value out of range
  2747. ----------------------------------------------
  2748. "6.8.3.9 For a for-statement, it is an error if the value of the
  2749. final-value is not assignment-compatible with the type possessed by
  2750. the control-variable, if the statement of the for-statement is executed."
  2751.  
  2752. In other words it is an error if the final value specified on a for
  2753. statement is not in the range specified by the type of the control variable
  2754. and the loop is started.
  2755. For example given:
  2756.  
  2757.    type num = 1..100;
  2758.    var n : num;
  2759.  
  2760. then the following are errors:
  2761.  
  2762.    for n := 1 to 101 do writeln(n);
  2763. or
  2764.    for n := 100 downto 0 do writeln(n);
  2765.  
  2766. But the following are not errors since the for loops are never started
  2767. (and therefore no assignments are made to "n").
  2768.  
  2769.    for n := 1 downto 101 do writeln(n);
  2770. or
  2771.    for n := 100 to 0 do writeln(n);
  2772.  
  2773.  
  2774. This error is reported if range checking is enabled.
  2775. See the "r" compiler option and the '$R' compiler directive.
  2776.  
  2777. ------------------------------------------
  2778. E.54        Reading invalid integer values
  2779. ------------------------------------------
  2780. "6.9.1 On reading an integer from a text file, after skipping preceding
  2781. spaces and end-of-lines, it is an error if the rest of the sequence does
  2782. not form a signed-integer."
  2783.  
  2784. In other words it is an error if the program attempts to read an integer
  2785. from a text file but the next characters to be read from the text file can
  2786. not form an integer.
  2787. For example if a text file contains the following "z" and you try
  2788. to read in an integer value from this file it is an error.
  2789.  
  2790. This error is reported if I/O checking is enabled.
  2791. See the "i" compiler option and the '$I' compiler directive.
  2792.  
  2793. -----------------------------------------------
  2794. E.55        Reading out of range integer values
  2795. -----------------------------------------------
  2796. "6.9.1 On reading an integer from a text file, it is an error if the value
  2797. of the signed-integer read is not assignment-compatible with the type
  2798. possessed by the variable-access."
  2799.  
  2800. This error is reported if range checking is enabled.
  2801. See the "r" compiler option and the '$R' compiler directive.
  2802.  
  2803. ------------------------------------------
  2804. E.56        Reading invalid numeric values
  2805. ------------------------------------------
  2806. "6.9.1 On reading a number from a text file, after skipping preceding spaces
  2807. and end-of-lines, it is an error if the rest of the sequence does not form
  2808. a signed-number."
  2809.  
  2810. In other words it is an error if the program attempts to read an integer
  2811. or a real from a text file but the next characters to be read from the
  2812. text file can not form an integer or real.
  2813. For example if a text file contains the following "z" and you try
  2814. to read in an integer or real value from this file it is an error.
  2815.  
  2816. This error is reported if I/O checking is enabled.
  2817. See the "i" compiler option and the '$I' compiler directive.
  2818.  
  2819. -----------------------------------------
  2820. E.57        Reading when file is not open
  2821. -----------------------------------------
  2822. "6.9.1 It is an error if the buffer-variable is undefined immediately prior
  2823. to any use of read."
  2824.  
  2825. The only way I can see this happening is if the file is not open or has
  2826. been opened for writing. In both cases reading from such a file will
  2827. cause an error to be reported if I/O checking is enabled.
  2828.  
  2829. See the "i" compiler option and the '$I' compiler directive.
  2830.  
  2831. ---------------------------------------------------------------
  2832. E.58        Writing with TotalWidth or FracDigits less than one
  2833. ---------------------------------------------------------------
  2834. "6.9.3.1 On writing to a textfile, the values of TotalWidth and FracDigits
  2835. are greater than equal to one; it is an error if either value is less
  2836. than one."
  2837.  
  2838. In other words if you have
  2839.  
  2840.    write(100:w)
  2841. or
  2842.    write(100.23:w:f)
  2843.  
  2844. it is an error if "w" or "f" is less than one.
  2845.  
  2846. This error is reported if range checking is enabled.
  2847. See the "r" compiler option and the '$R' compiler directive.
  2848.  
  2849. --------------------------------------------
  2850. E.59        Problems with program-parameters
  2851. --------------------------------------------
  2852. "6.10 The execution of any action, operation, defined to operate on a
  2853. variable, is an error if the variable is a program-parameter and, as a
  2854. result of the binding of the program-parameter, the execution cannot be
  2855. completed as defined."
  2856.  
  2857. The bindings of program-parameters used by Irie Pascal are so simple that
  2858. this error can not occur.
  2859.  
  2860. -------------------------------------------
  2861. E.60        Problems with conformant arrays
  2862. -------------------------------------------
  2863. "6.6.3.8 For a conformant array, it is an error if the smallest or largest
  2864. value specified by the index-type of the actual-parameter lies outside
  2865. the closed interval specified by the index-type-specification of the
  2866. conformant-array-schema."
  2867.  
  2868. Irie Pascal does not support conformant arrays so this error can not occur.
  2869.  
  2870. ---------------------------
  2871. Appendix F. I/O error codes
  2872. ---------------------------
  2873. The following I/O error codes may be returned from various I/O operations.
  2874. If I/O checking is enabled (the default situation) then the compiler
  2875. generates code to automatically check I/O operation for errors and
  2876. report any errors detected.
  2877.  
  2878. If you want more control on how errors are handled you can disable
  2879. I/O checking either globally using the "i" compiler option or
  2880. locally using the '$I' compiler directive and then use the function
  2881. IOResult to check the result of I/O operations.
  2882.  
  2883. Value   Error Code             Cause
  2884.   0      NoErrors              I/O operation completed successfully
  2885.   1      FileEraseFailure      Attempt to erase a file failed
  2886.   2      FileRenameFailure     Attempt to rename a file failed
  2887.   3      FileIsUndefined       Attempt to operate on an undefined file
  2888.   4      FileIsOpen            Using assign, erase, or rename on an open file
  2889.   5      FileIsNotOpen         Attempt to perform I/O on a closed file
  2890.   6      FileModeUndefined     THIS SHOULD NEVER OCCUR
  2891.   7      FileNameTooLong       Attempt to give a file a name too long
  2892.   8      FileNameNotDefined    Attempt to erase or rename a file with no name
  2893.   9      FilePosFailure        Attempt to use pos on a file failed
  2894.  10      FileSeekFailure       Attempt to use seek on a file failed
  2895.  11      NotOutputFile         Attempt to write to a file not open for writing
  2896.  12      UnexpectedEOF         Attempt to read past end-of-file
  2897.  13      WriteFailure          Attempt to write to file failed
  2898.  14      WidthTooLarge         Attempt to write a field too wide
  2899.  15      NotInputFile          Attempt to read from a file not open for reading
  2900.  16      ReadFailure           Attempt to read from file failed
  2901.  17      ClosingFailure        Attempt to close a file failed
  2902.  18      OpeningFailure        Attempt to open a file failed
  2903.  19      FileBufferIsEmpty     Attempt to use put and the file-buffer is empty
  2904.  20      ChDirFailure          Attempt to change directory failed
  2905.  21      FileExpandFailure     Attempt to use "fexpand" failed
  2906.  22      FileSplitFailure      Attempt to use "fsplit" failed
  2907.  23      FileSizeFailure       Attempt to obtain size of file failed
  2908.  24      FileOpenDirFailure    Attempt to open directory failed
  2909.  25      FileReadDirFailure    Attempt to read directory entry failed
  2910.  26      DirectoryIsUndefined  Attempt to access directory variable failed
  2911.  27      FileCloseDirFailure   Attempt to close directory failed
  2912.  28      FileRewindDirFailure  Attempt to rewind directory failed
  2913.  29      FileMkDirFailure      Attempt to create directory failed
  2914.  30      FileRmDirFailure      Attempt to remove directory failed
  2915.  31      FileGetDateFailure    Attempt to get the date a file was last modified failed
  2916.  32      FileGetModeFailure    Attempt to get the "mode" of a file failed
  2917.  33      FileGetTimeFailure    Attempt to get the time a file was last modified failed
  2918.  34      FileSetDateFailure    Attempt to set the date a file was last modified failed
  2919.  35      FileSetTimeFailure    Attempt to set the time a file was last modified failed
  2920.  36      FileRawReadFailure    Attempt to use "rawread" failed
  2921.  37      FileRawWriteFailure   Attempt to use "rawwrite" failed
  2922.  
  2923. END
  2924.