Thió documenô ió á quicë referancå oæ alì oæ thå standarä functionó � anä procedureó containeä iî thå programinç envirnmenô Turbï Pascal® Theù � arå groupeä bù typå oæ operatioî (eg.- Strinç procedureó, Filå procedures.). Reserved Words * absolute * external nil * shr and file not * string array for of then begin forward or to case function packed type const goto procedure until div if program var do in record while downto * inline repeat with else label set * xor end mod * shl * - The asterisks indicate reserved words not defined in standard Pascal. Standard Identifiers ArcTan Delay Ln Rename Assign Delete Lo Reset Aux EOF LowVideo Rewrite AuxInPtr EOLN Lst Round AuxOutPtr Erase LstOutPtr Seek BlockRead Execute Mark Sin BlockWrite Exp MaxInt SizeOf Boolean False Mem Sqr BufLen FilePos MemAvail Sqrt Byte FileSize Move Str Chain FillChar New Succ Char Flush NormVideo Swap Chr Fract Odd Text Close GetMem Ord Trm ClrEOL GotoXY Output True ClrScr HearPtr Pi Trunc Con Hi Port UpCase ConInPtr IOresult Pos Usr ConOutPtr Input Pred UsrInPtr Concat InsLine Ptr UsrOutPtr ConstPtr Insert Random Val Copy Int Randomize Write Cos Integer Read Writeln CrtExit Kbd Readln CrtInit KeyPressed Real DelLine Length Release Page 1. Š String Procedures Delete ____________________________________________________________________________ Syntax: Delete( St, Pos, Num ) Deletå removeó á substrinç containinç 'Num§ characteró froí 'St§ startinç aô � positioî 'Pos'® 'St§ ió á strinç variablå anä botè 'Pos§ anä 'Num§ arå � integeò expressions® Iæ 'Pos§ ió greateò theî 'Length¨ Sô )'¬ nï characteró � arå removed® Iæ aî attempô ió madå tï deletå characteró beyonä thå enä oæ � thå strinç (i.e® 'Pos§ « 'Num§ exceedó thå lengtè oæ thå string)¬ onlù � characteró withiî thå strinç arå deleted® Iæ 'Pos§ ió outsidå thå rangå � 1..255 a run time error occurs. Insert ____________________________________________________________________________ Syntax: Insert( Obj, Target, Pos ) Inserô insertó thå strinç 'Obj§ intï thå strinç 'Target§ aô thå positioî � 'Pos'® 'Obj§ ió á strinç expression¬ 'Target§ ió á strinç variable¬ anä � 'Pos§ ió aî integeò expression® Iæ 'Pos§ ió greateò thaî 'Length¨ Targeô � )'¬ theî 'Obj§ ió concatenateä tï 'Target'® Iæ theî resulô ió longeò thaî � thå maximuí lengtè oæ 'Target'¬ theî excesó characteró wilì bå truncateä anä � 'Target§ wilì onlù contaiî thå left-mosô characters® Iæ 'Pos§ ió outsidå � the range 1..255, a run time error occurs. Str ____________________________________________________________________________ Syntax: Str( Value, St ) Thå Stò procedurå convertó thå numeriã valuå oæ 'Value§ intï á strinç anä � storeó thå resulô iî 'St'® 'Value§ ió á writå parameteò oæ typå integeò oò � of type real. Val ____________________________________________________________________________ Syntax: Val( St, Var, Code ) Vaì convertó thå strinç expressioî 'St§ tï aî integeò oò á reaì valuå � (dependinç oî thå typå oæ thå variablå 'Var'© anä storeó thió valuå iî � 'Var'® 'St§ musô bå á strinç expressinç á numeriã valuå accordinç tï thå � ruleó applyinç tï numeriã constants® Neitheò leadinç oò trailinç spaceó arå � allowed® 'Var§ musô bå aî Integeò oò á Reaì variablå anä 'Code§ musô bå aî � integeò variable® Iæ nï erroró arå detected¬ thå variablå 'Code§ ió seô tï � zerï (0)® Otherwiså 'Code§ ió seô tï thå positioî oæ thå firsô characteò iî � error, and the value of 'Var' is undefined. Page 2. Š String Functions Copy ____________________________________________________________________________ Syntax: Copy( St, Pos, Num ) Copù returnó á substrinç containinç 'Num§ characteró froí 'St§ startinç aô � positioî 'Pos'® 'St§ ió á strinç expressioî anä botè 'Pos§ anä 'Num§ arå � integeò expressions® Iæ 'Pos§ exceedó thå lengtè oæ thå string¬ thå emptù � strinç ió returned® Iæ aî attempô ió madå tï geô characteró beyonä thå enä � oæ thå strinç (i.e® 'Pos§ « 'Num§ exceedó thå lengtè oæ thå string)¬ onlù � thå characteró withiî thå strinç arå returned® Iæ 'Pos§ ió outsidå thå � range 1..255, a run time error occurs. Concat ____________________________________________________________________________ Syntax: Concat( St1, St2 {,StN} ) Thå Concaô functioî returnó á strinç whicè ió thå concatenatioî oæ itó � argumentó iî thå ordeò iî whicè theù arå specified® Thå argumentó maù bå � anù numbeò oæ strinç expressionó separateä bù commaó (St1,St² .® StN)® Iæ � the length of the result is greater than 255, a run time error occurs. Noteº Thå '+§ operatoò caî bå useä tï obtaiî thå samå result¬ ofteî morå � conveniently® Concaô ió includeä onlù tï maintaiî compatibilitù witè otheò � Pascal compilers. Length ____________________________________________________________________________ Syntax: Length( St ) Thå Lengtè functioî returnó thå lengtè oæ thå strinç expressioî 'St'¬ i.e® � the number of characters in 'St'. The type of the result is integer. Pos ____________________________________________________________________________ Syntax: Pos( Obj, Target ) Thå Poó functioî scanó thå strinç 'Target§ tï finä thå firsô occurancå oæ � 'Obj§ withiî 'Target'® 'Obj§ anä 'Target§ arå strinç expressions¬ anä thå � typå oæ thå resulô ió integer® Thå resulô ió aî integeò denotinç thå � positioî withiî 'Target§ oæ thå firsô characteò oæ thå matcheä pattern® Thå � positioî oæ thå firsô characteò iî á strinç ió 1® Iæ thå paterî ió noô � found, 'Pos' returns zero (0). Page 3. Š Operations on Files Assign ____________________________________________________________________________ Syntax: Assign( FilVar, Str ) 'Str§ ió á strinç expressioî yieldinç anù legaì filå name® Thió filå namå � ió assigneä tï thå filå variablå 'FilVar'¬ anä alì furtheò operationó oî � 'FilVar§ wilì operatå oî thå disë filå 'Str'® Assigî shoulä neveò bå useä � on a file which is in use. Rewrite ____________________________________________________________________________ Syntax: Rewrite( FilVar ) Á ne÷ disë filå oæ thå namå assigneä tï thå filå variablå 'FilVar§ ió � createä anä prepareä foò processing¬ anä thå filå pointeò ió seô tï thå � beginninç oæ thå file¬ i.e® componenô numbeò zerï (0)® Anù previouslù � existinç filå witè thå samå namå ió erased® Á disë filå createä bù rewritå � is initially empty, i.e. it contains no elements. Reset ____________________________________________________________________________ Syntax: Reset( FilVar ) Thå disë filå oæ thå namå assigneä tï thå filå variablå 'FilVar§ ió prepareä � foò processing¬ anä thå filå pointeò ió seô tï thå beginninç oæ thå file¬ � i.e® componenô numbeò zerï (0)® 'FilVar§ musô namå aî existinç file¬ � otherwise an I/O error occurs. Read ____________________________________________________________________________ Syntax: Read( FilVar, Var ) 'Var§ denoteó onå oò morå variableó oæ thå componenô typå oæ 'FilVar'¬ � separateä bù commas® Eacè variablå ió reaä froí thå disë file¬ anä � followinç eacè reaä operation¬ thå filå pointeò ió advanceä tï thå nexô � component. Write ____________________________________________________________________________ Syntax: Write( FilVar, Var ) 'Var§ denoteó onå oò morå variableó oæ thå componenô typå oæ 'FilVar'¬ � separateä bù commas® Eacè variablå ió writteî tï thå disë file¬ anä � followinç eacè writå operation¬ thå filå pointeò ió advanceä tï thå nexô � component. Page 4. Š Seek ____________________________________________________________________________ Syntax: Seek( FilVar, n ) Seeë moveó thå filå pointeò tï thå n'tè componenô oæ thå filå denoteä bù � 'FilVar'® 'n§ ió aî integeò expression® Thå positioî oæ thå firsô componenô � ió zerï (0)® Notå thaô iî ordeò tï expanä á filå iô ió possiblå tï seeë onå � component beyond the last component. The statement Seek( FilVar, FileSize( FilVar) ); will place the file pointer at the end of the file. Flush ____________________________________________________________________________ Syntax: Flush( FilVar ) Flusè emptieó thå internaì sectoò buffeò oæ thå disë filå 'FilVar'¬ anä thuó � assureó thaô thå sectoò buffeò ió writteî tï thå disë iæ anù writå � operationó havå occureä sincå thå lasô disë update® Flusè alsï insureä thaô � thå nexô reaä operatioî wilì actuallù perforí á physicaì reaä froí thå disë � file. Flush should never be used on a closed file. Close ____________________________________________________________________________ Syntax: Close( FilVar ) Thå disë filå associateä witè 'FilVar§ ió closed¬ anä thå disë directorù ió � updated to reflect the new status of the file. Erase ____________________________________________________________________________ Syntax: Erase( FilVar ) Thå disë filå associateä witè 'FilVar§ ió erased® Iæ thå filå ió open¬ iô � should be closed before Erase is performed. Rename ____________________________________________________________________________ Syntax: Rename( FilVar, Str ) Thå disë filå associateä witè 'FilVar§ ió renameä tï á ne÷ namå giveî bù thå � strinç expressioî 'Str'® Thå disë directorù ió updateä tï sho÷ thå ne÷ namå � oæ thå file¬ anä furtheò operationó oî 'FilVar§ wilì operatå oî thå filå � with the new name. Rename should not be used on an open file. Noteº Iô ió thå programmer'ó responsibilitù tï makå surå thå ne÷ filå namå � doeó noô allreadù exisô oî thå disk¬ otherwiså multiplå occuranceó oæ thå � file name will occur. Page 5. Š Standard File Functions EOF ____________________________________________________________________________ Syntax: EOF( FilVar ) Á Booleaî functioî whicè returnó Truå iæ thå filå pointeò ió positioneä aô � thå enä oæ thå disë file¬ i.e® beyonä thå lasô componenô oæ thå file® Iæ � not, EOF returns False. FilePos ____________________________________________________________________________ Syntax: FilePos( FilVar ) Aî integeò functioî whicè returnó thå currenô positioî oæ thå filå pointer® � The first component of a file is zero (0). FileSize ____________________________________________________________________________ Syntax: FileSize( FilVar ) Aî integeò functioî whicè returnó thå sizå oæ thå disë filå expresseä aó thå � numbeò oæ componentó iî thå file® Iæ FileSize¨ FilVaò © ió zero¬ thå filå � is empty. Page 6. Š Standard Procedures ClrEol ____________________________________________________________________________ Syntax: ClrEol Clearó alì characteró froí thå cursoò positioî tï thå enä oæ thå linå � without moving the cursor. ClrScr ____________________________________________________________________________ Syntax: ClrScr Clears the screen and places the cursor in the upper left-hand corner. Notå thaô somå systemó maù alsï reseô thå video-attributeó wheî clearinç thå � screen. CrtInit ____________________________________________________________________________ Syntax: CrtInit Sendó thå Terminaì Initializatioî Strinç defineä iî thå installatioî � procedure for the screen. CrtExit ____________________________________________________________________________ Syntax: CrtExit Sendó thå Terminaì Reseô Strinç aó defineä iî thå installatioî procedurå foò � the screen. Delay ____________________________________________________________________________ Syntax: Delay( Time ) Thå Delaù procedurå createó á looð whicè ruî foò approx® aó manù milli-� secondó aó defineä bù itó argumenô 'Time§ whicè musô bå aî integer® Thå � exact delay will vary somewhat with different operating systems. DelLine ____________________________________________________________________________ Syntax: DelLine Deleteó thå linå containinç thå cursoò anä moveó alì thå lineó belo÷ thå � cursor up by one line. Page 7. Š InsLine ____________________________________________________________________________ Syntax: InsLine Insertó aî emptù linå aô thå cursoò position® Alì lineó belo÷ thå cursoò � are moved down one line and the bottom line scrolls off the screen. GotoXY ____________________________________________________________________________ Syntax: GotoXY( Xpos, Ypos ) Moveó thå cursoò tï thå positioî oî thå screeî specifieä bù thå integeò � expressionó 'Xpos§ (horizontaì valuå oò row© anä 'Ypos§ (verticaì valuå oò � column). The upper left corner (home position) is ( 1, 1 ). LowVideo ____________________________________________________________________________ Syntax: LowVideo Seô thå screeî tï thå videï attributå defineä aó 'Starô oæ Lo÷ Video§ iî thå � installation procedure. NormVideo ____________________________________________________________________________ Syntax: NormVideo Setó thå screeî tï thå videï attributå defineä aó 'Starô oæ Normaì Video§ iî � the installation procedure. Randomize ____________________________________________________________________________ Syntax: Randomize Initializes the random number generator with a random value. Move ____________________________________________________________________________ Syntax: Move( Var1, Var2, Num ) Doeó á masó copù directlù iî memorù oæ á specifieä numbeò oæ bytes® 'Var1§ � anä 'Var2§ arå twï variableó oæ anù type¬ anä 'Num§ ió aî integeò � expression® Thå procedurå copieó á blocë oæ 'Num§ bytes¬ startinç aô thå � firsô bytå occupieä bù 'Var1§ tï thå blocë startinç aô thå firsô bytå � occupied by 'Var2'. Move automatically handles overlap situations. Page 8. Š FillChar ____________________________________________________________________________ Syntax: FillChar( Var, Num, Value ) Filló á rangå oæ memorù witè á giveî value® 'Var§ ió á variablå oæ anù � type¬ 'Num§ ió aî integeò expression¬ anä 'Value§ ió aî expressioî oæ Bytå � oò Char® 'Num§ bytes¬ startinç aô thå firsô bytå occupieä bù 'Var'¬ arå � filled with the value 'Value'. Page 9. Š Arithmetic Functions Abs ____________________________________________________________________________ Syntax: Abs( Num ) Returnó thå absolutå valuå oæ 'Num'® Thå argumenô 'Num§ musô bå eitheò Reaì � or Integer, and the result is of the same type as the argument. ArcTan ____________________________________________________________________________ Syntax: ArcTan( Num ) Returnó thå angle¬ iî radians¬ whoså tangenô ió 'Num'® Thå argumenô musô bå � either Real or Integer, and the result is Real. Cos ____________________________________________________________________________ Syntax: Cos( Num ) Returnó thå cosinå oæ 'Num'® Thå argumenô 'Num§ ió expresseä iî radians¬ � and its type must be either Real or Integer. The result is of type Real. Exp ____________________________________________________________________________ Syntax: Exp( Num ) Returnó thå exponentiaì oæ 'Num§ tï baså e® Thå argumenô 'Num§ musô bå � either Real or Integer, and the result is Real. Frac ____________________________________________________________________________ Syntax: Frac( Num ) Returnó thå fractionaì parô oæ 'Num'® Thå argumenô 'Num§ musô bå eitheò � Real or Integer, and the result is Real. Int ____________________________________________________________________________ Syntax: Int( Num ) Returnó thå integeò parô oæ 'Num'® Thå argumenô 'Num§ musô bå eitheò Reaì � or Integer, and the result is real. Page 10. Š Ln ____________________________________________________________________________ Syntax: Ln( Num ) Returnó thå naturaì logarithí oæ 'Num'® Thå argumenô 'Num§ musô bå eitheò � Real or Integer, and the result is Real. Sin ____________________________________________________________________________ Syntax: Sin( Num ) Returnó thå sinå oæ 'Num'® Thå argumenô 'Num§ ió expresseä iî radians¬ anä � its type must be either Real or Integer. The result is of type Real. Sqr ____________________________________________________________________________ Syntax: Sqr( Num ) Returnó thå squarå oæ 'Num'® Thå argumenô musô bå eitheò Reaì oò Integer¬ � and the result is of the same type as the argument. Sqrt ____________________________________________________________________________ Syntax: Sqrt( Num ) Returnó thå squarå rooô oæ 'Num'® Thå argumenô 'Num§ musô bå eitheò Reaì oò � Integer, and the result is of type Real. Page 11. Š Scalar Functions Pred ____________________________________________________________________________ Syntax: Pred( Num ) Returnó thå predecessoò oæ 'Num§ (iæ iô exists)® 'Num§ ió oæ anù scalaò � type. Succ ____________________________________________________________________________ Syntax: Succ( Num ) Returns the successor of 'Num' (if it exists). 'Num' is of any scalar type. Odd ____________________________________________________________________________ Syntax: Odd( Num ) Returnó booleaî Truå iæ 'Num§ ió aî odä number¬ anä Falså iæ 'Num§ ió even® � 'Num' must be of type Integer. Page 12. Š Transfer Functions Chr ____________________________________________________________________________ Syntax: Chr( Num ) Returnó thå characteò witè thå ordinaì valuå giveî bù thå integeò expressioî � 'Num'. Example: Chr(65) returns the character 'A'. Ord ____________________________________________________________________________ Syntax: Ord( Var ) Returnó thå ordinaì numbeò oæ thå valuå 'Var§ iî thå seô defineä defineä bù � thå typå 'Var'® Ord¨ Vaò © ió equivalenô tï Integer¨ Vaò )® 'Var§ maù bå � of any scaral type, except Real, and the result is of the type Integer. Round ____________________________________________________________________________ Syntax: Round( Num ) Returns the value of 'Num' rounded to the nearest integer as follows: if Num>=0, then Round( Num ) = Trunc( Num + 0.5 ), and if Num<0, then Round( Num ) = Trunc( Num - 0.5 ). 'Num' must be of type Real, and the result is of type Integer. Trunc ____________________________________________________________________________ Syntax: Trunc( Num ) Returnó thå greatesô integeò lesó thaî oò equaì tï 'Num'¬ oò thå smallesô � integeò greateò thaî oò equaì tï 'Num'¬ iæ Num<0® 'Num§ musô bå oæ typå � Real, and the result is of the type Integer. Page 13. Š Miscellaneous Standard Functions Hi ____________________________________________________________________________ Syntax: Hi( I ) Thå lo÷ ordeò bytå oæ thå resulô containó thå higè ordeò bytå oæ thå valuå � oæ thå integeò expressioî 'I'® Thå higè ordeò bytå oæ thå resulô ió seô tï � zero. The type of the result is Integer. KeyPressed ____________________________________________________________________________ Syntax: KeyPressed Returnó booleaî Truå iæ á keù haó beeî presseä aô thå console¬ anä Falså iæ � nï keù haó beeî pressed® Thå resulô ió obtaineä bù callinç thå operatinç � system console status routine. Lo ____________________________________________________________________________ Syntax: Lo( I ) Returnó thå lo÷ ordeò bytå oæ thå valuå oæ thå integeò expressioî 'I§ witè � the high order byte forced to zero. The type of the result is Integer. Random ____________________________________________________________________________ Syntax: Random Returnó á randoí numbeò greateò thaî oò equaì tï zerï anä lesó thaî one® � The type is Real. Random( Num ) ____________________________________________________________________________ Syntax: Random( Num ) Returnó á randoí numbeò greateò thaî oò equaì tï zerï anä lesó thaî 'Num'® � 'Num' and the random number are both integers. SizeOf ____________________________________________________________________________ Syntax: SizeOf( Name ) Returnó thå numbeò oæ byteó occupieä iî memorù bù thå variablå oæ typå � 'Name'. The result is of type Integer. Page 14. Š Swap ____________________________________________________________________________ Syntax: Swap( Num ) Thå Swað functioî exchangeó thå higè anä lo÷ ordeò byteó oæ itó integeò � argument 'Num' and returns the resulting value as an integer. UpCase ____________________________________________________________________________ Syntax: UpCase( Ch ) Returnó thå uppercaså equivalenô oæ itó argumenô 'Ch§ whicè musô bå oæ typå � Char® Iæ nï uppercaså equivalenô exists¬ thå argumenô ió returneä � unchanged. Page 15. Š CP/M-80 Specific Functions Addr ____________________________________________________________________________ Syntax: Addr( Name ) Returnó thå addresó iî memorù oæ thå firsô bytå oæ thå type¬ variable¬ � procedure¬ oò functioî witè thå identifieò 'Name'® Iæ 'Name§ ió aî array¬ � iô maù bå subscribed¬ anä iæ 'Name§ ió á record¬ specifiã fieldó maù bå � selected. The value returned is of type Integer. Bdos procedure and function ____________________________________________________________________________ Syntax: Bdos( Func {, Param } ) Thå Bdoó procedurå ió useä tï invokå CP/Í BDOÓ routines® 'Func§ anä 'Param§ � arå integeò expressions® 'Func§ denoteó thå numbeò oæ thå calleä routinå � anä ió loadeä intï thå Ã register® 'Param§ ió optionaì anä denoteó á � parameteò whicè ió loadeä intï thå DÅ registeò pair® Á calì tï addresó µ � then invokes the BDOS. Thå Bdoó functioî ió calleä likå thå procedurå anä returnó aî integeò resulô � which is the value returned by the BDOS in the A register. BdosHL function ____________________________________________________________________________ Syntax: BdosHL( Func {, Param } ) Thió functioî ió exactlù likå thå Bdoó functioî above¬ excepô thaô thå � result is the value returned in the HL register pair. Bios Procedure and Function ____________________________________________________________________________ Syntax: Bios( Func {, Param } ) Thå Bioó procedurå ió useä tï invokå BIOÓ routines® 'Func§ anä 'Param§ arå � integeò expressions® 'Func§ denoteó thå numbeò oæ thå calleä routine¬ witè � zerï (0© meaninç thå WBOOÔ routine® 'Param§ ió optionaì anä denoteó á � parameter which is loaded into the BC register pair prior to the call. Thå Bioó functioî ió calleä likå thå procedurå anä returnó aî integeò resulô � which is the value returned by the BIOS in the A register. BiosHL Function ____________________________________________________________________________ Syntax: BiosHL( Func {, Param } ) Thió functioî ió exactlù similaò tï thå Bioó functioî abovå excepô thaô thå � result is the value returned in the HL register pair. Page 16. Š