Re: resetting record values to ""
Re: resetting record values to ""
- Subject: Re: resetting record values to ""
- From: "Arthur J Knapp" <email@hidden>
- Date: Tue, 02 Jan 2001 09:50:59 -0500
>
Date: Mon, 01 Jan 2001 19:06:54 -0500
>
Subject: resetting record values to ""
>
From: "Bryan" <email@hidden>
>
What is the fastest way to reset the values of every item of a record to ""?
Well, this may be cheating, but...
on make_record( a, b, c )
return { label1 : a, label2 : b, label3 : c }
end make_record
-- Make a record
--
set MyRecord to make_record( true, 3.1415, "abc" )
--> { label1 : true, label2 : 3.1415, label3 : "abc" }
-- Set every item of the record to ""
--
set MyRecord to make_record( "", "", "" )
--> { label1 : "", label2 : "", label3 : "" }
Otherwise, you just set each item to the value:
set label1 of MyRecord to ""
set label2 of MyRecord to ""
...
I suppose it is possible that the "resetting" could be slightly
faster by using "pattern" setting:
set MyRecord to {label1:1, label2:2, label3:3}
set {label1 of MyRecord, label2 of MyRecord, label3 of MyRecord} to ,
{"", "", ""}
MyRecord
--> {label1:"", label2:"", label3:""}
--
{
Arthur J Knapp, of STELLARViSIONs ;
http://www.STELLARViSIONs.com ;
mailto:email@hidden ;
http://developer.apple.com/techpubs/
macos8/InterproCom/AppleScriptScripters/
AppleScriptLangGuide/
}