/* All user scripts should derive from the base "Application" class */ require ("Application"); /* Get the Gamma library functions and methods for ODBC and/or * Windows programming. Uncomment either or both. */ //require ("WindowsSupport"); //require ("ODBCSupport"); /* Applications share the execution thread and the global name * space, so we create a class that contains all of the functions * and variables for the application. This does two things: * 1) creates a private name space for the application, and * 2) allows you to re-load the application to create either * a new unique instance or multiple instances without * damaging an existing running instance. */ class DArray Application { } /* Use methods to create functions outside the 'main line'. */ method DArray.samplemethod () { } /* Write the 'main line' of the program here. */ method DArray.constructor () { //CREATE AND INITIALIZE BOTH 1D ARRAYS local myArray1 = array(); local myArray2 = array(); myArray1[0] = 1; myArray1[1] = 2; myArray2[0] = 3; myArray2[1] = 4; //INITIALIZE THE 2D ARRAY FROM THE FIRST TWO local my2dArray = array(myArray1, myArray2); //PRINT THE ENTIRE ARRAY AND EACH ELEMENT princ("Full Array - ", my2dArray, "\n"); princ("Element 0,0 - ", my2dArray[0][0], "\n"); princ("Element 0,1 - ", my2dArray[0][1], "\n"); princ("Element 1,0 - ", my2dArray[1][0], "\n"); princ("Element 1,1 - ", my2dArray[1][1], "\n"); } /* Any code to be run when the program gets shut down. */ method DArray.destructor () { } /* Start the program by instantiating the class. If your * constructor code does not create a persistent reference to * the instance (self), then it will be destroyed by the * garbage collector soon after creation. If you do not want * this to happen, assign the instance to a global variable, or * create a static data member in your class to which you assign * 'self' during the construction process. ApplicationSingleton() * does this for you automatically. */ ApplicationSingleton (DArray);