home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pgraph2.zip / PGRAPH2.DOC < prev    next >
Text File  |  1996-11-24  |  22KB  |  581 lines

  1.  
  2.                           ===================
  3.                              P G R A P H 2
  4.                           ===================
  5.  
  6.         documentation of fast full screen graphic library for OS/2
  7.  
  8.  
  9.  
  10. CONTENTS:
  11. =========
  12.  
  13.   I.  Introduction
  14.  II.  Input/output modes of VGA card
  15. III.  Using of the "Pixel" mode
  16.  IV.  Tools for the text output
  17.   V.  Animation Tools
  18.  VI.  Description of types used in the library PGRAPH2
  19. VII.  Description of procedures and functions
  20. VIII. Table of types
  21.  
  22.  
  23.  
  24. I. Introduction
  25. ^^^^^^^^^^^^^^^
  26. PGRAPH2.DLL contains set of basic graphic functions and procedures for
  27. fast graphic output. Library was created by Virtual Pascal compiler
  28. (from fPRINT UK Limited) using C language calling convention - therefore
  29. library can be used by "nonpascal" programmers.
  30. Graphic output is realized directly through EGA/VGA ports and uses
  31. several standard input/output modes for VGA card (640x480x16). Drawing of
  32. basic graphic elements is realized by direct access to the video memory
  33. (in DOS starting at address $A000:$0000).
  34.  
  35. PGRAPH2.DLL was created according to the following concept:
  36. 1) To achieve as high speed of graphic output, as possible - at the cost
  37.    of less universal graphic tools.
  38. 2) To create necessary graphic tools for "science" and "technical" purposes -
  39.    - not for games and so on.
  40. 3) To create necessary tools for text input/output under VGA graphic mode.
  41.  
  42.  
  43. II. Input/output modes of VGA card
  44. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  45. Input/output mode of VGA can be adjusted by setting of certain values at
  46. VGA ports. PGRAPH2.DLL uses the following modes:
  47.  
  48.  1) "Putpixel" mode, that is realized by procedure PutPixel. This procedure
  49.     is very slow - at each time, the x coordinate, y coordinate and color
  50.     of pixel must be specified.
  51.  
  52.  2) "Pixel" mode, that is switched by procedures PixelMode_On and
  53.     PixelMode_Off. When "Pixel" mode is switched on, a pixel at the screen
  54.     can be drawn (in the previously selected foreground color and writemode)
  55.     by direct access to the video memory. This process is fast and it is used
  56.     for lines drawing.
  57.  
  58.  3) "Line" mode, that is switched by procedures LineMode_On and LineMode_Off.
  59.     In this mode, eight pixels (one byte) can be drawn at once by direct
  60.     access to the video memory - position corresponding to "one" in the byte
  61.     is drawn by the foreground color, position corresponding to "zero" in the
  62.     byte is drawn by the background color. This process is the fastest and
  63.     is used for filling and text drawing.
  64.  
  65.  
  66. III. Using of the "Pixel" mode
  67. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  68. "Pixel" mode is supposed for the following procedures:
  69.  
  70.  Pixel                 - pixel
  71.  Vline                 - vertical line
  72.  Hline                 - horizontal line
  73.  Line                  - line
  74.  LineTo                - line from current position
  75.  Sym0                  - centered small rectangle
  76.  CesLText              - scalable line text
  77.  
  78. Procedures Pixel and Sym0 must use the following programming scheme:
  79. ...
  80.  <SetColor(f);>                   - set foreground color
  81.  <SetWriteMode(w);>               - set write mode (AND, XOR, ...)
  82.  PixelMode_On;                    - switch "Pixel" mode on
  83.  <set of Pixel or Sym0 calling>   - draw pixels or symbols
  84.  PixelMode_Off;                   - switch "Pixel" mode off
  85. ...
  86.  
  87. For other procedures, the following scheme is recommended:
  88. ...
  89.  <SetColor(f);>                   - set foreground color
  90.  <SetWriteMode(w);>               - set write mode (AND, XOR, ...)
  91.  pxm:=false;                      - switch off internal "Pixel" mode switching
  92.  PixelMode_On;                    - switch "Pixel" mode on
  93.  <set of procedure(s) calling>    - draw lines or text
  94.  PixelMode_Off;                   - switch "Pixel" mode off
  95.  pxm:=true;                       - switch on internal "Pixel" mode switching
  96. ...
  97. It is faster, than the following scheme:
  98. ...
  99.  <SetColor(f);>                   - set foreground color
  100.  <SetWriteMode(w);>               - set write mode (AND, XOR, ...)
  101.  <set of procedure(s) calling>    - draw lines or text
  102. ...
  103.  
  104. Recommended scheme minimizes accessing of VGA ports - it is important
  105. especially for multitasking operating systems.
  106.  
  107. In the "Pixel" mode, calling of the SetColor and SetWriteMode procedures
  108. must be followed by calling of the PixelMode_On procedure to take effect.
  109.  
  110. The "Pixel" mode is only mode, that accepts the effect of the SetWriteMode
  111. procedure.
  112.  
  113.  
  114. IV. Tools for the text output
  115. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  116. PGRAPH2 contains procedures such as GotoXYG, WriteG, WriteGn and ClrEolG,
  117. which enables to simulate text output in like manner, as Pascal's CRT unit
  118. does.
  119. There are functions GetWHX and GetWHY, which return current coordinates of
  120. cursor during text output. GetWHX and GetWHY have similar function as
  121. a WHEREX and WHEREY in the CRT unit of Turbo/Borland Pascal. This type of
  122. text output uses fonts of various height (14,16 and 24 pixels) and constant
  123. width (8 pixels). Fonts are constructed by the same way as a standard VGA
  124. (EGA) text fonts.
  125.  
  126.  
  127. V. Animation Tools
  128. ^^^^^^^^^^^^^^^^^^
  129. There is simple animation tool in the library PGRAPH2 based on saving and
  130. restoring certain background area. Procedure GetArea saves rectangular
  131. area of background and procedure PutArea restores it. Amount of memory
  132. needed for saving computes function AreaSize.
  133.  
  134. Rectangular area is automatically byte aligned in the x direction
  135. to speed up saving and restoring process.
  136.  
  137. Animation should be programmed according to the following scheme:
  138.  
  139. ...
  140. i:=0;
  141. save area 0;
  142. draw animated picture at area 0;
  143. repeat
  144.  restore area i;
  145.  save area i+1;
  146.  draw animated picture at area i+1;
  147.  i:=i+1;
  148. until end condition;
  149. ...
  150.  
  151. Using of the animation tools is demonstrated in the last screen of
  152. DEMOPG.EXE.
  153.  
  154.  
  155. VI. Description of types used in the library PGRAPH2
  156. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  157. There are only two special types used in the library PGRAPH2:
  158.  
  159. ■ S127 = string[127] ... string type used in certain procedures (see
  160.                          'Description of procedures and functions').
  161.                          This type uses 'Pascal' string, that means,
  162.                          string is zero-based array of characters
  163.                          starting at element with index one and element
  164.                          with index zero contains length of string.
  165.  
  166. ■ POINTTYPE = record x,y:integer end ... type of graphic point used in the
  167.                                          FillPolygon procedure.
  168.  
  169.  
  170. VII. Description of procedures and functions
  171. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  172.  
  173. This section describes procedures and functions available in the library
  174. PGRAPH2. Procedures and functions compatible with Borland Pascal GRAPH unit
  175. are marked by *.
  176.  
  177. ■ function KeyPressed:boolean;
  178. ------------------------------
  179. Returns true, if any key on the keyboard was pressed. Otherwise returns
  180. false.
  181.  
  182. ■ function ReadKey:char;
  183. ------------------------
  184. Returns ASCII code of pressed key on the keyboard. If functional key is
  185. pressed (Alt+K, F1, Shift+F2, ....), the ReadKey returns 0 and next
  186. calling of the ReadKey returns non zero code.
  187.  
  188. ■ PlaySound(Freq, duration:longint);
  189. ------------------------------------
  190. Plays sound using internal speaker. Duration is time in milliseconds.
  191.  
  192. ■ procedure SetLIWI(LiWi:byte);
  193. -------------------------------
  194. Sets width of lines, value of LiWi has to be in the range <1,2,3>.
  195. Affects lines drawn by Line, HLine, Vline, LineTo, Rectangle, Triangle,
  196. Ellipse and CesLText.
  197. Default value: LIWI = 1.
  198.  
  199. ■ procedure SetDOT(Dot:boolean);
  200. --------------------------------
  201. If Dot is true, lines are drawn as a dotted lines.
  202. Affects lines drawn by Line, HLine, Vline, LineTo, Rectangle, Triangle,
  203. Ellipse and CesLText.
  204. Default value: DOT = false.
  205.  
  206. ■ procedure SetPXM(PXM:boolean);
  207. --------------------------------
  208. If PXM is false, internal "Pixel" mode switching in certain procedures
  209. is switched off - see section 'Using of the "Pixel" mode' above.
  210. Default value: PXM = true.
  211.  
  212. ■ procedure SetRST(RST:word);
  213. -----------------------------
  214. RST contains raster definition for figure filling. Filling is performed
  215. in the "Line" mode using horizontal lines - upper and lower bytes of the RST
  216. are exchanged before each new horizontal line output.
  217. In the DEMOPG.EXE, the RST is set to $AA55.
  218. Default value: RST = $FFFF.
  219.  
  220. ■ function GetWHX:byte;
  221. -----------------------
  222. Returns x coordinate of text cursor in the range 1 <= WHX <= 80.
  223. The same function, as a WHEREX in the standard Pascal's unit CRT.
  224. Default value: WHX = 1
  225.  
  226. ■ function GetWHY:byte;
  227. -----------------------
  228. Returns y coordinate of text cursor in the range 1 <= WHX <= NTEXTROW.
  229. The same function, as a WHEREY in the standard Pascal's unit CRT.
  230. Default value: WHY = 1
  231.  
  232. ■ function GetTEXTROW:byte;
  233. ---------------------------
  234. Returns maximal text rows, which can be used with respect to the text size.
  235. See description of GrafFont procedure below.
  236.  
  237. ■ function GetCRX:integer;
  238. --------------------------
  239. Returns x coordinate CRX of the cross used in the MoveCross procedure in the
  240. range 0 <= CRX <= 639.
  241. Default value: CRX = 320
  242.  
  243. ■ function GetCRY:integer;
  244. --------------------------
  245. Returns y coordinate CRY of the cross used in the MoveCross procedure in the
  246. range 0 <= CRY <= 479.
  247. Default value: CRY = 240
  248.  
  249. ■ procedure SetCRS(CRS:byte);
  250. -----------------------------
  251. Sets speed of cross moving used in the MoveCross procedure in the range
  252. 1 <= CRS <= 5.
  253. Default value: CRS = 2
  254.  
  255. ■ function GetFKL:boolean;
  256. --------------------------
  257. Returns value of variable FKL. This variable is used in the function Klic
  258. and indicates (if true), the function key (such as F1, Alt+P, Shift+F9, ...)
  259. was pressed.
  260.  
  261. ■ function GetShi:byte;
  262. -----------------------
  263. Returns value of variable SHI. This variable is used in the function Klic and
  264. indicates whether Shift, Ctrl or Alt key was pressed (see below).
  265.  
  266. ■ procedure SetINS(INS:byte);
  267. -----------------------------
  268. Sets value of variable INS to switch between insert mode (INS=1) and replace
  269. mode (INS=0). Used in the Editg procedure.
  270.  
  271. ■ function  Klic: char;
  272. -----------------------
  273.   Returns a key pressed on the keyboard.
  274.   Sets FKL variable to true, if functional key (F1, Alt+C, ...) was pressed.
  275.   Sets SHI variable to: 2 ... if Shift key was pressed
  276.                         4 ... if Ctrl  key was pressed
  277.                         8 ... if Alt   key was pressed
  278.  
  279. ■ procedure Editg(x1,x2,y:byte; var st:s127);
  280. ---------------------------------------------
  281.   Enables to edit string at row y, in the column range x1,x2.
  282.   Intended for graph mode and uses graphic cursor (see description
  283.   of Cursor procedure below).
  284.   1 <= x1 < x2 <= 80,  1 <= y <= NTEXTROW
  285.  
  286. ■ procedure Num(x,y:byte; var n; t:char; k,l:integer);
  287. ------------------------------------------------------
  288.   Enables to edit and enter number, starting at text position x,y
  289.   n is untyped variable containing number
  290.   t is type of n: "b" ... byte         "s" ... single
  291.                   "i" ... integer      "r" ... real
  292.                   "w" ... word         "d" ... double
  293.                   "l" ... longint      "e" ... extended
  294.                   "h" ... shortint
  295.   k is total number of digits
  296.   l is number of decimal digits
  297.  
  298. ■ procedure WriteNum(var n; t:char; k,l:integer);
  299. -------------------------------------------------
  300.   Enables to write number at text position WHX,WHY
  301.   n is untyped variable containing number
  302.   t is type of n: "b" ... byte         "s" ... single
  303.                   "i" ... integer      "r" ... real
  304.                   "w" ... word         "d" ... double
  305.                   "l" ... longint      "e" ... extended
  306.                   "h" ... shortint
  307.   k is total number of digits
  308.   l is number of decimal digits
  309.  
  310. ■ function GraphInit(s:s127):integer;
  311. ------------------------------
  312.   Initializes standard VGA graph mode (640x480x16).
  313.   s is path to the directory containing font files (CSA14.FNT, CSA16.FNT,
  314.   CSA24.FNT, ZNC0 and ZNC1).
  315.   Returns error code as an integer value:
  316.    0 ... Without error
  317.    1 ... Wrong path to the font files
  318.    2 ... Cannot access video screen selector
  319.    3 ... VGA display required
  320.  
  321. ■ procedure Lock_On;
  322. --------------------
  323.   Disables to press task switching keys. Unfortunately, system OS/2 hangs
  324.   for 30 seconds, if task switching key is pressed.
  325.  
  326. ■ procedure Lock_Off;
  327. ---------------------
  328.   Enables to press task switching keys - default. Task switching keys may
  329.   be pressed only if there is no graphic output (that is, VGA ports are
  330.   not accessed), otherwise system OS/2 hangs.
  331.  
  332. ■ function SetGraphMode:integer;
  333. --------------------------------
  334.   Restores graph mode from text mode.
  335.   Returns error code as an integer value:
  336.    0 ... Without error
  337.    3 ... VGA display required
  338.  
  339. ■ procedure RestoreCrtMode;
  340. ---------------------------
  341. * Switches to the text mode.
  342.  
  343. ■ procedure ClearDevice;
  344. ------------------------
  345. * Clears graphic screen (fills screen with background color).
  346.  
  347. ■ procedure SetColor(color:word);
  348. ---------------------------------
  349. * Sets foreground color in range <0,15>.
  350.  
  351. ■ procedure BackColor(color:word);
  352. ----------------------------------
  353.   Sets background color in range <0,15>.
  354.  
  355. ■ procedure FBC(fcolor,bcolor:word);
  356. ------------------------------------
  357.   Sets foreground and background color.
  358.  
  359. ■ function  GetColor:word;
  360. --------------------------
  361. * Returns current foreground color.
  362.  
  363. ■ procedure SetWriteMode(mode:integer);
  364. ---------------------------------------
  365. * Sets mode for drawing in the "Pixel" mode.
  366.   0 = NormalPut, 1 = XORPut, ....
  367.  
  368. ■ procedure SetRGBPalette(color,red,green,blue:integer);
  369. --------------------------------------------------------
  370. * Sets RGB values (in range <0,63>) for specified color (in range <0,15>).
  371.  
  372. ■ function  GetPixel(x,y:integer):word;
  373. ---------------------------------------
  374. * Returns pixel color at specified coordinates x,y.
  375.  
  376. ■ procedure PutPixel(x,y:integer; color:word);
  377. ---------------------------------------------
  378. * Draws a pixel with specified color at specified coordinates x,y.
  379.  
  380. ■ procedure Pixel(x,y:integer);
  381. -------------------------------
  382.   Draws a pixel with color specified by SetColor procedure at specified
  383.   coordinates x,y. Much faster, than PutPixel.
  384.   Accepts setting of SetWriteMode and foreground color.
  385.   Must be in the "Pixel" mode.
  386.  
  387. ■ procedure PixelMode_On;
  388. -------------------------
  389.   Switches on "Pixel" mode. See 'Using of the "Pixel" mode' above.
  390.  
  391. ■ procedure PixelMode_Off;
  392. --------------------------
  393.   Switches off "Pixel" mode. See 'Using of the "Pixel" mode' above.
  394.  
  395. ■ procedure LineMode_On;
  396. ------------------------
  397.   Switches on "Line" mode. See 'Input/output modes of VGA card' above.
  398.  
  399. ■ procedure LineMode_Off;
  400. -------------------------
  401.   Switches off "Line" mode. See 'Input/output modes of VGA card' above.
  402.  
  403. ■ procedure Vline(x,y1,y2:integer);
  404. -----------------------------------
  405.   Draws a vertical line. Accepts setting of LIWI, DOT, SetWriteMode
  406.   and foreground color.
  407.  
  408. ■ procedure Hline(x1,x2,y:integer);
  409. -----------------------------------
  410.   Draws a horizontal line. Accepts setting of LIWI, DOT, SetWriteMode
  411.   and foreground color.
  412.  
  413. ■ procedure Line(x1,y1,x2,y2:integer);
  414. --------------------------------------
  415. * Draws a line. Accepts setting of LIWI, DOT, SetWriteMode and foreground
  416.   color.
  417.  
  418. ■ procedure MoveTo(x,y:integer);
  419. --------------------------------
  420. * Moves current graphic pointer to coordinates x,y.
  421.  
  422. ■ procedure LineTo(x,y:integer);
  423. --------------------------------
  424. * Draws a line from the current pointer to coordinates x,y.
  425.   Accepts setting of LIWI, DOT, SetWriteMode and foreground color.
  426.  
  427. ■ procedure Sym0(x,y:integer);
  428. ------------------------------
  429.   Draws a little square centered at coordinates x,y.
  430.   Accepts SetWriteMode and foreground color.
  431.   Must be in the "Pixel" mode.
  432.  
  433. ■ procedure Rectangle(x1,y1,x2,y2:integer);
  434. -------------------------------------------
  435. * Draws a rectangle - x1,y1 are coordinates of the upper left corner,
  436.   x2,y2 are coordinates of the lower right corner.
  437.   Accepts setting of LIWI, DOT, SetWriteMode and foreground color.
  438.  
  439. ■ procedure FillRectangle(x1,y1,x2,y2:integer);
  440. -----------------------------------------------
  441.   Fills a rectangle - x1,y1 are coordinates of the upper left corner,
  442.   x2,y2 are coordinates of the lower right corner.
  443.   Accepts setting of RST variable, foreground and background color.
  444.  
  445. ■ procedure Triangle(x1,y1,x2,y2,x3,y3:integer);
  446. ------------------------------------------------
  447.   Draws a triangle - x1,y1, x2,x3 and x3,y3 are coordinates of corners.
  448.   Accepts setting of LIWI, DOT, SetWriteMode and foreground color.
  449.  
  450. ■ procedure FillTriangle(p1,q1,p2,q2,p3,q3:integer);
  451. ----------------------------------------------------
  452.   Fills a triangle - x1,y1, x2,x3 and x3,y3 are coordinates of corners.
  453.   Accepts setting of RST variable, foreground and background color.
  454.  
  455. ■ procedure Ellipse(xc,yc:integer; xrad,yrad:integer);
  456. ------------------------------------------------------
  457.   Draws an ellipse - xc,yc is the center point; xrad,yrad are radii.
  458.   Accepts setting of LIWI, DOT, SetWriteMode and foreground color.
  459.  
  460. ■ procedure FillEllipse(xc,yc:integer; xrad,yrad:integer);
  461. ----------------------------------------------------------
  462.   Fills an ellipse - xc,yc is the center point; xrad,yrad are radii.
  463.   Accepts setting of RST variable, foreground and background color.
  464.  
  465. ■ procedure FillPolygon(n: integer; var p);
  466. -------------------------------------------
  467.   Fills a polygon - p is array of POINTTYPE (vertices of polygon) and
  468.   n is number of vertices. The last vertex must be equal to the first.
  469.   Accepts setting of RST variable, foreground and background color.
  470.  
  471. ■ function  AreaSize(x1,y1,x2,y2:integer):longint;
  472. --------------------------------------------------
  473.   Returns amount of the memory needed for saving rectangular area
  474.   by GetArea procedure.
  475.   You must ensure, that 0 <= x1 < x2 <= 639 and 0 <= y1 < y2 <= 479.
  476.  
  477. ■ procedure GetArea(x1,y1,x2,y2:integer; var b);
  478. ------------------------------------------------
  479.   Saves rectangular area of graphic screen into buffer b. Size of
  480.   the buffer would be specified by the AreaSize function. Similar
  481.   to the GetImage procedure in Borland Pascal GRAPH unit, but
  482.   x-range of the area is automatically byte aligned (from speed reasons).
  483.   You must ensure, that 0 <= x1 < x2 <= 639 and 0 <= y1 < y2 <= 479.
  484.  
  485. ■ procedure PutArea(x1,y1:integer; var b);
  486. ------------------------------------------
  487.   Restores rectangular graphic area contained in the buffer b.
  488.   Similar to the PutImage procedure in Borland Pascal GRAPH unit, but
  489.   x-range of the area is automatically byte aligned (from speed reasons).
  490.  
  491. ■ procedure MoveCross(ch:char; fkl:boolean);
  492. --------------------------------------------------
  493.   Draws and moves a little cross around the screen using arrow keys
  494.   and SetWriteMode(1). Keys 1,2,3,4 and 5 can be used to change movement
  495.   speed. Calling MoveCross(0,false) should be used for the first drawing
  496.   of the cross or for it's disappearance.
  497.  
  498. ■ procedure GrafFont(r:byte);
  499. -----------------------------
  500.   Reads font for WriteG, WriteGn and CesTextC procedures. Size of
  501.   the font is  8 x r, where r (font height) is 14,16 or 24.
  502.  
  503. ■ procedure CesTextC(x,y:integer; s:s127; d:boolean);
  504. -----------------------------------------------------
  505.   Draws text using PutPixel procedure. If d is true, the text is
  506.   written horizontally, otherwise the text is written vertically.
  507.   Accepts foreground and background color.
  508.  
  509. ■ procedure ClrEolG;
  510. --------------------
  511.   Clears text from the current position of WHX,WHY to the end of line.
  512.   The same function as a ClrEol in the standard Pascal text mode.
  513.  
  514. ■ procedure GotoXYG(x,y:byte);
  515. ------------------------------
  516.   Sets position of WHX,WHY to the coordinates x,y in the range
  517.   1 <= x <= 80, 1 <= y <= NTEXTROW.
  518.  
  519. ■ procedure WriteG(s:s127);
  520. ---------------------------
  521.   Draws string s at current position WHX,WHY. Very fast, uses "Line" mode.
  522.   Accepts foreground and background color.
  523.  
  524. ■ procedure WriteGn(s:s127);
  525. ----------------------------
  526.   Draws string s at current position WHX,WHY and skips to the first column
  527.   of the next row. Very fast, uses "Line" mode.
  528.   Accepts foreground and background color.
  529.  
  530. ■ procedure LineFont(l:byte);
  531. -----------------------------
  532.   Reads scalable line font for CesLText procedure.
  533.   l is size of font in the range <0,1>.
  534.  
  535. ■ procedure CesLText(x,y:integer; s:s127; zv:single; d:boolean);
  536. ----------------------------------------------------------------
  537.   Draws string s starting at coordinates x,y using line font -
  538.   zv is scale (using whole numbers is recommended) and
  539.   d is direction (true - horizontal drawing, false - vertical drawing).
  540.   Accepts setting of LIWI, DOT, SetWriteMode and foreground color.
  541.  
  542.  
  543. VIII. Table of types
  544. ^^^^^^^^^^^^^^^^^^^^
  545. Following table should be helpful for "nonpascal" programmers.
  546.  
  547.  
  548. 1) Ordinal types
  549. ----------------
  550.  
  551.   Pascal   │
  552.   type     │     format      │            range
  553.   ═════════╪═════════════════╪══════════════════════════
  554.   boolean  │ unsigned  8-bit │    1 (true) or 0 (false)
  555.   byte     │ unsigned  8-bit │           0 .. 255
  556.   shortint │ signed    8-bit │        -128 .. 127
  557.   word     │ unsigned 16-bit │           0 .. 65535
  558.   integer  │ signed   16-bit │      -32768 .. 32767
  559.   longint  │ signed   32-bit │ -2147483648 .. 2147483647
  560.  
  561.  
  562. 2) Real types
  563. -------------
  564.  
  565.   Pascal   │
  566.   type     │        Range        │ Digits │ Bytes
  567.   ═════════╪═════════════════════╪════════╪══════
  568.   real     │   2.9e-39..1.7e38   │ 11-12  │   6
  569.   single   │   1.5e-45..3.4e38   │  7-8   │   4
  570.   double   │  5.0e-324..1.7e308  │ 15-16  │   8
  571.   extended │ 3.4e-4932..1.1e4932 │ 19-20  │  10
  572.   comp     │   -9.2e18..9.2e18   │ 19-20  │   8
  573.  
  574.  
  575.  
  576.  
  577.  
  578.                                   --
  579.                      --  End of document file  --
  580.                                   --
  581.