For example, the following code initializes the variable mydate to a test date or the current date, depending on the value of the doTest variable:var doTest : boolean = true;
var dateFn : String;
if(doTest)
   dateFn = "Date(1971,3,8)";
else
   dateFn = "Date()";var mydate : Date;
eval("mydate = new "+dateFn+";");
print(mydate);The output of this program is:Thu Apr 8 00:00:00 PDT 1971