home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / turbopas / pascal.tzt / PASCAL.TXT
Encoding:
Text File  |  1987-11-06  |  25.4 KB  |  1,041 lines

  1.      Thi≤ documen⌠ i≤ ß quicδ referancσ  oµ al∞ oµ thσ standarΣ function≤ ì
  2. anΣ procedure≤ containeΣ iε thσ programinτ envirnmen⌠ Turb∩ Pascal«  The∙ ì
  3. arσ groupeΣ b∙ typσ oµ operatioε (eg.- Strinτ procedure≤, Filσ procedures.).
  4.  
  5.  
  6.     Reserved Words
  7.  
  8.    * absolute     * external       nil          * shr
  9.      and            file           not          * string
  10.      array          for            of             then
  11.      begin          forward        or             to
  12.      case           function       packed         type
  13.      const          goto           procedure      until
  14.      div            if             program        var
  15.      do             in             record         while
  16.      downto       * inline         repeat         with
  17.      else           label          set          * xor
  18.      end            mod          * shl
  19.  
  20. * - The asterisks indicate reserved words not defined in standard Pascal.
  21.  
  22.  
  23.     Standard Identifiers
  24.  
  25.      ArcTan         Delay          Ln             Rename
  26.      Assign         Delete         Lo             Reset
  27.      Aux            EOF            LowVideo       Rewrite
  28.      AuxInPtr       EOLN           Lst            Round
  29.      AuxOutPtr      Erase          LstOutPtr      Seek
  30.      BlockRead      Execute        Mark           Sin
  31.      BlockWrite     Exp            MaxInt         SizeOf
  32.      Boolean        False          Mem            Sqr
  33.      BufLen         FilePos        MemAvail       Sqrt
  34.      Byte           FileSize       Move           Str
  35.      Chain          FillChar       New            Succ
  36.      Char           Flush          NormVideo      Swap
  37.      Chr            Fract          Odd            Text
  38.      Close          GetMem         Ord            Trm 
  39.      ClrEOL         GotoXY         Output         True
  40.      ClrScr         HearPtr        Pi             Trunc
  41.      Con            Hi             Port           UpCase
  42.      ConInPtr       IOresult       Pos            Usr
  43.      ConOutPtr      Input          Pred           UsrInPtr
  44.      Concat         InsLine        Ptr            UsrOutPtr
  45.      ConstPtr       Insert         Random         Val
  46.      Copy           Int            Randomize      Write
  47.      Cos            Integer        Read           Writeln
  48.      CrtExit        Kbd            Readln
  49.      CrtInit        KeyPressed     Real
  50.      DelLine        Length         Release
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.                                                        Page 1.
  62.  
  63.  
  64.  
  65.  
  66.  
  67. è          String Procedures
  68.  
  69.  
  70.      Delete
  71. ____________________________________________________________________________
  72. Syntax: Delete( St, Pos, Num )
  73.  
  74. Deletσ remove≤ ß substrinτ containinτ 'Numº character≤ froφ 'Stº startinτ a⌠ ì
  75. positioε 'Pos'«  'Stº i≤ ß strinτ variablσ anΣ botΦ 'Posº anΣ 'Numº arσ ì
  76. intege≥ expressions«  Iµ 'Posº i≤ greate≥ theε 'Length¿ S⌠ )'¼ n∩ character≤ ì
  77. arσ removed«  Iµ aε attemp⌠ i≤ madσ t∩ deletσ character≤ beyonΣ thσ enΣ oµ ì
  78. thσ strinτ (i.e« 'Posº ½ 'Numº exceed≤ thσ lengtΦ oµ thσ string)¼ onl∙ ì
  79. character≤ withiε thσ strinτ arσ deleted«  Iµ 'Posº i≤ outsidσ thσ rangσ ì
  80. 1..255 a run time error occurs.
  81.  
  82.  
  83.      Insert
  84. ____________________________________________________________________________
  85. Syntax: Insert( Obj, Target, Pos )
  86.  
  87. Inser⌠ insert≤ thσ strinτ 'Objº int∩ thσ strinτ 'Targetº a⌠ thσ positioε ì
  88. 'Pos'«  'Objº i≤ ß strinτ expression¼ 'Targetº i≤ ß strinτ variable¼ anΣ ì
  89. 'Posº i≤ aε intege≥ expression«  Iµ 'Posº i≤ greate≥ thaε 'Length¿ Targe⌠ ì
  90. )'¼ theε 'Objº i≤ concatenateΣ t∩ 'Target'«  Iµ theε resul⌠ i≤ longe≥ thaε ì
  91. thσ maximuφ lengtΦ oµ 'Target'¼ theε exces≤ character≤ wil∞ bσ truncateΣ anΣ ì
  92. 'Targetº wil∞ onl∙ contaiε thσ left-mos⌠ characters«  Iµ 'Posº i≤ outsidσ ì
  93. the range 1..255, a run time error occurs.
  94.  
  95.  
  96.      Str
  97. ____________________________________________________________________________
  98. Syntax: Str( Value, St )
  99.  
  100. Thσ St≥ procedurσ convert≤ thσ numeriπ valuσ oµ 'Valueº int∩ ß strinτ anΣ ì
  101. store≤ thσ resul⌠ iε 'St'«  'Valueº i≤ ß writσ paramete≥ oµ typσ intege≥ o≥ ì
  102. of type real.
  103.  
  104.  
  105.  
  106.      Val
  107. ____________________________________________________________________________
  108. Syntax: Val( St, Var, Code )
  109.  
  110. Va∞ convert≤ thσ strinτ expressioε 'Stº t∩ aε intege≥ o≥ ß rea∞ valuσ ì
  111. (dependinτ oε thσ typσ oµ thσ variablσ 'Var'⌐ anΣ store≤ thi≤ valuσ iε ì
  112. 'Var'«  'Stº mus⌠ bσ ß strinτ expressinτ ß numeriπ valuσ accordinτ t∩ thσ ì
  113. rule≤ applyinτ t∩ numeriπ constants«  Neithe≥ leadinτ o≥ trailinτ space≤ arσ ì
  114. allowed«  'Varº mus⌠ bσ aε Intege≥ o≥ ß Rea∞ variablσ anΣ 'Codeº mus⌠ bσ aε ì
  115. intege≥ variable«  Iµ n∩ error≤ arσ detected¼ thσ variablσ 'Codeº i≤ se⌠ t∩ ì
  116. zer∩ (0)«  Otherwisσ 'Codeº i≤ se⌠ t∩ thσ positioε oµ thσ firs⌠ characte≥ iε ì
  117. error, and the value of 'Var' is undefined.
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.                                                        Page 2.
  128.  
  129.  
  130.  
  131.  
  132.  
  133. è          String Functions
  134.  
  135.  
  136.      Copy
  137. ____________________________________________________________________________
  138. Syntax: Copy( St, Pos, Num )
  139.  
  140. Cop∙ return≤ ß substrinτ containinτ 'Numº character≤ froφ 'Stº startinτ a⌠ ì
  141. positioε 'Pos'«  'Stº i≤ ß strinτ expressioε anΣ botΦ 'Posº anΣ 'Numº arσ ì
  142. intege≥ expressions«  Iµ 'Posº exceed≤ thσ lengtΦ oµ thσ string¼ thσ empt∙ ì
  143. strinτ i≤ returned«  Iµ aε attemp⌠ i≤ madσ t∩ ge⌠ character≤ beyonΣ thσ enΣ ì
  144. oµ thσ strinτ (i.e« 'Posº ½ 'Numº exceed≤ thσ lengtΦ oµ thσ string)¼ onl∙ ì
  145. thσ character≤ withiε thσ strinτ arσ returned«  Iµ 'Posº i≤ outsidσ thσ ì
  146. range 1..255, a run time error occurs.
  147.  
  148.  
  149.  
  150.      Concat
  151. ____________________________________________________________________________
  152. Syntax: Concat( St1, St2 {,StN} )
  153.  
  154. Thσ Conca⌠ functioε return≤ ß strinτ whicΦ i≤ thσ concatenatioε oµ it≤ ì
  155. argument≤ iε thσ orde≥ iε whicΦ the∙ arσ specified«  Thσ argument≤ ma∙ bσ ì
  156. an∙ numbe≥ oµ strinτ expression≤ separateΣ b∙ comma≤ (St1,St▓ .« StN)«  Iµ ì
  157. the length of the result is greater than 255, a run time error occurs.  
  158.  
  159. Note║ Thσ '+º operato≥ caε bσ useΣ t∩ obtaiε thσ samσ result¼ ofteε morσ ì
  160. conveniently«  Conca⌠ i≤ includeΣ onl∙ t∩ maintaiε compatibilit∙ witΦ othe≥ ì
  161. Pascal compilers.
  162.  
  163.  
  164.  
  165.      Length
  166. ____________________________________________________________________________
  167. Syntax: Length( St )
  168.  
  169. Thσ LengtΦ functioε return≤ thσ lengtΦ oµ thσ strinτ expressioε 'St'¼ i.e« ì
  170. the number of characters in 'St'.  The type of the result is integer.
  171.  
  172.  
  173.  
  174.      Pos
  175. ____________________________________________________________________________
  176. Syntax: Pos( Obj, Target )
  177.  
  178. Thσ Po≤ functioε scan≤ thσ strinτ 'Targetº t∩ finΣ thσ firs⌠ occurancσ oµ ì
  179. 'Objº withiε 'Target'«  'Objº anΣ 'Targetº arσ strinτ expressions¼ anΣ thσ ì
  180. typσ oµ thσ resul⌠ i≤ integer«  Thσ resul⌠ i≤ aε intege≥ denotinτ thσ ì
  181. positioε withiε 'Targetº oµ thσ firs⌠ characte≥ oµ thσ matcheΣ pattern«  Thσ ì
  182. positioε oµ thσ firs⌠ characte≥ iε ß strinτ i≤ 1«  Iµ thσ paterε i≤ no⌠ ì
  183. found, 'Pos' returns zero (0).
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.                                                        Page 3.
  194.  
  195.  
  196.  
  197.  
  198.  
  199. è          Operations on Files
  200.  
  201.  
  202.      Assign
  203. ____________________________________________________________________________
  204. Syntax: Assign( FilVar, Str )
  205.  
  206. 'Strº i≤ ß strinτ expressioε yieldinτ an∙ lega∞ filσ name«  Thi≤ filσ namσ ì
  207. i≤ assigneΣ t∩ thσ filσ variablσ 'FilVar'¼ anΣ al∞ furthe≥ operation≤ oε ì
  208. 'FilVarº wil∞ operatσ oε thσ disδ filσ 'Str'«  Assigε shoulΣ neve≥ bσ useΣ ì
  209. on a file which is in use.
  210.  
  211.  
  212.  
  213.      Rewrite
  214. ____________________________________________________________________________
  215. Syntax: Rewrite( FilVar )
  216.  
  217. ┴ ne≈ disδ filσ oµ thσ namσ assigneΣ t∩ thσ filσ variablσ 'FilVarº i≤ ì
  218. createΣ anΣ prepareΣ fo≥ processing¼ anΣ thσ filσ pointe≥ i≤ se⌠ t∩ thσ ì
  219. beginninτ oµ thσ file¼ i.e« componen⌠ numbe≥ zer∩ (0)«  An∙ previousl∙ ì
  220. existinτ filσ witΦ thσ samσ namσ i≤ erased«  ┴ disδ filσ createΣ b∙ rewritσ ì
  221. is initially empty, i.e. it contains no elements.
  222.  
  223.  
  224.  
  225.      Reset
  226. ____________________________________________________________________________
  227. Syntax: Reset( FilVar )
  228.  
  229. Thσ disδ filσ oµ thσ namσ assigneΣ t∩ thσ filσ variablσ 'FilVarº i≤ prepareΣ ì
  230. fo≥ processing¼ anΣ thσ filσ pointe≥ i≤ se⌠ t∩ thσ beginninτ oµ thσ file¼ ì
  231. i.e« componen⌠ numbe≥ zer∩ (0)«  'FilVarº mus⌠ namσ aε existinτ file¼ ì
  232. otherwise an I/O error occurs.
  233.  
  234.  
  235.  
  236.      Read
  237. ____________________________________________________________________________
  238. Syntax: Read( FilVar, Var )
  239.  
  240. 'Varº denote≤ onσ o≥ morσ variable≤ oµ thσ componen⌠ typσ oµ 'FilVar'¼ ì
  241. separateΣ b∙ commas«  EacΦ variablσ i≤ reaΣ froφ thσ disδ file¼ anΣ ì
  242. followinτ eacΦ reaΣ operation¼ thσ filσ pointe≥ i≤ advanceΣ t∩ thσ nex⌠ ì
  243. component.
  244.  
  245.  
  246.  
  247.      Write
  248. ____________________________________________________________________________
  249. Syntax: Write( FilVar, Var )
  250.  
  251. 'Varº denote≤ onσ o≥ morσ variable≤ oµ thσ componen⌠ typσ oµ 'FilVar'¼ ì
  252. separateΣ b∙ commas«  EacΦ variablσ i≤ writteε t∩ thσ disδ file¼ anΣ ì
  253. followinτ eacΦ writσ operation¼ thσ filσ pointe≥ i≤ advanceΣ t∩ thσ nex⌠ ì
  254. component.
  255.  
  256.  
  257.  
  258.  
  259.                                                        Page 4.
  260.  
  261.  
  262.  
  263.  
  264.  
  265. è     Seek
  266. ____________________________________________________________________________
  267. Syntax: Seek( FilVar, n )
  268.  
  269. Seeδ move≤ thσ filσ pointe≥ t∩ thσ n'tΦ componen⌠ oµ thσ filσ denoteΣ b∙ ì
  270. 'FilVar'« 'nº i≤ aε intege≥ expression«  Thσ positioε oµ thσ firs⌠ componen⌠ ì
  271. i≤ zer∩ (0)«  Notσ tha⌠ iε orde≥ t∩ expanΣ ß filσ i⌠ i≤ possiblσ t∩ seeδ onσ ì
  272. component beyond the last component.  The statement
  273.  
  274.      Seek( FilVar, FileSize( FilVar) );
  275.  
  276. will place the file pointer at the end of the file.
  277.  
  278.  
  279.  
  280.      Flush
  281. ____________________________________________________________________________
  282. Syntax: Flush( FilVar )
  283.  
  284. FlusΦ emptie≤ thσ interna∞ secto≥ buffe≥ oµ thσ disδ filσ 'FilVar'¼ anΣ thu≤ ì
  285. assure≤ tha⌠ thσ secto≥ buffe≥ i≤ writteε t∩ thσ disδ iµ an∙ writσ ì
  286. operation≤ havσ occureΣ sincσ thσ las⌠ disδ update«  FlusΦ als∩ insureΣ tha⌠ ì
  287. thσ nex⌠ reaΣ operatioε wil∞ actuall∙ perforφ ß physica∞ reaΣ froφ thσ disδ ì
  288. file.  Flush should never be used on a closed file.
  289.  
  290.  
  291.  
  292.      Close
  293. ____________________________________________________________________________
  294. Syntax: Close( FilVar )
  295.  
  296. Thσ disδ filσ associateΣ witΦ 'FilVarº i≤ closed¼ anΣ thσ disδ director∙ i≤ ì
  297. updated to reflect the new status of the file.
  298.  
  299.  
  300.  
  301.      Erase
  302. ____________________________________________________________________________
  303. Syntax: Erase( FilVar )
  304.  
  305. Thσ disδ filσ associateΣ witΦ 'FilVarº i≤ erased«  Iµ thσ filσ i≤ open¼ i⌠ ì
  306. should be closed before Erase is performed.
  307.  
  308.  
  309.  
  310.      Rename
  311. ____________________________________________________________________________
  312. Syntax: Rename( FilVar, Str )
  313.  
  314. Thσ disδ filσ associateΣ witΦ 'FilVarº i≤ renameΣ t∩ ß ne≈ namσ giveε b∙ thσ ì
  315. strinτ expressioε 'Str'«  Thσ disδ director∙ i≤ updateΣ t∩ sho≈ thσ ne≈ namσ ì
  316. oµ thσ file¼ anΣ furthe≥ operation≤ oε 'FilVarº wil∞ operatσ oε thσ filσ ì
  317. with the new name.  Rename should not be used on an open file.
  318.  
  319. Note║  I⌠ i≤ thσ programmer'≤ responsibilit∙ t∩ makσ surσ thσ ne≈ filσ namσ ì
  320. doe≤ no⌠ allread∙ exis⌠ oε thσ disk¼ otherwisσ multiplσ occurance≤ oµ thσ ì
  321. file name will occur.
  322.  
  323.  
  324.  
  325.                                                        Page 5.
  326.  
  327.  
  328.  
  329.  
  330.  
  331. è          Standard File Functions
  332.  
  333.  
  334.      EOF
  335. ____________________________________________________________________________
  336. Syntax: EOF( FilVar )
  337.  
  338. ┴ Booleaε functioε whicΦ return≤ Truσ iµ thσ filσ pointe≥ i≤ positioneΣ a⌠ ì
  339. thσ enΣ oµ thσ disδ file¼ i.e« beyonΣ thσ las⌠ componen⌠ oµ thσ file«  Iµ ì
  340. not, EOF returns False.
  341.  
  342.  
  343.  
  344.      FilePos
  345. ____________________________________________________________________________
  346. Syntax: FilePos( FilVar )
  347.  
  348. Aε intege≥ functioε whicΦ return≤ thσ curren⌠ positioε oµ thσ filσ pointer«  ì
  349. The first component of a file is zero (0).
  350.  
  351.  
  352.  
  353.      FileSize
  354. ____________________________________________________________________________
  355. Syntax: FileSize( FilVar )
  356.  
  357. Aε intege≥ functioε whicΦ return≤ thσ sizσ oµ thσ disδ filσ expresseΣ a≤ thσ ì
  358. numbe≥ oµ component≤ iε thσ file«  Iµ FileSize¿ FilVa≥ ⌐ i≤ zero¼ thσ filσ ì
  359. is empty.
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.                                                        Page 6.
  392.  
  393.  
  394.  
  395.  
  396.  
  397. è          Standard Procedures
  398.  
  399.  
  400.      ClrEol
  401. ____________________________________________________________________________
  402. Syntax: ClrEol
  403.  
  404. Clear≤ al∞ character≤ froφ thσ curso≥ positioε t∩ thσ enΣ oµ thσ linσ ì
  405. without moving the cursor.
  406.  
  407.  
  408.  
  409.      ClrScr
  410. ____________________________________________________________________________
  411. Syntax: ClrScr
  412.  
  413. Clears the screen and places the cursor in the upper left-hand corner.  
  414. Notσ tha⌠ somσ system≤ ma∙ als∩ rese⌠ thσ video-attribute≤ wheε clearinτ thσ ì
  415. screen.
  416.  
  417.  
  418.  
  419.      CrtInit
  420. ____________________________________________________________________________
  421. Syntax: CrtInit
  422.  
  423. Send≤ thσ Termina∞ Initializatioε Strinτ defineΣ iε thσ installatioε ì
  424. procedure for the screen.
  425.  
  426.  
  427.  
  428.      CrtExit
  429. ____________________________________________________________________________
  430. Syntax: CrtExit
  431.  
  432. Send≤ thσ Termina∞ Rese⌠ Strinτ a≤ defineΣ iε thσ installatioε procedurσ fo≥ ì
  433. the screen.
  434.  
  435.  
  436.  
  437.      Delay
  438. ____________________________________________________________________________
  439. Syntax: Delay( Time )
  440.  
  441. Thσ Dela∙ procedurσ create≤ ß loo≡ whicΦ ruε fo≥ approx« a≤ man∙ milli-ì
  442. second≤ a≤ defineΣ b∙ it≤ argumen⌠ 'Timeº whicΦ mus⌠ bσ aε integer«  Thσ ì
  443. exact delay will vary somewhat with different operating systems.
  444.  
  445.  
  446.  
  447.      DelLine
  448. ____________________________________________________________________________
  449. Syntax: DelLine
  450.  
  451. Delete≤ thσ linσ containinτ thσ curso≥ anΣ move≤ al∞ thσ line≤ belo≈ thσ ì
  452. cursor up by one line.
  453.  
  454.  
  455.  
  456.  
  457.                                                        Page 7.
  458.  
  459.  
  460.  
  461.  
  462.  
  463. è     InsLine
  464. ____________________________________________________________________________
  465. Syntax: InsLine
  466.  
  467. Insert≤ aε empt∙ linσ a⌠ thσ curso≥ position«  Al∞ line≤ belo≈ thσ curso≥ ì
  468. are moved down one line and the bottom line scrolls off the screen.
  469.  
  470.  
  471.  
  472.      GotoXY
  473. ____________________________________________________________________________
  474. Syntax: GotoXY( Xpos, Ypos )
  475.  
  476. Move≤ thσ curso≥ t∩ thσ positioε oε thσ screeε specifieΣ b∙ thσ intege≥ ì
  477. expression≤ 'Xposº (horizonta∞ valuσ o≥ row⌐ anΣ 'Yposº (vertica∞ valuσ o≥ ì
  478. column).  The upper left corner (home position) is ( 1, 1 ).
  479.  
  480.  
  481.  
  482.      LowVideo
  483. ____________________________________________________________________________
  484. Syntax: LowVideo
  485.  
  486. Se⌠ thσ screeε t∩ thσ vide∩ attributσ defineΣ a≤ 'Star⌠ oµ Lo≈ Videoº iε thσ ì
  487. installation procedure.
  488.  
  489.  
  490.  
  491.      NormVideo
  492. ____________________________________________________________________________
  493. Syntax: NormVideo
  494.  
  495. Set≤ thσ screeε t∩ thσ vide∩ attributσ defineΣ a≤ 'Star⌠ oµ Norma∞ Videoº iε ì
  496. the installation procedure.
  497.  
  498.  
  499.  
  500.      Randomize
  501. ____________________________________________________________________________
  502. Syntax: Randomize
  503.  
  504. Initializes the random number generator with a random value.
  505.  
  506.  
  507.  
  508.      Move
  509. ____________________________________________________________________________
  510. Syntax: Move( Var1, Var2, Num )
  511.  
  512. Doe≤ ß mas≤ cop∙ directl∙ iε memor∙ oµ ß specifieΣ numbe≥ oµ bytes«  'Var1º ì
  513. anΣ 'Var2º arσ tw∩ variable≤ oµ an∙ type¼ anΣ 'Numº i≤ aε intege≥ ì
  514. expression«  Thσ procedurσ copie≤ ß blocδ oµ 'Numº bytes¼ startinτ a⌠ thσ ì
  515. firs⌠ bytσ occupieΣ b∙ 'Var1º t∩ thσ blocδ startinτ a⌠ thσ firs⌠ bytσ ì
  516. occupied by 'Var2'.  Move automatically handles overlap situations.
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.                                                        Page 8.
  524.  
  525.  
  526.  
  527.  
  528.  
  529. è     FillChar
  530. ____________________________________________________________________________
  531. Syntax: FillChar( Var, Num, Value )
  532.  
  533. Fill≤ ß rangσ oµ memor∙ witΦ ß giveε value«  'Varº i≤ ß variablσ oµ an∙ ì
  534. type¼ 'Numº i≤ aε intege≥ expression¼ anΣ 'Valueº i≤ aε expressioε oµ Bytσ ì
  535. o≥ Char«  'Numº bytes¼ startinτ a⌠ thσ firs⌠ bytσ occupieΣ b∙ 'Var'¼ arσ ì
  536. filled with the value 'Value'.
  537.  
  538.  
  539.  
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.                                                        Page 9.
  590.  
  591.  
  592.  
  593.  
  594.  
  595. è          Arithmetic Functions
  596.  
  597.  
  598.      Abs
  599. ____________________________________________________________________________
  600. Syntax: Abs( Num )
  601.  
  602. Return≤ thσ absolutσ valuσ oµ 'Num'«  Thσ argumen⌠ 'Numº mus⌠ bσ eithe≥ Rea∞ ì
  603. or Integer, and the result is of the same type as the argument.
  604.  
  605.  
  606.  
  607.      ArcTan
  608. ____________________________________________________________________________
  609. Syntax: ArcTan( Num )
  610.  
  611. Return≤ thσ angle¼ iε radians¼ whosσ tangen⌠ i≤ 'Num'«  Thσ argumen⌠ mus⌠ bσ ì
  612. either Real or Integer, and the result is Real.
  613.  
  614.  
  615.  
  616.      Cos
  617. ____________________________________________________________________________
  618. Syntax: Cos( Num )
  619.  
  620. Return≤ thσ cosinσ oµ 'Num'«  Thσ argumen⌠ 'Numº i≤ expresseΣ iε radians¼ ì
  621. and its type must be either Real or Integer.  The result is of type Real.
  622.  
  623.  
  624.  
  625.      Exp
  626. ____________________________________________________________________________
  627. Syntax: Exp( Num )
  628.  
  629. Return≤ thσ exponentia∞ oµ 'Numº t∩ basσ e«  Thσ argumen⌠ 'Numº mus⌠ bσ ì
  630. either Real or Integer, and the result is Real.
  631.  
  632.  
  633.  
  634.      Frac
  635. ____________________________________________________________________________
  636. Syntax: Frac( Num )
  637.  
  638. Return≤ thσ fractiona∞ par⌠ oµ 'Num'«  Thσ argumen⌠ 'Numº mus⌠ bσ eithe≥ ì
  639. Real or Integer, and the result is Real.
  640.  
  641.  
  642.  
  643.      Int
  644. ____________________________________________________________________________
  645. Syntax: Int( Num )
  646.  
  647. Return≤ thσ intege≥ par⌠ oµ 'Num'«  Thσ argumen⌠ 'Numº mus⌠ bσ eithe≥ Rea∞ ì
  648. or Integer, and the result is real.
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.                                                        Page 10.
  656.  
  657.  
  658.  
  659.  
  660.  
  661. è     Ln
  662. ____________________________________________________________________________
  663. Syntax: Ln( Num )
  664.  
  665. Return≤ thσ natura∞ logarithφ oµ 'Num'«  Thσ argumen⌠ 'Numº mus⌠ bσ eithe≥ ì
  666. Real or Integer, and the result is Real.
  667.  
  668.  
  669.  
  670.      Sin
  671. ____________________________________________________________________________
  672. Syntax: Sin( Num )
  673.  
  674. Return≤ thσ sinσ oµ 'Num'«  Thσ argumen⌠ 'Numº i≤ expresseΣ iε radians¼ anΣ ì
  675. its type must be either Real or Integer.  The result is of type Real.
  676.  
  677.  
  678.  
  679.      Sqr
  680. ____________________________________________________________________________
  681. Syntax: Sqr( Num )
  682.  
  683. Return≤ thσ squarσ oµ 'Num'«  Thσ argumen⌠ mus⌠ bσ eithe≥ Rea∞ o≥ Integer¼ ì
  684. and the result is of the same type as the argument.
  685.  
  686.  
  687.  
  688.      Sqrt
  689. ____________________________________________________________________________
  690. Syntax: Sqrt( Num )
  691.  
  692. Return≤ thσ squarσ roo⌠ oµ 'Num'«  Thσ argumen⌠ 'Numº mus⌠ bσ eithe≥ Rea∞ o≥ ì
  693. Integer, and the result is of type Real.
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.                                                        Page 11.
  722.  
  723.  
  724.  
  725.  
  726.  
  727. è          Scalar Functions
  728.  
  729.  
  730.      Pred
  731. ____________________________________________________________________________
  732. Syntax: Pred( Num )
  733.  
  734. Return≤ thσ predecesso≥ oµ 'Numº (iµ i⌠ exists)«  'Numº i≤ oµ an∙ scala≥ ì
  735. type.
  736.  
  737.  
  738.  
  739.      Succ
  740. ____________________________________________________________________________
  741. Syntax: Succ( Num )
  742.  
  743. Returns the successor of 'Num' (if it exists).  'Num' is of any scalar type.
  744.  
  745.  
  746.  
  747.      Odd
  748. ____________________________________________________________________________
  749. Syntax: Odd( Num )
  750.  
  751. Return≤ booleaε Truσ iµ 'Numº i≤ aε odΣ number¼ anΣ Falsσ iµ 'Numº i≤ even«  ì
  752. 'Num' must be of type Integer.
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.                                                        Page 12.
  788.  
  789.  
  790.  
  791.  
  792.  
  793. è          Transfer Functions
  794.  
  795.  
  796.      Chr
  797. ____________________________________________________________________________
  798. Syntax: Chr( Num )
  799.  
  800. Return≤ thσ characte≥ witΦ thσ ordina∞ valuσ giveε b∙ thσ intege≥ expressioε ì
  801. 'Num'.  Example: Chr(65) returns the character 'A'.
  802.  
  803.  
  804.  
  805.      Ord
  806. ____________________________________________________________________________
  807. Syntax: Ord( Var )
  808.  
  809. Return≤ thσ ordina∞ numbe≥ oµ thσ valuσ 'Varº iε thσ se⌠ defineΣ defineΣ b∙ ì
  810. thσ typσ 'Var'«  Ord¿ Va≥ ⌐ i≤ equivalen⌠ t∩ Integer¿ Va≥ )«  'Varº ma∙ bσ ì
  811. of any scaral type, except Real, and the result is of the type Integer.
  812.  
  813.  
  814.  
  815.      Round
  816. ____________________________________________________________________________
  817. Syntax: Round( Num )
  818.  
  819. Returns the value of 'Num' rounded to the nearest integer as follows:
  820.      if Num>=0, then Round( Num ) = Trunc( Num + 0.5 ), and
  821.      if Num<0, then Round( Num ) = Trunc( Num - 0.5 ).
  822. 'Num' must be of type Real, and the result is of type Integer.
  823.  
  824.  
  825.  
  826.      Trunc
  827. ____________________________________________________________________________
  828. Syntax: Trunc( Num )
  829.  
  830. Return≤ thσ greates⌠ intege≥ les≤ thaε o≥ equa∞ t∩ 'Num'¼ o≥ thσ smalles⌠ ì
  831. intege≥ greate≥ thaε o≥ equa∞ t∩ 'Num'¼ iµ Num<0«  'Numº mus⌠ bσ oµ typσ ì
  832. Real, and the result is of the type Integer.
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844.  
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.  
  852.  
  853.                                                        Page 13.
  854.  
  855.  
  856.  
  857.  
  858.  
  859. è          Miscellaneous Standard Functions
  860.  
  861.  
  862.      Hi
  863. ____________________________________________________________________________
  864. Syntax: Hi( I )
  865.  
  866. Thσ lo≈ orde≥ bytσ oµ thσ resul⌠ contain≤ thσ higΦ orde≥ bytσ oµ thσ valuσ ì
  867. oµ thσ intege≥ expressioε 'I'«  Thσ higΦ orde≥ bytσ oµ thσ resul⌠ i≤ se⌠ t∩ ì
  868. zero.  The type of the result is Integer.
  869.  
  870.  
  871.  
  872.      KeyPressed
  873. ____________________________________________________________________________
  874. Syntax: KeyPressed
  875.  
  876. Return≤ booleaε Truσ iµ ß ke∙ ha≤ beeε presseΣ a⌠ thσ console¼ anΣ Falsσ iµ ì
  877. n∩ ke∙ ha≤ beeε pressed«  Thσ resul⌠ i≤ obtaineΣ b∙ callinτ thσ operatinτ ì
  878. system console status routine.
  879.  
  880.  
  881.  
  882.      Lo
  883. ____________________________________________________________________________
  884. Syntax: Lo( I )
  885.  
  886. Return≤ thσ lo≈ orde≥ bytσ oµ thσ valuσ oµ thσ intege≥ expressioε 'Iº witΦ ì
  887. the high order byte forced to zero.  The type of the result is Integer.
  888.  
  889.  
  890.  
  891.      Random
  892. ____________________________________________________________________________
  893. Syntax: Random
  894.  
  895. Return≤ ß randoφ numbe≥ greate≥ thaε o≥ equa∞ t∩ zer∩ anΣ les≤ thaε one«  ì
  896. The type is Real.
  897.  
  898.  
  899.  
  900.      Random( Num )
  901. ____________________________________________________________________________
  902. Syntax: Random( Num )
  903.  
  904. Return≤ ß randoφ numbe≥ greate≥ thaε o≥ equa∞ t∩ zer∩ anΣ les≤ thaε 'Num'«  ì
  905. 'Num' and the random number are both integers.
  906.  
  907.  
  908.  
  909.      SizeOf
  910. ____________________________________________________________________________
  911. Syntax: SizeOf( Name )
  912.  
  913. Return≤ thσ numbe≥ oµ byte≤ occupieΣ iε memor∙ b∙ thσ variablσ oµ typσ ì
  914. 'Name'.  The result is of type Integer.
  915.  
  916.  
  917.  
  918.  
  919.                                                        Page 14.
  920.  
  921.  
  922.  
  923.  
  924.  
  925. è     Swap
  926. ____________________________________________________________________________
  927. Syntax: Swap( Num )
  928.  
  929. Thσ Swa≡ functioε exchange≤ thσ higΦ anΣ lo≈ orde≥ byte≤ oµ it≤ intege≥ ì
  930. argument 'Num' and returns the resulting value as an integer.
  931.  
  932.  
  933.  
  934.      UpCase
  935. ____________________________________________________________________________
  936. Syntax: UpCase( Ch )
  937.  
  938. Return≤ thσ uppercasσ equivalen⌠ oµ it≤ argumen⌠ 'Chº whicΦ mus⌠ bσ oµ typσ ì
  939. Char«  Iµ n∩ uppercasσ equivalen⌠ exists¼ thσ argumen⌠ i≤ returneΣ ì
  940. unchanged.
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.                                                        Page 15.
  986.  
  987.  
  988.  
  989.  
  990.  
  991. è          CP/M-80 Specific Functions
  992.  
  993.  
  994.      Addr
  995. ____________________________________________________________________________
  996. Syntax: Addr( Name )
  997.  
  998. Return≤ thσ addres≤ iε memor∙ oµ thσ firs⌠ bytσ oµ thσ type¼ variable¼ ì
  999. procedure¼ o≥ functioε witΦ thσ identifie≥ 'Name'«  Iµ 'Nameº i≤ aε array¼ ì
  1000. i⌠ ma∙ bσ subscribed¼ anΣ iµ 'Nameº i≤ ß record¼ specifiπ field≤ ma∙ bσ ì
  1001. selected.  The value returned is of type Integer.
  1002.  
  1003.  
  1004.  
  1005.      Bdos procedure and function
  1006. ____________________________________________________________________________
  1007. Syntax: Bdos( Func {, Param } )
  1008.  
  1009. Thσ Bdo≤ procedurσ i≤ useΣ t∩ invokσ CP/═ BDO╙ routines«  'Funcº anΣ 'Paramº ì
  1010. arσ intege≥ expressions«  'Funcº denote≤ thσ numbe≥ oµ thσ calleΣ routinσ ì
  1011. anΣ i≤ loadeΣ int∩ thσ ├ register«  'Paramº i≤ optiona∞ anΣ denote≤ ß ì
  1012. paramete≥ whicΦ i≤ loadeΣ int∩ thσ D┼ registe≥ pair«  ┴ cal∞ t∩ addres≤ ╡ ì
  1013. then invokes the BDOS.
  1014.  
  1015. Thσ Bdo≤ functioε i≤ calleΣ likσ thσ procedurσ anΣ return≤ aε intege≥ resul⌠ ì
  1016. which is the value returned by the BDOS in the A register.
  1017.  
  1018.  
  1019.  
  1020.      BdosHL function
  1021. ____________________________________________________________________________
  1022. Syntax: BdosHL( Func {, Param } )
  1023.  
  1024. Thi≤ functioε i≤ exactl∙ likσ thσ Bdo≤ functioε above¼ excep⌠ tha⌠ thσ ì
  1025. result is the value returned in the HL register pair.
  1026.  
  1027.  
  1028.  
  1029.      Bios Procedure and Function
  1030. ____________________________________________________________________________
  1031. Syntax: Bios( Func {, Param } )
  1032.  
  1033. Thσ Bio≤ procedurσ i≤ useΣ t∩ invokσ BIO╙ routines« 'Funcº anΣ 'Paramº arσ ì
  1034. intege≥ expressions«  'Funcº denote≤ thσ numbe≥ oµ thσ calleΣ routine¼ witΦ ì
  1035. zer∩ (0⌐ meaninτ thσ WBOO╘ routine«  'Paramº i≤ optiona∞ anΣ denote≤ ß ì
  1036. parameter which is loaded into the BC register pair prior to the call.
  1037.  
  1038. Thσ Bio≤ functioε i≤ calleΣ likσ thσ procedurσ anΣ return≤ aε intege≥ resul⌠ ì
  1039. which is the value returned by the BIOS in the A register.
  1040.  
  1041.  
  1042.  
  1043.      BiosHL Function
  1044. ____________________________________________________________________________
  1045. Syntax: BiosHL( Func {, Param } )
  1046.  
  1047. Thi≤ functioε i≤ exactl∙ simila≥ t∩ thσ Bio≤ functioε abovσ excep⌠ tha⌠ thσ ì
  1048. result is the value returned in the HL register pair.
  1049.  
  1050.  
  1051.                                                        Page 16.
  1052.  
  1053.  
  1054.  
  1055.  
  1056.  
  1057. è