Just testing out some of the new LiteC features, using an array of PANEL*:

// DEFINES FOR PANEL INDICES...
#define NEW_OR_LOAD 0
#define GAME_OPTIONS 1
#define INVENTORY 2
...
// Array to hold PANEL* handles...
var panelList[ LIST_SZ ];

...

function createPanelList(var* panels)
{
PANEL* selection1 = {
pos_x = 0; pos_y = 0;
digits(10,10,1,*,1,1);
flags = VISIBLE;
}

PANEL* selection2 = {
pos_x = 0; pos_y = 0;
digits(10,10,1,*,1,2);
flags = VISIBLE;
}

PANEL* selection3 = {
pos_x = 0; pos_y = 0;
digits(10,10,1,*,1,3);
flags = VISIBLE;
}

// Hide last 2 panels...
toggle(selection2,VISIBLE);
toggle(selection3,VISIBLE);

// Fill array with PANEL* objects ...
panels[ NEW_OR_LOAD ] = handle( selection1 );
panels[ GAME_OPTIONS ] = handle( selection2 );
panels[ INVENTORY ] = handle( selection3 );
}

function main()
{
...
createPanelList( panelList );
...
}

The point here is, I really like to avoid needless globals... sure they're easy to work with, but can cause problems later. In the above example, only the array containing the PANEL*s is global, while all the details of the actual PANEL* objects are only visible where needed. Without the LiteC array features this wouldn't be possible.

However, I did realize something else. It seems the engine types (PANEL*, BMAP*, etc.) are different than vars, in the sense that they are brought into existence in the engine, thus don't loose there scope like vars. If they did loose scope, then even the above code would not work, because the PANEL handles stored in the array would no longer point to valid objects (PANEL*s) after leaving createPanelList().