What is the equivalent function of ValueWhen of AFL in tradescript?

What is the equivalent function of ValueWhen of AFL in tradescript?
If there is no function, request any one of you to share the equivalent code in tradescript.

Thanks in Advance

Ravi

ValueWhen() or similar function is not available in tradescript