Alt-e and code blocks

   2662   2   1
User Avatar
Member
2 posts
Joined: July 2005
Offline
Hey All-

I would like to create an expression like this in the Alt-E window:
{
set $amp=10
set $freq=10
sin($PT*$freq)*$amp
}

I can't seem to get that to compile. I had seen an example of that. Can you send me an example of this or tell me what I am doing wrong?

Thanks,
Nathan
User Avatar
Member
7715 posts
Joined: July 2005
Offline
Several problems in regards to the expression language
- $ is only used for deferencing global variables
- there is no “set” statement
- you need to declare your local variables before use
- semi-colons are required at the end of statements
- a return statement is used to return the desired value.

Putting all this together, try this:
{
float amp=10;
float freq=10;
return sin($PT*freq)*amp;
}
User Avatar
Member
2 posts
Joined: July 2005
Offline
I was thinking in hscript not VEX. Slow brain day. Thanks a mil.
  • Quick Links