Delphi Language Guide Delphi for Microsoft Win32 Delphi for the Microsoft. Net framework



Yüklə 0,84 Mb.
Pdf görüntüsü
səhifə96/294
tarix02.01.2022
ölçüsü0,84 Mb.
#41395
1   ...   92   93   94   95   96   97   98   99   ...   294
DelphiLanguageGuide

File Types
A file a sequence of elements of the same type. Standard I/O routines use the predefined 
TextFile
 or 
Text
 type,
which represents a file containing characters organized into lines. For more information about file input and output,
see Standard routines and I/O.
To declare a file type, use the syntax
type fileTypeName 
 = 
fileoftype
where fileTypeName is any valid identifier and type is a fixed-size type. Pointer types - whether implicit or explicit -
are not allowed, so a file cannot contain dynamic arrays, long strings, classes, objects, pointers, variants, other files,
or structured types that contain any of these.
For example,
type
   PhoneEntry = record
     FirstName, LastName: string[20];
     PhoneNumber: string[15];
     Listed: Boolean;
   end;
   PhoneList = file of PhoneEntry;
85


declares a file type for recording names and telephone numbers.
You can also use the 
file of ...
 construction directly in a variable declaration. For example,
var List1: file of PhoneEntry;
The word file by itself indicates an untyped file:
var DataFile: file;
For more information, see Untyped files.
Files are not allowed in arrays or records.
86



Yüklə 0,84 Mb.

Dostları ilə paylaş:
1   ...   92   93   94   95   96   97   98   99   ...   294




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin