** Loads all VCX's in the Classes folder into an array HIDDEN PROCEDURE _GetClasslibs() ** Define variables LOCAL aFiles[1] AS String LOCAL iFile AS Integer LOCAL iTotFiles AS Integer LOCAL sClassLibrary AS String WITH This ** Populate an array with the names of all the class libraries ** in the Classes subfolder iTotFiles = ADIR(aFiles, ADDBS(._sDevLoc) + "classes\*.vcx") ** Size the array property enough to hold all the library names DIMENSION ._aClassLibraries[iTotFiles] ** Loop once for each class library FOR iFile = 1 TO iTotFiles ** Form the path and name of the class library sClassLibrary = LOWER(ADDBS(._sDevLoc)+ "classes\" + aFiles[iFile, 1]) ** Add the class library to the array of class libraries ._aClassLibraries[iFile] = sClassLibrary ENDFOR ENDWITH ENDPROCThen I do this to SET CLASSLIB:
** Loads all VCX's in the Classes folder into an array PROCEDURE LoadClassLibraries() ** Define variables LOCAL iLibrary AS Integer LOCAL sLibrary AS String WITH This ** Close all open libraries SET CLASSLIB TO ** If the class library array has not been loaded... IF TYPE("._aClassLibraries[1]") = "L" ** Call the method to load the class library array ._GetClasslibs() ENDIF ** Loop once for each library FOR iLibrary = 1 TO ALEN(._aClassLibraries, 1) ** Extract the library name from the array sLibrary = ._aClassLibraries[iLibrary] ** Open the class library SET CLASSLIB TO (sLibrary) ADDITIVE ENDFOR ENDWITH ENDPROCIn runtime, I get "Invalid subscript reference" because there are no classlibs to load in the client location.