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