First time here? Check out the FAQ!
x

Class Encapsulation / hot values

0 votes
307 views
After having developed a sound with a SoundToGlobalController and a Script, I am trying to encapsulate my own class.

But when I am asked to supple a value for my green variables, if I put an HotValue instead of a numver (or an array or a string),

I get this error message:

"event Values (such as !step) cannot be used as parameters of a user defined class. Please replace them with variables (e.g. ?step) and try again.

 

what is my mistake?

thanks.

d
asked May 15, 2019 in Capytalk & Smalltalk by domenico-cipriani (Master) (3,110 points)

1 Answer

0 votes
 
Best answer
When you encapsulate you have to convert all !EventValues to ?GreenVariables.

When you build the class and kyma throws up the dialog asking for values you need to enter a number in the case of an !EventValue (you can use the default of zero).

Then when you build your example or prototype from the class, that's when you can enter your default value in the parameter field, which can be an !EventValue.

Does that make sense?
answered May 15, 2019 by alan-jackson (Virtuoso) (15,840 points)
selected May 16, 2019 by domenico-cipriani
it makes sense and it's easier of what I thought!
thanks Alan
...