Re: newbie question2: eof?
Re: newbie question2: eof?
- Subject: Re: newbie question2: eof?
- From: Shane Stanley <email@hidden>
- Date: Mon, 31 Dec 2001 08:12:22 +1100
On 31/12/01 7:57 AM +1000, email@hidden, email@hidden, wrote:
>
I would like to understand what 'eof' does in this script. (line 7 and 8)
>
What does it stand for?
>
>
>
on write_to_file(this_data, target_file, append_data)
>
try
>
set the target_file to the target_file as text
>
set the open_target_file to ,
>
open for access file target_file with write permission
>
if append_data is false then ,
>
set eof of the open_target_file to 0
>
write this_data to the open_target_file starting at eof
>
close access the open_target_file
>
return true
>
on error
>
try
>
close access file target_file
>
on error
>
end try
>
return false
>
end try
>
end write_to_file
eof = end of file. Setting eof to 0 is effectively wiping the contents of
the file. Writing data "starting at eof" means adding on to what's already
there.
--
Shane Stanley, email@hidden