ebook img

Turbo Pascal® version 7.0 programmer's reference PDF

310 Pages·1992·9.898 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Turbo Pascal® version 7.0 programmer's reference

7.0 PROGRAMMER'S REFERENCE • RUN·TIME LIBRARY • COMMAND·lINE COMPILER • ERROR MESSAGES • COMPILER DIRECTIVES BORLAND Turbo PascafB> Version 7.0 Programmer's Reference BORLAND INTERNATIONAL INC. 1800 GREEN HILLS ROAD P.O. BOX 660001, SCOTTS VALLEY, CA 95067·0001 Copyright © 1983, 1992 by Borland International. All rights reserved. All Borland products are trademarks or registered trademarks of Borland International, Inc. Windows, as used in this manual, shall refer to Microsoft's implementation of a windows system. Other brand and product names are trademarks or registered trademarks of their respective holders. PRINTED IN 'THE USA. Rl c o s N T E N T Introduction 1 Color constants for SetRGBPalette ..... . 22 What's in this manual? ................. 1 Concat function ..................... . 23 How to contact Borland . . . . . . . . . . . . . . .. 2 Continue procedure ................. . 23 Copy function ...................... . 24 Chapter 1 Library reference 5 Cos function ....................... . 25 Sample procedure . . . . . . . . . . . . . . . . . . . .. 5 CreateDir procedure ................ . 25 Abs function ......................... 6 Crt mode constants ................. . 25 Addr function ........................ 6 CSeg function ...................... . 26 Append procedure . . . . . . . . . . . . . . . . . . .. 6 DateTime type .... ~ ................. . 26 ArcCoordsType type .................. 7 Dec procedure ...................... . 27 Arc procedure . . . . . . . . . . . . . . . . . . . . . . .. 8 Delay procedure .................... . 27 ArcTan function ...................... 8 Delete procedure ................... . 27 Assign procedure ..................... 9 DelLine procedure .................. . 28 AssignCrt procedure ................. 10 DetectGraph procedure .............. . 28 Assigned function . . . . . . . . . . . . . . . . . . .. 10 DirectVideo variable ................ . 29 Bar constants . . . . . . . . . . . . . . . . . . . . . . .. 11 DiskFree function ................... . 30 Bar procedure ....................... 11 DiskSize function ................... . 30 Bar3D procedure ..................... 12 Dispose procedure .................. . 30 BitBlt operators .. . . . . . . . . . . . . . . . . . . .. 12 DosError variable ................... . 31 BlockRead procedure . . . . . . . . . . . . . . . .. 13 DosExitCode function ...... ; ........ . 32 BlockWrite procedure ................ 14 DosV ersion function ....... ; ........ . 32 Break procedure ..................... 15 DrawPoly procedure ................ . 32 ChDir procedure ............. " ...... 15 Driver and mode constants ........... . 33 CheckBreak variable ................. 16 DSeg function ...................... . 35 CheckEOF variable . . . . . . . . . . . . . . . . . .. 16 Ellipse procedure .................. ". . 35 CheckSnow variable ............... ~ ". 16 EnvCount function .................. . 36 Chr function ........................ 17 EnvStr function ..................... . 36 Circle procedure ..................... 17 Eof function (text files) ............... . 36 ClearDevice procedure ............... 18 Eof function (typed, untyped files) .... . 37 ClearViewPort procedure ............. 19 Eoln function ....................... . 37 Clipping conshints ................... 19 Erase procedure ..................... . 38 Close procedure ..................... 20 ErrorAddr variable .................. . 39 CloseGraph procedure . . . . . . . . . . . . . . .. 20 Exclude procedure .................. . 39 ClrEol procedure .................... 21 Exec procedure ..................... . 39 ClrScr procedure ...... '.' . . . . . . . . . . . .. 21 Exit procedure ...................... . 40 Color constants .. . . . . . . . . . . . . . . . . . . .. 22 ExitCode variable ................... . 41 ExitProc variable . . . . . . . . . . . . . . . . . . . .. 41 GetEnv function ..................... 65 Exp function .............. ;......... 42 GetEnvVar function. . . . . . . . . . . . . . . . .. 66 fcXXXX flag constants ................ 42 GetFAttr procedure .................. 66 FExpand function ..................... ' 42 GetFillPattern procedure . . . . . . . . . . . . .. 67 File attribute constants . . . . . . . . . . . . . . .. 43 GetFillSettings procedure . " ........... 67 File name length constants ............ 43 GetFTime procedure ................. 68 FileExpand function . . . . . . . . . . . . . . . . .. 44 GetGraphMode function . . . . . . . . . . . . .. 69 File-handling string types ............ 44 GetImage procedure ................. 70 FileMode variable . . . . . . . . . . . . . . . . . . .. 45 GetIntVec procedure ................. 71 FilePos function ..................... 45 GetLineSettings procedure ............ 71 FileRec type . . . . . . . . . . . . . . . . . . . ... . . .. 46 GetMaxColor function . . . . . . . . . . . . . . .. 72 FileSearch function . . . . . . . . . . . . . . . . . .. 46 GetMaxMode function. . . . . . . . . . . . . . .. 72 FileSize function .............. . . . . . .. 47 GetMaxX'function ... ; ............... 73 FileSplit function. '.' ................. : 47 GetMaxY function ................... 74 Fill pattern constants ................. 48 GetMem procedure .................. 74 FillChar procedure ... . . . . . . . . . . . . . . .. 49 GetModeName function .............. 75 FillEllipse procedure ..' ............... 49 GetModeRange procedure ............ 75 FillPatternType type . . . . . . . . . . . . . . . . .. 50 GetPalette procedure ................. 76 FillPoly procedure ................... 50 GetPaletteSize function ............... 77 FillSettingsType type ................. 51 GetPixel function .................... 77 FindFirst procedure .................. 51 GetTextSettings procedure ............ 78 FindNext procedure . . . . . . . . . . . . . . . . .. 52 GetTime procedure .................. 78 Flag constants ....................... 53 GetVerify procedure ................. 79 FloodFill procedure .................. 53 GetViewSettings procedure ........... 79 Flush procedure ..................... 54 GetX function ....................... 80 fmXXXX constants ................... 55 GetY function ....................... 81 Font control constants ................ 55 GotoXYprocedure ................... 81 F~ac function ................. : . . . . .. 55 GraphDefaults procedure ............. 82 FreeList variable ..................... 56 GraphErrorMsg function. . . . . . . . . . . . .. 82 FreeMem procedure . . . . . . . .. .. . . . . . .. 56 GraphFreeMemPtr variable ........... 83 FSearchfunction . . . . . . . . . . . . . . . . . . . .. 57 GraphGetMemPtr variable ............ 83 FSplit procedure ..................... 57 GraphResult function. . . . .. . . . . . . . . . .. 84 GetArcCoords procedure ............ , 58 grXXXX constants .................... 85 GetArgCount function . . . . . . . . . . . . . . .. 59 Halt procedure ...................... 85 GetArgStr function . . . . .. . . . . . . . . . . . .. 59 HeapEnd variable . . . . . . . . . . . . . . . . . . .. 86 GetAspectRatio procedure ............ 59 i-IeapError variable. . . . . . . . . . . . . . . . . .. 86 GetBkColor function ................. 60 HeapOrg variable . . . . . . . . . . . . . . . . . . .. 86 GetCBreak procedure. . . . . . . . . . . . . . . .. 61 HeapPtr variable. . . . . . . . . . . . . . . . . . . .. 87 GetColor function . . . . . . . . . . . . . . . . . . .. 62 Hi function ......................... 87 GetCurDir function .................. 62 High function ....................... 87 GetDate procedure . . . . . . . . . . . . . . . . . .. 63 HighV ideo procedure ................ 88 GetDefaultPalette function ............ 63 ImageSize function ...... 88 'c.' ••••••••••• GetDir procedure .................... 64 Inc procedure ...................... .89 GetDriverName function. . . . . . . . . . . . .. 64 Include procedure ................... 90 InitGraph procedure ................. 90 OvrDebugPtr variable ............... 117 InOutRes variable . . . . . . . . . . . . . . . . . . .. 92 OvrDosHandle variable . ~ ............ 117 Input variable ....................... 92 OvrEmsHandle variable ............. 117 Insert procedure ..................... 93 OvrFileMode variable ............... 118 InsLine procedure ..................... 93 OvrGetBuf function .................. 118 InstallUserDriver function ............ 94 OvrGetRetry function ............... 118 InstallUserFont function .............. 96 OvrHeapEnd variable ............... 119 Int function ......................... 97 OvrHeapOrg variable ............... 119 Intr procedure ....................... 97 OvrHeapPtr variable ................ 120 IOResult function .................... 98 OvrHeapSize variable ............... 120 Justification constants ................ 99 OvrInit procedure. . . . . . . . . . . . . . . . . .. 120 Keep procedure. . . . . . . . . . . . . . . . . . . . .. 99 OvrInitEMS procedure .............. 121 KeyP ressed function ................. 99 OvrLoadCount variable. . . . . . . . . . . . .. 122 LastMode variable .................. 100 OvrLoadList variable . . . . . . . . . . . . . . .. 122 Length function . . . . . . . . . . . . . . . . . . . .. 100 OvrReadBuf variable ...... . . . . . . . . .. 123 Line procedure ..................... 100 OvrResult variable ........ . . . . . . . . .. 123 Line style constants ................. 101 OvrSetBuf procedure . . . . . . . . . . . . . . .. 123 LineRelprocedure .................. 102 OvrSetRetry procedure .............. 124 LineSettingsType type ............... 103 OvrTrapCount variable . . . . . . . . . . . . .. 125 LineTo procedure ................... 103 ovrXXXX constants. . . . . . . . . . . . . . . . .. 125 Ln function ........................ 104 PackTime procedure ................ 125 Lo function ........................ 104 PaletteType type . . . . . . . . . . . . . . . . . . .. 126 Low function . . . . . . . . . . . . . . . . . . . . . .. 104 ParamCount function ............... 126 LowVideo procedure ................ 105 ParamStr function . . . . . . . . . . . . . . . . . .. 127 Lst variable ........................ 106 Pi function . . . . . . . . . . . . . . . . . . . . . . . .. 127 MaxAvail function .................. 106 PieSlice procedure .................. 127 MaxColors constant ................. 107 PointType type ..................... 128 MemAvail function .................. 107 Pos function . . . . . . . . . . . . . . . . . . . . . . .. 128 MkDir procedure ................... 108 Pred function . . . . . . . . . . . . . . . . . . . . . .. 129 Move procedure .................... 108 PrefixSeg variable . . . . . . . . . . . . . . . . . .. 129 MoveRelprocedure ................. 109 Ptr function ........................ 129 MoveTo procedure . . . . . . . . . . . . . . . . .. 110 PutImage procedure. . . . . . . . . . . . . . . .. 130 MsDos procedure ................... 110 PutPixel procedure . . . . . . . . . . . . . . . . .. 132 New procedure ..................... 111 Random function ................... 132 NormVideo procedure ............... 111 Randomize procedure ............... 133 NoSound procedure ................. 112 RandSeed variable .................. 133 Odd function . . . . . . . . . . . . . . . . . . . . . .. 112 Read procedure (text files) ......... ,. 133 Ofs function . . . . . . . . . . . . . . . . . . . . . . .. 112 Read procedure (typed files) .......... 135 Ord function ....................... 112 ReadKey function . . . . . . . . . . . . . . . . . .. 135 Output variable . . . . . . . . . . . . . . . . . . . .. 113 Readln procedure ................... 136 OutText procedure .................. 113 Rectangle procedure ................ 136 OutTextXYprocedure ............... 115 RegisterBGIdriver function . . . . . . . . . .. 137 OvrClearBuf procedure, ............. 116 RegisterBGIfont function. . . . . . . . . . . .. 139 OvrCodeList variable . . . . . . . . . . . . . . .. 116 Registers type ...................... 141 iii RemoveDir procedure ............... 141 SetViewPort procedure .............. 172 Rename procedure .................. 142 SetVisualPage procedure. . . . . . . . . . . .. 173 Reset procedure .................... 142 SetWriteMode procedure ............ 174 RestoreCrtMode procedure ........... 143 Sin function ........................ 175 Rewrite procedure .................. 144 SizeOf function . . . . . . . . . . . . . . . . . . . .. 176 RmDir procedure ................... 145 Sound procedure ................... 176 Round function . . . . . . . . . . . . . . . . . . . .. 145 SPtr function ....................... 177 RunError procedure ................. 146 Sqr function ........................ 177 SavelntXX variables ................. 146 Sqrt function ....................... 177 SearchRec type ..................... 147 SSeg function ....................... 177 Sector procedure . . . . . . . . . . . . . . . . . . .. 148 StackLimit variable. . . . . . . . . . . . . . . . .. 177 Seek procedure ...................... 149 Str procedure ....................... 178 SeekEof function . . . . . . . . . . . . . . . . . . .. 149 StrCat function ..................... 178 SeekEoln function . . . . . . . . . . . . . . . . . .. 149 StrComp function . . . . . . . . . . . . . . . . . .. 179 Seg function ....................... ; 150 StrCopy function ................... 179 Seg0040 variable .................... 150 StrDispose function ................. 180 SegAOOO variable ................... 150 StrECopy function .................. 180 SegBOOO variable . . . . . . . . . . . . . . . . . . .. 151 StrEnd function ................... " 181 SegB800 variable . . . . . . . . . . . . . . . . . . .. 151 StrIComp function .................. 181 SelectorInc variable ................. 151 StrLCat function ................. : .. 181 SetActivePage procedure ............ 152 StrLComp function .................. 182 SetAllPalette procedure . . . . . . . . . . . . .. 152 StrLCopy function .................. 182 SetAspectRatio procedure ............ 154 StrLen function ..................... 183 SetBkColor procedure ............... 155 StrLIComp function . . . . . . . . . . . . . . . .. 183 SetCBreak procedure ................ 155 StrLower function ................... 184 SetColor procedure ................. 156 StrMove function ................... 184 SetCurDir procedure ................ 156 StrNew function .................... 185 SetDate procedure .................. 157 StrPas function ..................... 185 SetFAttr procedure ................... 157 StrPCopy function .................. 186 SetFillPattern procedure ............. 158 StrPos function ..................... 186 SetFillStyle procedure ............... 159 StrRScan function . . . . . . . . . . . . . . . . . .. 187 SetFTime procedure . . . . . . . . . . . . . . . .. 160 StrScan function .................... 187 SetGraphBufSize procedure .......... 160 StrUpper function ................... 188 SetGraphMode procedure . . . . . . . . . . .. 160 Succ function . . . . . . . . . . . . . . . . . . . . . .. 188 SetIntVec procedure. . . . .. . . . . .. . . . .. 161 Swap function . . . . . . . . . . . . . . . . . . . . .. 188 SetLineStyle procedure .............. 162 SwapV ectors procedure. . . . . . . . . . . . .. 189 SetPaletteprocedure ................ 163 TDateTime type .......... ... . . . . . .. 189 SetRGBPalette procedure ............ 164 Test8086 variable ................... 190 SetTextBuf procedure ................ 168 Test8087 variable ................... 190 SetTextJustify procedure ............. 169 TextAttr variable. . . . . . . . . . . . . . . . . . .. 191 SetTextStyle procedure .............. 169 Text color constants ................. 192 SetTime procedure ........ ~ . . . . . . . .. 171 TextBackground procedure .......... 192 SetU serCharSize procedure .......... 171 TextColor procedure ................ 193 SetVerify procedure ................. 172 TextHeight function ................. 193 iv TextMode procedure ................ 194 Overflow checking .................. 219 TextRec type ....................... 195 Overlay code generation ............. 219 TextSettingsType type ............... 196 Overlay unit name .................. 220 TextWidth function ................. 196 Range checking . . . . . . . . . . . . . . . . . . . .. 220 TFileRec type . . . . . . . . . . . . . . . . . . .. . .. 197 Stack-overflow checking ............. 221 TRegisters type ..................... 198 Symbol reference information ........ 221 Trunc function . . . . . . . . . . . . . . . . . . . . .. 198 Type-checked pointers . . . . . . . . . . . . . .. 222 Truncate procedure ................. 198 UNDEF directive ................... 222 TSearchRec type .................... 199 Var-string checking ................. 222 TTextRec type ...................... 199 Using conditional compilation TypeOf function .................... 200 directives .......................... 223 UnpackTime procedure .............. 200 Conditional symbols .............. 224 UpCase function . . . . . . . . . . . . . . . . . . .. 200 Chapter 3 Command-line compiler 227 Valprocedure ...................... 201 Command-line compiler options .. . . .. 228 View PortType type ................. 202 Compiler directive options ......... 229 WhereX function. . . . . . . . . . . . . . . . . ... 202 The switch directive option . . . . . .. 229 WhereY function . . . . . . . . . . . . . . . . . . .. 202 The conditional defines option .... 230 WindMax and WindMin variables .... 203 Compiler mode options . . . . . . . . . . .. 230 Window procedure ................. 203 The make (1M) option ........... 231 Write procedure (text files) ........... 204 The build all (lB) option ......... 231 Write procedure (typed files) ......... 206 The find error (IF) option ........ 231 Writeln procedure .................. 206 The link buffer (lL) option ....... 232 Chapter 2 Compiler directives 209 The quiet (I Q) option ........... 232 Align data ......................... 211 Directory options ................. 233 Boolean evaluation ......... ; ........ 211 The TPL & CFG directory (IT) Debug information . . . . . . . . . . . . . . . . .. 212 option ......................... 233 DEFINE directive ................... 212 The EXE & TPU directory (IE) ELSE directive ...................... 213 option ......................... 234 Emulation ......................... 213 The include directories (IE) option. 234 ENDIF directive .................... 213 The unit directories (lU) option . .. 234 Extended syntax .................... 214 The object files directories (I 0) Force far calls. . . . . . . . . . . . . . . . . . . . . .. 214 option ......................... 234 Generate 80286 Code ................ 215 Debug options . . . . . . . . . . . . . . . . . . .. 234 IFDEF directive . . . . . . . . . . . . . . . . . . . .. 215 The map file (I G) option . . . . . . . .. 234 IFNDEF directive ................... 215 The debugging (IV) option . . . . . .. 235 IFOPT directive ..................... 215 The TPC.CFG file ................... 235 Include file . . . . . . . . . . . . . . . . . . . . . . . .. 216 Chapter 4 Error messages' 237 Input/output checking. . . . . . . . . . . . . .. 216 Compiler error messages ............. 237 Link object file . . . . . . . . . . . . . . . . . . . . .. 216 Run-time errors ..................... 257 Local symbol information ............ 217 DOS errors . . . . . . . . . . . . . . . . . . . . . .. 258 Memory allocation sizes ............. 218 I/O errors ....................... 260 Numeric coprocessor ................ 218 Critical Errors .................... 261 Open string parameters .............. 218 v Fatal errors. . . . . . . . . . . . . . . . . . . . . .. 261 Appendix B Compiler directives quick reference 271 Appendix A Editor reference 265 Editor commands in depth ......... 269 Appendix C Reserved words and Searching with regular expressions . . .. 270 standard directives 275 Appendix 0 ASCII characters 277 Index 281 vi s T A B L E 1.1: Graph unit driver constants ......... 33 A.2: Block commands in depth ......... 268 1.2: Graph unit mode constants ......... 34 A.3: Borland-style block commands .... 269 1.3: The components of the output A.4: Other editor commands in depth ... 269 string ........................... 205 A.5: Regular expression wildcards ..... 270 1.4: The components of the fixed-point B.1: Compiler directives ............... 271 string ........................... 205 C.1: Turbo Pascal reserved words ...... 275 3.1: Command-line options ............ 228 C.2: Turbo Pascal standard directives ... 276 4.1: Error message types ............... 237 D.1: ASCII table ...................... 278 A.1: Editing commands ............... 266 vii

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.