Use IOForms\filform.pkg Use IOForms\dirform.pkg Object SelectDatabasefile_dg is a ModalPanel Property Boolean pIs_Viewed Property String psSelectedFilenumber Property String[] psaFilenumbers Property String psDescriptionDir Set Label To "Select databasefile" Set Size to 138 281 Set Location To 6 6 Object cnt3DBox Is A Container3d Set Size To 110 276 Set Location To 2 2 Object lstDatabasefiles is a List Set Size To 103 269 Set Location To 2 2 Set Label_Col_Offset To 0 Set Label_Row_Offset To 1 Set Label_Justification_Mode To jMode_Top End_Object // lstDatabasefiles End_Object // cnt3DBox Object cmdSelect is a Button Set Label To "Select" Set Location To 118 60 Set Default_State To True Procedure OnClick Integer iSelected String[] sFilenumbers Get psaFilenumbers to sFilenumbers Get current_item of lstDatabasefiles to iSelected Set psSelectedFilenumber to sFilenumbers[iSelected] Send close_panel End_Procedure End_Object // cmdSelect Object cmdCancel Is A Button Set Label To "Cancel" Set Location To 118 170 Procedure OnClick Send close_panel End_Procedure End_Object // cmdCancel Procedure Activate_Group Integer iFound iActPos iFilenum iMaxSlots String sFileout sOutdir String sRootname sMessage sLogicalName sDisplayName String[] sFilenumbers Boolean bIsViewed bOldState Forward Send Activate_Group Set psSelectedFilenumber to "" Get pIs_Viewed to bIsViewed If (not(bIsViewed)) Begin Set pIs_Viewed to True Get Dynamic_Update_State of lstDatabasefiles to bOldState Set Dynamic_Update_State of lstDatabasefiles to False Send delete_data of lstDatabasefiles Get psDescriptionDir to sOutdir Get_Attribute DF_NUMBER_FILES_SUPPORTED to iMaxSlots Move (sOutdir + "\CODETYPE.NTI") To sFileout Get vFilePathExists sFileout To iFound If iFound Move "(Init) CODETYPE" To sMessage Else Move "CODETYPE" to sMessage Send add_item to lstDatabasefiles msg_None sMessage Move "CODETYPE" to sFilenumbers[0] Move (sOutdir + "\CODEMAST.NTI") To sFileout Get vFilePathExists sFileout To iFound If iFound Move "(Init) CODEMAST" to sMessage Else Move "CODEMAST" to sMessage Send add_item to lstDatabasefiles msg_None sMessage Move "CODEMAST" to sFilenumbers[1] Move 2 To iActPos // 20080313 **WvA: Use constant instead of hardwired upper filelist limit Move 1 to iFileNum While (iFileNum <= iMaxSlots) Get_Attribute DF_FILE_ROOT_NAME Of iFilenum To sRootname Get_Attribute DF_FILE_LOGICAL_NAME Of iFilenum To sLogicalName Get_Attribute DF_FILE_DISPLAY_NAME Of iFilenum To sDisplayName If (Trim(sRootname) <> "") Begin Move (sOutdir + "\" + sLogicalName + ".NTI") To sFileout Get vFilePathExists sFileout To iFound Move "#" To sMessage If iFound Move "(Init) #" To sMessage Append sMessage iFilenum ", " sRootname ", " sDisplayName ", " sLogicalName Send add_item to lstDatabasefiles msg_None sMessage Move (String(iFilenum)) to sFilenumbers[iActPos] Increment iActPos End // 20080313 **WvA: Return the next used slot instead of looping thru ALL entries. Get_Attribute DF_FILE_NEXT_USED of iFileNum to iFileNum If (iFileNum=0) Begin Move (iMaxSlots + 1) to iFileNum // We're done End Loop Set psaFilenumbers to sFilenumbers Set Dynamic_Update_State of lstDatabasefiles to bOldState End End_Procedure End_Object // vlgdb_vw