Page 1 of 1
Setting Custom Property syntax
Posted: Thu Jun 24, 2010 1:26 pm
by Clarkey
Hi Folks, I'm building out some preferences on a card and want to use custom properties for persistence. I'm trying to understand Revolution's checkbox and custom property set/get syntax and would appreciate a simple example of how a card custom property can be set to reflect the hilite/non-hilite state of a checkbox on the card.
Thanks & regards,
Keith..
Re: Setting Custom Property syntax
Posted: Thu Jun 24, 2010 2:12 pm
by bn
Hi Keith,
make a new stack with one checkbox button and a regular button.
script of checkbox button:
Code: Select all
on mouseUp
set the uCheckBox of this card to the hilite of me
end mouseUp
script of the regular button:
Code: Select all
on mouseUp
put the uCheckbox of this card
end mouseUp
toggle the checkbox button and the regular button will put the state of the checkbox button into the message box.
You are free as far as naming of the custom property is concerned as long as it is not a reserved word, many people in Rev use the prepended u to designate a custom property.
If you use an array in a custom property you first have to put the array out of the custom property into a variable, work with/on the array and set the custom property to the array again when your are done using it. Non-arrays can be accessed directly.
You can stuff anything you want into a custom property, binary data / whole stacks. One thing to watch out for is that because of this liberal format of the custom property: if you store text in a cp Rev will not automatically change the hight ascii values for you depending on the platform.
regards
Bernd
Re: Setting Custom Property syntax
Posted: Thu Jun 24, 2010 2:14 pm
by Klaus
Hi Keith,
"set" a custom prop:
...
set the cHiliteState of this cd to true/false
...
Or
...
set the cHiliteState of cd X to the hilite of btn Y of cd Z
...
"get" a cp:
...
put the cHiliteState of this cd into myVar
...
Or
set the hilite of btn X to the cHiliteState of this cd
...
You get the picture
Best
Klaus
P.S.
DAMN, noone can beat the sleeples monster a.k.a bn

Re: Setting Custom Property syntax
Posted: Thu Jun 24, 2010 3:04 pm
by Clarkey
Ah, thanks for the responses and enlightenment, gentlemen. I now see how set properties ≠ setProp!
I must improve my search strings!
Best,
Keith..