Single Point Property Creation/Assignment
Stephen Barncard
stephenREVOLUTION at barncard.com
Thu Aug 4 00:02:49 EDT 2005
Hi gang,
I'm creating a central management system for settings using user properties.
I want to use one central routine to access the preferences stack.
To do that, I am working with a handler that creates and sets a
custom property INSIDE a custom property set - all set at once. I got
the below code to work.
My question is -- is the use of 'do' the only or best way to
accomplish the use of variables for assigning property names and
data? Or am I missing the obvious?
Would SetProp be better for this?
any suggestions welcome... thanks
on test
-- beep 5
put "cats" into pPropSet
put "kadiska" INTO pProp
put "kitten" into pData
put returnTheDefaultPrefsFileName() into pPath
dataToProp pPropSet,pProp,pData,pPath
end test
on dataToProp pPropSet,pProp,pData,pPath
if pPath is empty
then
put returnTheDefaultPrefsFileName() into pPath
end if
do "set the" && pPropSet & "[" & quote & pProp & quote & "] of
stack " & quote & pPath & quote & " to " & pData
end dataToProp
function returnTheDefaultPrefsFileName
put specialFolderPath("Preferences") into sfp
put "/" & "preference.rev after sfp
return sfp
end returnTheDefaultPrefsFileName
More information about the use-livecode
mailing list