Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
if( startsWith(in.telNo,"44"), 
	do ( 
		$priceBand = "NATIONAL", 
		$rate = 0.03 
	)
)

This example shows how to use a do() function if you want to process several expressions (a script) based on the result of an if(). Note that the $-Variables $priceBand and $rate are only set if in.telNo starts with "44".

...

Note the layout in the last example. Consistent formatting of your scripts like this can help clarify where the "else" script starts. Also see Expression Style.

See Also