• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
newbie question2: eof?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

newbie question2: eof?


  • Subject: newbie question2: eof?
  • From: email@hidden
  • Date: Sun, 30 Dec 2001 12:57:50 -0800

Hello List:

From the Help viewer OS X:AppleScript Guidebook:Essential Sub-routines in the 'Write data to a file section':


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

Notwithstanding: if I click on the second icon on the same page in the help viewer the text which is copied to the clip board is:

try
--replace this line with your statements
on error error_message number terror_number
set this_error to "Error: " & error_number & ". " & ,
error_message & return
-- change the following line to the name and location desired
set the log_file to ((path to desktop) as text) & "Script Error Log"
my write_to_file(this_error, log_file, true)
end try


I think line 3 should be "error" not "terror"

eekk.


  • Follow-Ups:
    • Re: newbie question2: eof?
      • From: Shane Stanley <email@hidden>
References: 
 >Re: newbie question: define a variable? (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: Source Text of Script Objects
  • Next by Date: Re: newbie question2: eof?
  • Previous by thread: Re: newbie question: define a variable?
  • Next by thread: Re: newbie question2: eof?
  • Index(es):
    • Date
    • Thread