PATH CURRENT,CURR_PATH PACK WORK_PATH,CURR_PATH,"\*.txt" MY_DataList.DIR USING *FileSpec=WORK_PATH: *Flags=DDL_READWRITE
........................... . Example . MYFILE FILE FILENAME DIM 250 OPEN MYFILE, "ZZDATA" GETFILE MYFILE, TXTNAME=FILENAME IF ZERO DISPLAY "File name is ",*HON,*LL,FILENAME,*PL,*HOFF ELSE DISPLAY "File is NOT OPEN" ENDIFSelected Keywords from the Sunbelt Visual PL/B manual. (There are lots more)
ISINAME={svar} qualified (with path) ISI file name. MODE={nva} opened: 0=Not Defined, 1=EXCLUSIVE, 2=SHARE, 3=READ, 4=SHARENF. PRTNAME={svar} name stored for a PFILE. TXTNAME={svar} qualified (with path) text file name.Check the manual for information relating to COMFILEs, PFILEs, etc.
OPEN ISIFILE,"NAME" GETFILE FILEFORMAT=NWK03The language ref says the FILEFORMAT value contains bits with the following meaning
0x1 0000 0001 IFILE 0x2 0000 0010 AFILE 0x10 0001 0000 version 9.0x format 0x20 0010 0000 version 8.7x format 0x40 0100 0000 the ISI file supports file larger than 4BG.The GETFILE FILEFORMAT should be given a 3 digit FORM field for the return value. That's because you're going to get a decimal number which could range from 0 to 255 (8 bit binary value).
TEST_ISI_FILE IFILE NWK03 FORM 3 INT1 INTEGER 1 WORK01 DIM 1 . OPEN TEST_ISI_FILE,"TESTFILE" GETFILE TEST_ISI_FILE, FILEFORMAT=NWK03 MOVE NWK03, INT1 . MOVE INT1, WORK01 AND 0x1, WORK01 IF NOT ZERO ..... I file ENDIF . MOVE INT1, WORK01 AND 0x2, WORK01 IF NOT ZERO ..... A file ENDIF . MOVE INT1, WORK01 AND 0x10, WORK01 IF NOT ZERO ..... 9.x ISI ENDIF . MOVE INT1, WORK01 AND 0x20, WORK01 IF NOT ZERO ..... 8.7 ISI ENDIF . MOVE INT1, WORK01 AND 0x40, WORK01 IF NOT ZERO ..... allows 4GB files ENDIF
GETFNAME TYPE=OPEN_MODE: PROMPT_STRING: FILE_NAME: FILE_PATH: FILTER_STRING
OPEN_TYPE FORM 2 MOVE "1" to OPEN_TYPE GETFNAME TYPE=OPEN_TYPEThe GETFNAME open TYPE table is as follows:
MODE DIALOG TYPE OPEN Standard open dialog PREP Standard prep dialog TYPE=1 Standard open dialog TYPE=2 Standard prep dialog TYPE=17 Open dialog with user filter TYPE=18 Prep dialog with user filter. TYPE=33 Open dialog with multi-select feature. TYPE=34 Prep dialog with multi-select feature. TYPE=49 Open dialog with filter and multi-select. TYPE=50 Prep dialog with filter and multi-select.
3. When {mode} identifies employment of a user filter, the string format requires {info} and {filter} pairs to follow the extension which are then passed to the Open or Prep dialogs. The {type} string format is as follows:Here's what that translates to in real-world usage:
{ext}[,{info1},{filter1}[,{info2},{filter2}]...]
Where:
- {ext} Identifies the default extension used when no name filtering is provided.
- {info1} First information/comment string presented and associated with the file filter which follows it.
- {filter1} First file filter which can be one or more files separated by the semicolon character. The file names can be specific or partial names and include wildcard characters. When a user selects the {info1} identifier, only those files which conform to the filter appear in the dialog presentation window.
OPEN_TYPE FORM 2 MOVE "1",OPEN_TYPE GETFNAME TYPE=OPEN_TYPE .... or GETFNAME TYPE=1 .... or GETFNAME TYPE=OPEN ....
1 = open 2 = prep 17 = open 18 = prep 33 = open 34 = prep 49 = open 50 = prep
1, 2, 17 and 18 do NOT allow multi-select 33, 34, 49 and 50 DO allow multi-select
17 Open with filter 18 Prep with filter 49 Open with filter and multi-select 50 Prep with filter and multi-select
PACK FILTER_STRING WITH "": ",Picture Files,*.tif;*.jpg;*.bmp": ",BGT Text File,*.txt": ",Source code,*.pls;*.plf": ",Programs,*.plc;*.exe" MOVE " ",FILE_NAME ;Insure it's not NUL GETFNAME TYPE=17: ;open dialog, with filter "Select a file": ;prompt FILE_NAME: ;file name return string "C:\MMCC-WWW\BARGAINT": ;starting path to look in FILTER_STRINGThe effect of the filter strings is to give the user a collection of views to the folders. Each of your filter strings will be added to a combo box at the bottom of the OPEN dialog screen. Look at the example below. You'll see the Files of type combo is expanded and it shows the description of each of our filters.
CONTENTS Home v1.10 |
Send e-mail to MMCC.
Write to MMCC Technical Support at: MMCC, Inc. 600 W. Midland Bay City, MI 48708 (989) 686-8860 Report problems or suggestions to support@mmcctech.com Originally Written 09/14/1998 |