Re: resetting record values to ""
Re: resetting record values to ""
- Subject: Re: resetting record values to ""
- From: "Bryan" <email@hidden>
- Date: Thu, 04 Jan 2001 12:38:58 -0500
Scott,
It may not have been what I asked for, but it should have been.
That saves me about 40 lines of code.
Thanks
Bryan
----------
>
From: email@hidden
>
To: email@hidden
>
Subject: Re: resetting record values to ""
>
Date: Thu, Jan 4, 2001, 12:38 AM
>
>
As a follow up to the lament of "Bryan" <email@hidden> on Mon, 01 Jan
2001
>
20:06:40 -0500,
>
>
> 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.
>
>
Something else you might find yourself needing to do would be to clear or
preset
>
multiple properties of a record. In that case, you can use concatenation,
>
taking advantage of the fact that, if you concatenate two records and they
have
>
some properties with the same name, the left record's appear in the result.
So,
>
>
>
{ a:0, b:0, d:0 } & {a:1, b:2, c:3, d:4, e:5}
>
--> result: {a:0, b:0, c:3, d:0, e:5}
>
>
So make a "cleared record" containing only the properties you want to change,
>
and concatenate it on the left side of your main record.
>
>
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:""}
>
>
property clear_exams : {Exam_1:"", Exam_2:"", Exam_3:"", Exam_4:"", Exam_5:"",
>
Exam_6:""}
>
>
--[... stuff happens. Now we need to clear the exams fields. ]
>
>
set record_out to clear_exams & record_out
>
>
Not exactly what you asked for, but it might be useful.
>
>
--
>
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
>
_______________________________________________
>
applescript-users mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/applescript-users