require ("Application"); class ExportTags Application { // An array containing all domains that should be exported, if only one domain // should be exported the array will only contain a single entry domainsToExport = array("default","default2"); // The direcotry where the export files should be created exportFilePath = "C:\\users\\mholbach\\desktop\\"; // The base of the file name - will be appended with _ exportFileBase = "exportFile"; // The extension on the export file exportFileType = ".txt"; } /* Write the 'main line' of the program here. */ method ExportTags.constructor () { // Loop through the array of domains with domain in .domainsToExport do { // Read all points from the domain local arrayOfPoints = datahub_points(domain); // If we can open the export file if ((fw = open(string(.exportFilePath,.exportFileBase,"_",domain,.exportFileType), "w", nil)) != nil) { // Loop through all points in the array with point in arrayOfPoints do { // Write the point name to file writec(fw, string(point.name,"\n")); } close(fw); } else { princ("Error opening file ",string(.exportFilePath,.exportFileBase,"_",domain,.exportFileType)," for writing.\n"); } } } /* Any code to be run when the program gets shut down. */ method ExportTags.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 (ExportTags);