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
Alt-e and code blocks
2663 2 1- nathano
- Member
- 2 posts
- Joined: July 2005
- Offline
- edward
- Member
- 7715 posts
- Joined: July 2005
- Online
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;
}
- $ 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;
}
- nathano
- Member
- 2 posts
- Joined: July 2005
- Offline
-
- Quick Links