Hi,
If you have renamed the workbook or worksheet with the data file name when you import data, you can use the %H string register to get the active window title or wks.name$ to get the worksheet name.
getnumber (%H) i:P (Filter Type);
or
getnumber (%(wks.name$)) i:P (Filter Type);
Also, you can use the string defined by yourself.
string myStr$ = "MySample";
getnumber (%(myStr$)) i:P (Filter Type);
For accessing the variable defined inside case:{}, The "later on" means outside the "switch"? If so, with the braces for each case, you need to use the @global to force global scope.
switch (i)
{
case 1:
{ // in braces
@global = 1; // begin global scope
string str = "string defined in case 1";
@global = 0; // end global scope
type "000";
break;
}
case 2:
{ .
.
.
}
// other cases...
}
str$ = ; // can get the string defined in case 1
Penn