home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPMHELP / TURBOPAS.HLP < prev    next >
Text File  |  2000-06-30  |  5KB  |  113 lines

  1. Turbo Pascal Common Compiler Directives (standard?)
  2. B Directive for input/output mode selection
  3. C Directive for control character interpretation during console I/O
  4. I Directive for I/O error handling 
  5. R Directive for run-time index checks
  6. V Directive controls type checking on strings passed as var
  7. U Directive controls user interrupts
  8. X Directive controls array optimization
  9. A Directive controls generation of absolute non-recursive code
  10. W Directive controls level of nesting of With statements
  11. K Directive controls generation of stack check code
  12. :All compiler directives have default values.  These have been chosen
  13. to optimize execution speed and minimuze code size. This means that
  14. code generation for recursive procedures and index checking has been
  15. disabled.
  16. :
  17. B  defaults to B+
  18.  
  19. It controls i/o mode selection.  When active, {$B+}, the CON: 
  20. device is assigned to the standard files Input and Output.  When
  21. passive, {$B-}, the TRm: device is used.  This directive is global 
  22. to an entire program block and cannot be redefined throughout
  23. the program.
  24. :
  25. C  defaults to C+
  26.  
  27. It controls control character interpretation during console I/O.
  28. When active, {$C+}, a Ctl-C entered in response to a Read or Readln
  29. statement will interrupt program execution, and a Ctrl-S will 
  30. toggle screen output off and on.  When passive, etc., control 
  31. characters are not interpreted.  the active state slows screen 
  32. output somewhat, so if screen output speed is imperative, you 
  33. should switch off this directive.
  34. :
  35. I  defaults to I+
  36.  
  37. This controls I/O error handling.  When active all I/O operations 
  38. are checked for errors.  When passive, it is the responsibility 
  39. of the programmer to check I/O errors throughout the standard function
  40. I/O result.  The I directive succeeded by a file name instructs 
  41. the compiler to include the file with the specified name in the 
  42. compilation.  Include files are discussed in (chapter 17).
  43. :
  44. R  defaults to R-
  45.  
  46. It controls run-time index checks.  When active all array indexing 
  47. operations are checked to be within the defined bounds, and all 
  48. assignments to scalar and subrange variables are checked to be 
  49. within range.  When passive, no checks are performed, and index 
  50. errors may well cause a program to go haywire.  It is a good idea 
  51. to activate this directive while developing a program.  Once debugged,
  52. execution will be speeded up by setting it passive.
  53. :
  54. V  defaults to V+
  55.  
  56. This directive controls type checking on strings passed as var-parameters.
  57. When active strict type checking is performed, i.e., the lengths of
  58. actual and formal parameters must match.  When passive the compiler
  59. allows passing of actual parameters which do not match the length
  60. of the formal parameter.
  61. :
  62. U  defaults to U-
  63.  
  64. It controls user interrupts.  When active the user may interrupt 
  65. the program anytime during execution by entering a Ctrl-C.  When
  66. passive this has no effect.  Activating this directive will significantly
  67. slow down execution speed.
  68. :
  69. X  defaults to X+
  70.  
  71. This directive controls array optimization.  When active code 
  72. generation for arrays is optimized for maximum speed.  When passive 
  73. the compiler minimizes the code size instead.
  74. :
  75. CP/M-80 Compiler Directives (as opposed to CP/M-86 or MSDOS)
  76.  
  77. A  defaults to A+
  78.  
  79. This controls generation of absolute, non-recursive code.  When 
  80. active, absolute code is generated.  When passive the compiler 
  81. generates code which allows recursive calls.  This code requires 
  82. more memory and executes slower.
  83. :
  84. W  defaults to W2
  85.  
  86. This controls the level of nesting of With statements, i.e., the 
  87. number of records which may be "opened" within one block.  The 
  88. W must be immediately followed by a digit between 1 and 9.
  89. :
  90. CP/M-86 / MS-DOS directives
  91.  
  92. K  defaults to K+
  93.  
  94. It controls the generation of stack check code.  When active, 
  95. a check is made to insure that space is available for local variables 
  96. on the stack before each call to a subprogram.  When passive no 
  97. checks are made.
  98. :
  99. Other Turbo vs. Standard (Jensen & Wirth) PASCAL
  100.  
  101. Extensions offered by TURBO Pascal are not discussed.
  102.  
  103. Dynamic variables and pointers use the standard procedures, New, 
  104. Mark, and Release instead of the New and Dispose procedures.  
  105. Primarily this deviation from the standard is far more efficient 
  106. in terms of execution speed and required support code, and secondly 
  107. it offers compatibility with other popular Pascal compilers (UCSD).
  108.  
  109. The procedure New will not accept variant record specifications. 
  110. This restriction, however, is easily circumvented by using the 
  111. standard procedure GetMem.
  112.  
  113.