• 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
Re: resetting record values to ""
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: resetting record values to ""


  • Subject: Re: resetting record values to ""
  • From: email@hidden
  • Date: Thu, 4 Jan 2001 00:22:54 -0500

On Mon, 01 Jan 2001 20:06:40 -0500, "Bryan" <email@hidden> lamented,

> I was afraid of that, Unfortunately the the empty record is:
>
> property record_out : {Last_Name:"", First_Name:"", Account_Num:"",
> Facility:"", Referring_Physician:"", Exam_1:"", Exam_2:"", Exam_3:"",
> Exam_4:"", Exam_5:"", Exam_6:"", Date_of_Exam:"", Findings:"",
[...]

> 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.

Sounds like a job for a scripting addition!

Sigma's Coercions (by Eric Grant) has a record->list coercion "record_out as
user list" that will turn the record into a list of alternating label and data
items. In your case, you'd get the list

record_out as user list
--> result: {"|Last_Name|", "", "|First_Name|", "", "|Account_Num|", "",
"|Facility|", "", "|Referring_Physician|", "" ...}

You can then loop through the even-numbered items, setting them to "". Coercing
the modified list into a "user record" will then restore it to a record keeping
the same labels.

set list_out to record_out as user list
repeat with i from 2 to count of list_out by 2
set item i of list_out to ""
end repeat
set record_out to list_out as user record

Sigma's Coercions is available at <http://home.earthlink.net/~eagrant/>.
--
Scott Norton Phone: +1-703-299-1656
DTI Associates, Inc. Fax: +1-703-706-0476
2920 South Glebe Road Internet: email@hidden
Arlington, VA 22206-2768 or email@hidden


  • Prev by Date: Re: Referring to the local hard drive
  • Next by Date: Re: Referring to the local hard drive
  • Previous by thread: Re: resetting record values to ""
  • Next by thread: Re: resetting record values to ""
  • Index(es):
    • Date
    • Thread