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..
Setting Custom Property syntax
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Setting Custom Property syntax
Hi Keith,
make a new stack with one checkbox button and a regular button.
script of checkbox button:
script of the regular button:
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
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
Code: Select all
on mouseUp
put the uCheckbox of this card
end mouseUp
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
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
"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
Ah, thanks for the responses and enlightenment, gentlemen. I now see how set properties ≠ setProp!
I must improve my search strings!
Best,
Keith..
I must improve my search strings!

Best,
Keith..