SelectURL Method

Measurement Studio User Interface

SelectURL Method

Syntax

CWBinding.SelectURL ( [startURL] [, Title] [, Options] [, Filters])

Return Type

Boolean

Returns True if you selected a data item; False if the user cancelled. If True, the URL property is set to the URL that the user selected.

Purpose

Enables interactive browsing and selection of data items and files on DataSocket and OPC servers. With this method you can easily create data URLs, rather than constructing the URLs yourself, or display a simple text box in which you can enter HTTP and FTP URLs.

Parameters

startURL As Variant

[Optional] String containing the URL. If startURL is "opc:", "dstp:", or "file", this method opens an OPC server browser, DataSocket server browser, or a file browser to enable users to interactively find and select data items. You can prompt users to create a Web or FTP location with the "http:" or "ftp:" URL schemes. If you omit this parameter, a simple text box is opened, and users can enter a URL with a different scheme. You also can use an entire URL, such as "dstp://localhost/wave".

Title As Variant

[Optional] Title of the SelectURL dialog box.

Options As Variant

[Optional] Flags to pass to the dialog:

0x00002000 (CREATEPROMPT): Opens a dialog box to prompt the user for permission to create the file if that file does not already exist. If the user chooses to create the file, the dialog box closes and the function returns the specified name; otherwise, the dialog box remains open.

0x00001000 (FILEMUSTEXIST): Specifies that the user can type only names of existing files in the File Name entry field. If this flag is specified and the user enters an invalid name, the dialog box procedure displays a warning in a message box.

0x00000004 (HIDEREADONLY): Hides the Read Only check box.

0x00000008 (NOCHANGEDIR): Restores the current directory to its original value if the user changed the directory while searching for files.

0x00100000 (NODEREFERENCELINKS): Directs the dialog box to return the path and filename of the selected shortcut (.LNK) file. If this value is not given, the dialog box returns the path and filename of the file referenced by the shortcut.

0x00008000 (NOREADONLYRETURN): Specifies that the returned file does not have the Read Only check box checked and is not in a write-protected directory.

0x00010000 (NOTESTFILECREATE): Specifies that the file is not created before the dialog box is closed. This flag should be specified if the application saves the file on a create-nonmodify network share. When an application specifies this flag, the library does not check for write protection, a full disk, an open drive door, or network protection. Applications using this flag must perform file operations carefully, because a file cannot be reopened once it is closed.

0x00000002 (OVERWRITEPROMPT): Causes the Save As dialog box to generate a message box if the selected file already exists. The user must confirm whether to overwrite the file.

0x00000800 (PATHMUSTEXIST): Specifies that the user can type only valid paths and filenames. If this flag is used and the user types an invalid path and filename in the File Name entry field, the dialog box function displays a warning in a message box.

0x00000001 (READONLY): Causes the Read Only check box to be checked initially when the dialog box is created.

0x00000020 (SAVEAS): Causes the file dialog to be a Save As file dialog, rather than an Open file dialog.

Filters As Variant

[Optional] Filter string to pass to the dialog. For example, All Files(*.*)|*.*

Example

'Create a reference to a CWBinding object
'on CWGraph1
Dim Binding As CWBinding
Set Binding = CWGraph1.CWBindings.Item(1)

'Browse for an OPC item
Binding.SelectURL "opc:"

'Browse for a file
Binding.SelectURL "file:"

'Select an entire URL
Binding.SelectURL "dstp://localhost/wave"

See Also

URL