FileForm File Form System Form1* LAB_FileName File &Name: LAB_Directories &Directories: TXT_TextBox LAB_CurrentDir FIL_Files DIR_Dirs LAB_Drives Dri&ves: BTN_Ok BTN_Cancel Cancel DRV_Drives LastChange @ Form_Load0 LAB_CurrentDir Caption| DIR_Dirs path\ HeightR FIL_Files Form_Unload Cancel TRUE' FileForm CancelOp ProcessFileSpecu filespec MsgBoxResponsep FALSE Pattern TXT_TextBox textk MB_YES HighLightTextBox SelStart, SelLength IsFileName- Indexe OldDir NewDir" BTN_Cancel_Click DIR_Dirs_Change DIR_Dirs_Click FIL_Files_Click2 filename FIL_Files_DblClickm BTN_OK_ClickJ FIL_Files_PathChange FIL_Files_PatternChange^ ListIndex TXT_TextBox_Change DRV_Drives_Change DRV_Drives Drive pdox1 LAB_FileName_Click LAB_Directories_Click LAB_CurrentDir_Click opnbtn_clickD openbtn_CLICK pdox1_openbtn_CLICK apName flddisp listcount7 PXInit PXSHARED PXTblClose pxtbl PXError tIndex pxname DBPATH PXOpen pxrec PXRecNFlds nFlds recdisp PXFldName fldname! pxFldType pxFType fldTextE PXRecFirst PXRecGet: remember what changed last Form_Load Show full path name in a label No controls have been modified Align Drives box to Files boxl Form_Unload Don't unload form, just hide it Notify Cardfile form of cancellationl ProcessFileSpec This function accepts a string which may be a directory name, a wildcard pattern, or a file name. The function returns TRUE if the string is a valid filename, and FALSE if the string is either an invalid filename or a directory specification. If the string specifies a directory, ProcessFileSpec() changes the current directory and updates the appropriate form controls. Note: This procedure expects FileForm's caption to be set to one of "File Save As", "File Open" or "File Merge" in order to prompt the user appropriately (eg - 'Replace existingd file?' during File Save As, or "File not found' duringn File Open/Merge). FileSpec is a filename or wildcard, not a dir Filename too long: ' Did user specify a new wildcard pattern? We're finished -- got a valid filename? File Open" File Merge No such file: Cardfile File Save As Replace existing " Cardfile FileSpec was just a directory name The user only specified a new drive (handled in IsFileName) HighLightTextBox IsFileName This function accepts FileSpec, a string, as input, thenm checks to see if the string is a valid file path/expression. If FileSpec is valid, and specifies a new drive, pattern and/or directory, the directory and file list boxes are notified.n If FileSpec contains a valid file name, the filename is placedr in the form's text edit box and IsFileName() returns a value of TRUE. If FileSpec does not contain a valid file name (ie, it contains directory name and/or a new file pattern and/or an invalid file/path expression), IsFileName() returns FALSE.n Remember current directory Does it specify new drive? Disk Error Separate path/filename, try againf Parse any directory info NewDir gets text to the left of & including FileSpec's first "\" FileSpec becomes the text to the right of the first "\"f Remove ending "\"f Invalid path: '" Cardfile Update file controls User specified a new, valid dir; update the file controls BTN_Cancel_Click DIR_Dirs_Change propogate directory changes to other controls DIR_Dirs_Click remember that the DIR_Dirs control changed FIL_Files_Click echo the selected name in the Text box FIL_Files_DblClick we have a final selection from the File Save dialogn FIL_Files_PathChange Show the current search pattern in the TXT_TextBox control FIL_Files_PatternChange BTN_OK_Click Text box control was last changedT Directory list control was last changedT TXT_TextBox_Change DRV_Drives_Change change the DIR_Dirs control path, it will pass the change on to the FIL_Files control