does property exists in a record
does property exists in a record
- Subject: does property exists in a record
- From: Adam Hinshaw <email@hidden>
- Date: Fri, 10 Aug 2001 23:40:23 +1000
Hi,
im currently stumped with records.
i want to be able to test that a property exists first before trying to set
it.
If its does not exists i will concatenate it to the record otherwise i want
to add stuff to its value (another record)
my current attempt as test (that is failing)
-------------
set x to {hello:"world", goodbye:"cruel world"}
propertyExists(x, "hello" as data)
on propertyExists(inRecord, theProp)
--does a property:theProp exist in a record:theRecord
set val to true
try
set test to theProp of inRecord
on error
set val to false
end try
return (val)
end propertyExists
------------
can any one see a way, (with out non standard osax ??)
thanks
adam.