Custom Search

Friday, October 3, 2008

Loads multiple giumaps into an array

#GUIMAPS
static guiname1 = "MMAQ_guimap.gui";
static guiname2 = "SSPicker_guimap.gui";
static guiname3 = "TradeEntry.gui";
static guiLoad[] = {guiname1, guiname2, guiname3}

Then I just call the function:
#LOAD GUIMAP FILES VIA THE LOAD GUIMAP FUNCTION (this closes ALL open guimaps)
rc = loadGui(guiLoad);
if (rc != "Pass") #Check success of the Gui_Load
{
tl_step("Guiload",FAIL,"Failed to load Guimap(s)for "&testname(getvar));
#This line to test log
texit("Failed to load Guimap(s)for "&testname(getvar));
}

public function loadGui(inout guiLoad[])
{
static i;
static rc;

# close any temp GUI map files
GUI_close("");
GUI_close_all();

for(i in guiLoad)
{
rc = (GUI_load(GUIPATH & guiLoad[i]));
if ((rc != 0) && (rc != E_OK)) #Check the Gui_Load
{
return ("Failed to load " &guiLoad[i]);
}
}
return ("Pass");
}

No comments: