Hi programmer.. You are on my site in “We Are Knowledge”. In
here you will getting many IT knowledge. IT knowledge based web programming
likely html and php, based dekstop programming likely pascal, cobol, c++ and
other program language… in here the programmer can looking for IT knowledge.
This is the right blog for begginer programmer.. because I was making tutorial from from the
base to a higher level. Example if you will programmer you must learn dekstop
programming and next web programming.
But now, I want giving you IT knowledge based dekstop
programming. That is “program language PASCAL” and discuss about FILE in
Pascal. You want to know? Let’s do read my article.. have fun for reading…
FILE
>> Files in pascal is a collection of byte-byte stored
in the storage media (in pascal program). A component (an element of the file)
the same data type, which is not necessarily the amount that can be reduced or
increased if anyone wants to change.
Pascal files on there are some we need to know, and there
are 3 types of files, namely:
1. Text file
2. files of type
3. File not type
Ok… now.. I want explain to you one by one. But I want
giving you knowledge just “TEXT FILE”
1. Text file
Creating text file with pascal :
a. Declaring a
variable syntax for file
var name_variable : TEXT;
b.Linking syntax for file names with variable file
assign (name_variable, name_file);
c. Creating a text
file to be active (in use)
rewrite (name_variable);
d. Writing into a text file (edit file)
write / writeln (name_variable, value data 1, value data 2,
valu data 3, and so on)
e. closing the file
close (name_variable)
Reading Text Files with pascal
a. Declaring a
variable syntax for file
var name_variable : TEXT;
b.Linking syntax for file names with variable file
assign (name_variable, name_file);
c. Reading pascal file contents and display it in the
windows or on the output window
while not eof (name_variable)
begin
readln (name_variable, value data 1, value data 2, valu data
3, and so on);
write (value data 1, value data 2, value data 3, and so on);
end;
d. closing the file
close (name_variable)
Add the contents of the file created by pascal
assign
>> Linking syntax for file names with variable file
Append
>> additions to pre-existing file contents
Ok.. just it
I hope you likely..
See you later..
No comments:
Post a Comment