%eval()
Evaluates the string as an expansion, and returns the result. The main
difference between using this expansion and just using %{…} is
that the string being evaluated can be dynamically changed.
Syntax
%eval(string)
Example 1. Evaluate an attribute or a string directly
if (User-Name == "bob") {
control.Filter-Id := "User-Name"
} else {
control.Filter-Id := "not bob!"
}
reply.Reply-Message := "%eval(control.Filter-Id}"
Output when
User-Name == bobbob
Output when
User-Name == jimnot bob!
Example 2. Evalute an expression
control.Filter-Id := 'User-Name == "bob"'
if (%eval(control.Filter-Id)) {
reply.Reply-Message := "yes it's bob"
} else {
reply.Reply-Message := "not bob!"
}
Output when
User-Name == bobyes it's bob
Output when
User-Name == jimnot bob!