Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: resetting record values to ""
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: resetting record values to ""



> 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/
}




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.