Sample With Strings And Signals
OnTrain()
{
if(Train.IsFollowed())
{
string str;
str="Train Passing: "+Train.GetNumber()+" passing signal.";
if(Train.GetSpeed()>5)
{
str=str+"Fast. ";
}
else
{
str=str+"Slow. ";
}
if(Signal.IsClear())
{
str=str+"Signal Clear ";
}
if(!Signal.IsClear())
{
str=str+"Signal NOT Clear ";
}
signal NextSig;
NextSig=Signal.NextSignal();
if(NextSig.IsOn())
{
str=str+"Next signal is on. ";
}
Display(str);
}
}
import