Skip to main content
insightsoftware Documentation insightsoftware Documentation
{%article.title%}
Published:
Was this article helpful?
0 out of 0 found this helpful

ShowFileChooser

Use this Longview Application Framework function in a procedure document to display a customizable prompt that allows users to select a file. This function is specific to Longview Apps. You can use ShowFileChooser to specify the following:

  • the button options
  • the label for the file chooser
  • the parameters of the file chooser

Note: You must use the ShowFileChooser function with Set Variable to set the value to the variable to which the function will be returning data. See the syntax example below. You cannot user the ShowFileChooser function in batch mode.

Syntax:

SHOWFILECHOOSER (Button, "Label", "FileRestrictions", "BrowseType", "defaultPath", "initial")

where:

  • Button is the set of buttons to display and can be OK or OKCancel. OK displays a single OK button; OKCancel displays both an OK button and a Cancel button. The lvs_buttonClicked variable is populated by the button clicked in the File Chooser.

    Note: In Longview Designer, OK is the only valid button option for data import apps.

  • Label is the label to display for the file chooser, enclosed in double quotation marks. If you want to omit this parameter, use two double quotation marks ( "" ).
  • FileRestrictions is a list of file type and extension pairs allowed for selection, enclosed in double quotation marks. Separate each file type and extension with a pipe ( | ). If you want to allow all file types, use two double quotation marks ( "" ).
  • BrowseType specifies the title for the browse dialog that opens when users click the folder icon in the file chooser, can be Open or Save, enclosed in double quotation marks.
  • defaultPath is the default path selected for the browse dialog, enclosed in double quotation marks. If you want to display the user’s current directory, use two double quotation marks ( "" ).
  • initial is the initial file selected in the browse dialog that opens when users click the folder icon in the File Chooser, enclosed in double quotation marks. If you don’t want a file selected initially, use two double quotation marks ( "" ).

Syntax example:

CREATE VARIABLE sFilePath AS String

Set Variable sFilePath = SHOWFILECHOOSER (OK, "Select a File:", "csv file|*.csv|text file|*.txt", Open, "C:\temp", "C:\temp\myfile.txt")

Published:

ShowFileChooser

Use this Longview Application Framework function in a procedure document to display a customizable prompt that allows users to select a file. This function is specific to Longview Apps. You can use ShowFileChooser to specify the following:

  • the button options
  • the label for the file chooser
  • the parameters of the file chooser

Note: You must use the ShowFileChooser function with Set Variable to set the value to the variable to which the function will be returning data. See the syntax example below. You cannot user the ShowFileChooser function in batch mode.

Syntax:

SHOWFILECHOOSER (Button, "Label", "FileRestrictions", "BrowseType", "defaultPath", "initial")

where:

  • Button is the set of buttons to display and can be OK or OKCancel. OK displays a single OK button; OKCancel displays both an OK button and a Cancel button. The lvs_buttonClicked variable is populated by the button clicked in the File Chooser.

    Note: In Longview Designer, OK is the only valid button option for data import apps.

  • Label is the label to display for the file chooser, enclosed in double quotation marks. If you want to omit this parameter, use two double quotation marks ( "" ).
  • FileRestrictions is a list of file type and extension pairs allowed for selection, enclosed in double quotation marks. Separate each file type and extension with a pipe ( | ). If you want to allow all file types, use two double quotation marks ( "" ).
  • BrowseType specifies the title for the browse dialog that opens when users click the folder icon in the file chooser, can be Open or Save, enclosed in double quotation marks.
  • defaultPath is the default path selected for the browse dialog, enclosed in double quotation marks. If you want to display the user’s current directory, use two double quotation marks ( "" ).
  • initial is the initial file selected in the browse dialog that opens when users click the folder icon in the File Chooser, enclosed in double quotation marks. If you don’t want a file selected initially, use two double quotation marks ( "" ).

Syntax example:

CREATE VARIABLE sFilePath AS String

Set Variable sFilePath = SHOWFILECHOOSER (OK, "Select a File:", "csv file|*.csv|text file|*.txt", Open, "C:\temp", "C:\temp\myfile.txt")

For an optimal Community experience, Please view on Desktop