Re: resetting record values to ""
Re: resetting record values to ""
- Subject: Re: resetting record values to ""
- From: Richard 23 <email@hidden>
- Date: Tue, 2 Jan 2001 02:08:46 -0800
regarding Paul's "there's no easy way to do it" answer, Bryan said:
>
I was afraid of that, Unfortunately the the empty record is:
>
property record_out : ** expletive deleted **
>
And I have to reset it multiple times in the same script.
>
I was hoping for something like:
>
set every value of record record_out to ""
>
But I may have to just use a handler.
Bryan: maybe I'm missing something but I don't see why you are bothering
reset properties of a record at all. Why not make the record defined in
record_out the result of a handler (kinda like a constructor function)
and set the value of your target record to the result of that handler?
Something like:
property Current_Record : {}
on run
TestMe()
end run
on TestMe()
set Current_Record to NewRecord()
set theRec to Current_Record
set {theRec's Findings, theRec's Impression} to {"deceased", "bugger"}
ResetRecord(a reference to Current_Record) --a reference to theRec)
Current_Record
end TestMe
on NewRecord()
return {Findings:"", Impression:""}
end NewRecord
on ResetRecord(theRef)
set theRef's contents to NewRecord()
end ResetRecord
Note that to set the referenced record it must be a top-level property or
global otherwise it will not be visible to the ResetRecord handler.
R23