The purpose of this code is to get User input to generate a report. The User will select the Month and the type. The code partially works as shown but as soon as I try to convert it to a function that resides on another JSL file (called with an "include") it fails. I am not able to get the two variables returned and I always get a "Name unresolved" error. I know that Month returns as a list and that the type returns as a string (?). What I am missing and how can I get the Month and the type returned by the function.
Thanks!
Names Default To Here( 1 );
monthLst = {"may", "June", "July"};
nw = New Window( "Select Month",
<<modal,
Spacer Box( size( 25, 10 ) ),
H List Box(
V List Box(
Text Box( Trim( "Please select Month and Type" ) ),
Spacer Box( size( 10, 10 ) ),
tb2 = List Box( "source", width( 300 ), nlines( 10 ), maxSelected( 1 ) ),
tb2 << append( monthLst );
Spacer Box( size( 10, 10 ) ),
cb = Combo Box({"<Select type>","Accounting", "Financial"},
),
Spacer Box( size( 10, 10 ) ),
H List Box(
Align( left ),
Spacer Box(),
Button Box( "Cancel", bbCancelled = 1 ),
Button Box( "OK",
bbCancelled = 0;
selectMo = tb2 << Get Selected;
rcb = cb << Get Selected;
)
)
),
Spacer Box( size( 50, 10 ) )
),
Spacer Box( size( 25, 30 ) )
);
If( bbCancelled == 1,
Stop(),
If( selectMo == {},
//error modal
::dialogModalNoEdit( "Please select a Month." );
//recursively call modal window function
SelExpModal( monthLst );
,
//if values were selected return results
//Return(selectMo[1] ),
)
);
Print(selectMo);
Print(rcb);