LookUp File

Discussions about CSEntry
Gregory Martin
Posts: 1796
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: LookUp File

Post by Gregory Martin »

You can create a value set with alphanumeric variables. This is done in the Metro Survey, which is available here: http://www.csprousers.org/beta/MetroSurvey.7z

Maybe it wasn't working for you because I'm assuming that a2011RosterCodes is a numeric array. To use a dynamic value set for an alpha variable you have to pass the setvalueset function two alpha arrays. Going back to the Metro Survey, we use the same array for the display labels, and for the actual codes:
PROC COMMUTE_STARTING_STATION

onfocus

    
// slightly modified from the version on the Internet
    ctr = 0;

    
locate(STATIONS_DICT,>=,"");

    
while loadcase(STATIONS_DICT) do
        vsLabels(ctr) = STATION_NAME;
        
inc(ctr);
    
enddo;

    vsLabels(ctr) =
""; // end the dynamic alpha value set

    
setvalueset(COMMUTE_STARTING_STATION,vsLabels,vsLabels);

    
setcapturetype(COMMUTE_STARTING_STATION,1); // radio buttons
Regarding your second question, you could indeed create an array, first filling it with the names from 2011 (coming from NAME_OLD), and then followed by the newly entered names. You can put whatever you want in an array, so you can mix and match from various sources.
Post Reply