Difference between revisions of "Text"

From Free Pascal wiki
Jump to navigationJump to search
m
 
Line 10: Line 10:
 
<HR>
 
<HR>
 
When the term '''Text''' is used for [[File|files]] in general, it refers to a type of file which consists of ordinary information which is (usually) readable by a person.  This includes documents, [[Source code|source code]] of Pascal Programs, web pages, and other such items.  This differs from a [[Binary|binary]] file, which is generally not human readable, and is used to store machine-readable data.
 
When the term '''Text''' is used for [[File|files]] in general, it refers to a type of file which consists of ordinary information which is (usually) readable by a person.  This includes documents, [[Source code|source code]] of Pascal Programs, web pages, and other such items.  This differs from a [[Binary|binary]] file, which is generally not human readable, and is used to store machine-readable data.
 +
 +
 +
[[category:Pascal]]
  
 
{{File}}
 
{{File}}

Revision as of 22:27, 23 April 2007

In this article, for the sake of ease of understanding, reserved words in Pascal are shown in UPPER CASE even though the Pascal lanugage is not case sensitive.

The term text, when used in a Pascal program, is a shortcut for the type file of char. The following Pascal definitions should be equivalent:

VAR filname: FILE OF char;
VAR filname: text;

In the above example, the identifier used (filname) is the file variable which is used to do input, output, or both, to the actual file. The file variable, however, is not the actual file; the file variable must be tied to the actual file by a run-time library routine. In most cases, this is done via the assign procedure followed by use of the reset or rewrite procedure. In the case of specialized files such as databases, it is done via some other method than the standard ones, in order to allow a file variable to actually read from and/or write to the actual file itself using specialized routines.


When the term Text is used for files in general, it refers to a type of file which consists of ordinary information which is (usually) readable by a person. This includes documents, source code of Pascal Programs, web pages, and other such items. This differs from a binary file, which is generally not human readable, and is used to store machine-readable data.

File-related types, procedures and functions:

File - Text - AssignFile - CloseFile - Reset - Rewrite - Get - Put - Read - Readln - Write - Writeln