# This constant uses a compiler method to initialize its value.
data<string> const StartupName = CompilerConcatNames(3,'a','b','c')
# This method is used at compile-time and concatenates three names based on type id.
public compiler method<string> CompilerConcatNames(int Type, string Name1, string Name2, string Name3)
{
data<string> Return
# Concatenate the string based on the type. This logic is done at compile-time.
branch ( Type )
{
when ( 1 )
{
Return = Name1 + ' ' + Name2 + ' ' + Name3
}
when ( 2 )
{
Return = Name1 + ' ' + Name3
}
when ( 3 )
{
Return = Name3 + ", " + Name1
}
else
{
Return = CompilerStrUpr(Name3)
}
}
return(Return)
}
# This class is used to startup the script.
public class Main from<Thread>
{
public method Main()
{
Thread() # Must invoke base constructor.
}
public virtual method Run
{
data<string> Name
# The 'branch' statement can also used strings and ranges.
branch ( StartupName )
{
when ( 'a c' )
{
Name = "c, a"
}
when ( 'c, a' )
{
Name = "a c"
}
when ( 'D'..'Z' )
{
Name = StartupName.Lwr()
}
else
{
Name = "Aztec"
}
}
Script().WriteLog("And the name is... " + Name)
return
}
}