Name=Open:
When using Name=Open: BR will prompt the operator to select a file, and then open the file using the Windows API.
In the following example, an Open File Dialog Box will open, and will open to the "Last Selected Folder", Name Open: has memory, and will remember file history and default file location.
Component | Description |
---|---|
NAME=Open: | instructs BR to open a Open File Dialog Box. |
text documents (*.txt) | Defines the Label for the Filter Combo box (Lower Right Corner). |
The Pipe is a separator. | |
*.txt | This is the actual filter that will be used when displaying files. |
00010 open #1: "name=OPEN:text documents (*.txt) |*.txt,recl=1,shr",external,input ioerr 100 00020 print File$(1) 00030 close #1: 00100 print "Operation Canceled: Err=";Err 00200 XIT: !
@: or @:: is needed when using file dialogs with client server. The file dialog runs on the client side and doesn't have access to server side files - except through windows networking.
Client Server Sample:
00010 open #1: "name=OPEN:@:text documents (*.txt) |*.txt,recl=1,shr",external,input ioerr 100 00020 print File$(1) 00030 close #1: 00100 print "Operation Canceled: Err=";Err 00200 XIT: !
@: instructs the program to use the "Client Default Folder" as the default folder.
@:: instructs the program to use the "A Client Folder" as the default folder.
It is possible to specify a specific folder as well as specify multiple filters.
The following example, will display all ".ini" files as well as ".txt" files in the C:\Windows folder.
Remember that @: & @:: are required for Client Server.
Component | Description |
---|---|
NAME=Open: | instructs BR to open a Open File Dialog Box. |
C:\Windows\ | The Windows Path, it is important to include the final "\" and not include any filters |
Space Between \ & the Filter Combo Box Description. This is not required, but may aid in understanding the syntax. | |
Text Files (*.ini;*.txt) | Filter Combo Box Description - Will be displayed in the Combo Box Filter. (Optional). |
The Pipe is a separator. | |
*.ini;*.txt | This is a list of actual filters that will be used when displaying files. Delimit the list with a ";" |
00010 OPEN #1: "name=OPEN:C:\Windows\ Text Files (*.ini;*.txt)|*.ini;*.txt,recl=1,shr",EXTERNAL,INPUT IOERR 100 00020 PRINT File$(1) 00030 CLOSE #1: 00100 PRINT "Operation Canceled: Err=";Err 00200 XIT: !
This is a much less complicated Sample that simply allows the user to pick an "Ini" file from the C:\Windows Folder.
00010 OPEN #1: "name=OPEN:C:\Windows\*.ini,recl=1,shr",EXTERNAL,INPUT IOERR 100 00020 PRINT File$(1) 00030 CLOSE #1: 00100 PRINT "Operation Canceled: Err=";Err 00200 XIT: !