Using the code below I offer the user the choice of 4 products to analyse.
I use an if statement to open the correct file for the correct product.
I also assign a number for a variable I will need at a later date.
When I attempt to print this variable I get an error saying Name Unresolved at line 18.
It appears time_mult is somehow not being properly defined.
win = New Window( "Product Choice",
<<Modal,
<<On Validate(x = cb<<Get(),
If(x == 1, y="File Path 1" ; time_mult=24,
x == 2, y="File Path 2" ; time_mult=168,
x == 3, y="File Path 3" ; time_mult=168,
x == 4, y="File Path 4" ; time_mult=168,
);
),
cb = Combo Box(
{"Product 1", "Product 2", "Product 3", "Product 4"},
),
Button Box("OK"),
Button Box("Cancel"),
);
Print(x);
Print(y);
Print(time_mult);
The following test code works perfectly and seems to me to look almost identical. I was wondering if anyone can identify what's going wrong
win = New Window( "Combo Box",
<<Modal,
<<On Validate(x = cb<<Get();
If(x == 1, y="/H:/Example Folder/File 1.xlsx" ; z=5,
x == 2, y="/H:/Example Folder/File 2.xlsx" ; z=63,
Stop()
);
),
cb = Combo Box(
{"One", "Two"},
),
Button Box("OK"),
Button Box("Cancel"),
);
Print(x);
Print(y);
print(z);