First time here? Check out the FAQ!
x

Why an encapsulated class parameter would work with an !EventValue but not a literal with units.

0 votes
27 views

I have an encapsulated class where a Sound it contains has the following expression in one of its parameters:

{?rapidRetrigger varIfTrue: [
    (?duration - 2 samp)
] ifFalse: (?duration)}

?duration is a parameter of my encapsulated class and I'm doing a little arithmetic on it inside my class. 

After encapsulating my Duration parameter will accept an expression with an !EventValue in it:

!Duration s

but not a literal value:

0.1 s

Why is that?

 


 

Ah, I found out the answer before finishing the question. I'll post it up anyway in case anyone else bumps into this issue. 

What I did was change the type of my Duration parameter from HotValue to HotTime in the class editor. 

All is well. 

asked Jul 30 in Capytalk & Smalltalk by alan-jackson (Virtuoso) (11,060 points)
reopened Jul 31 by ssc

1 Answer

0 votes

Alan answers:

Ah, I found out the answer before finishing the question. I'll post it up anyway in case anyone else bumps into this issue. 

What I did was change the type of my Duration parameter from HotValue to HotTime in the class editor. 

All is well. 

answered Jul 31 by ssc (Savant) (93,380 points)
...