Difference between revisions of "GETFILE()"

From Lianjapedia
Jump to: navigation, search
 
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Function to display an Open dialog allowing a filename to be selected and returned.
 
Function to display an Open dialog allowing a filename to be selected and returned.
 
  
 
==Syntax==
 
==Syntax==
GETFILE([<expC1>] [,<expC2>] [,<expC3>] [,<expN1>])
+
GETFILE([<expC1> [, <expC2> [, <expC3> [, <expN1> [, <expC4>]]]]])
 
+
  
 
==See Also==
 
==See Also==
 
[[GETDIR()]], [[LOCFILE()]], [[PUTFILE()]]
 
[[GETDIR()]], [[LOCFILE()]], [[PUTFILE()]]
 
  
 
==Description==
 
==Description==
 
The GETFILE() function displays an Open dialog allowing a filename to be selected and returned.  The dialog allows navigation through directories and shows a list of relevant files in that directory.  The cursor keys, Return key and tab key can be used to navigate the different sections under a character mode environment.  If the user selects a file, the GETFILE() function returns the name of that file.  If no file is selected, the GETFILE() function returns an empty string "".
 
The GETFILE() function displays an Open dialog allowing a filename to be selected and returned.  The dialog allows navigation through directories and shows a list of relevant files in that directory.  The cursor keys, Return key and tab key can be used to navigate the different sections under a character mode environment.  If the user selects a file, the GETFILE() function returns the name of that file.  If no file is selected, the GETFILE() function returns an empty string "".
  
 
+
{| class="wikitable" width="100%"
{| class="wikitable"
+
!width="25%"|Parameters||width="15%"|Required||Description
!Parameters||Required||Description
+
 
|-
 
|-
|<expC1>||No||A file extension skeleton.  If specified only files with this extension are shown
+
|valign="top"|<expC1>||valign="top"|No||A file extension skeleton.  If specified, only files with this extension are shown.  To allow the user to select a file type using the pulldown, multiple skeletons should be listed as follows:<br>"Visual FoxPro(*.prg);;Python(*.py);;JavaScript(*.js);;PHP(*.php);;"<br>Omit the final ';;' to prevent 'all files' from being selectable.
 
|-
 
|-
|<expC2>||No||The text to display at the top of the dialogIf not specified, 'Open' is displayed.
+
|valign="top"|<expC2>||valign="top"|No||The text to display for the File name labelThis is ignored, it is always labeled 'File name'.
 
|-
 
|-
|<expC3>||No||The text to display on the Ok button.  This is ignored, the button is always labeled 'Ok'.
+
|valign="top"|<expC3>||valign="top"|No||The text to display on the Open button.  This is ignored, the button is always labeled 'Open'.
 
|-
 
|-
|<expN1>||No||The buttons set to be displayed.  This is ignored, the buttons are always Ok, Cancel, Reset, Back and Help.
+
|valign="top"|<expN1>||valign="top"|No||The buttons to be displayed.  This is ignored, the buttons are always 'Open' and 'Cancel'.
 +
|-
 +
|valign="top"|<expC4>||valign="top"|No||The text to display at the top of the dialog.  If not specified, 'lianja' is displayed.
 
|-
 
|-
 
|}
 
|}
 
  
 
==Example==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
cProgramSelected = getfile("prg","Please select a program")
+
cScript = getfile("Visual FoxPro(*.prg);;Python(*.py);;JavaScript(*.js);;PHP(*.php)","","",0,"Select a script")
 
</code>
 
</code>
  
  
==Products==
+
 
Recital
+
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 +
[[Category:UI_Functions]]

Latest revision as of 06:23, 30 May 2013

Purpose

Function to display an Open dialog allowing a filename to be selected and returned.

Syntax

GETFILE([<expC1> [, <expC2> [, <expC3> [, <expN1> [, <expC4>]]]]])

See Also

GETDIR(), LOCFILE(), PUTFILE()

Description

The GETFILE() function displays an Open dialog allowing a filename to be selected and returned. The dialog allows navigation through directories and shows a list of relevant files in that directory. The cursor keys, Return key and tab key can be used to navigate the different sections under a character mode environment. If the user selects a file, the GETFILE() function returns the name of that file. If no file is selected, the GETFILE() function returns an empty string "".

Parameters Required Description
<expC1> No A file extension skeleton. If specified, only files with this extension are shown. To allow the user to select a file type using the pulldown, multiple skeletons should be listed as follows:
"Visual FoxPro(*.prg);;Python(*.py);;JavaScript(*.js);;PHP(*.php);;"
Omit the final ';;' to prevent 'all files' from being selectable.
<expC2> No The text to display for the File name label. This is ignored, it is always labeled 'File name'.
<expC3> No The text to display on the Open button. This is ignored, the button is always labeled 'Open'.
<expN1> No The buttons to be displayed. This is ignored, the buttons are always 'Open' and 'Cancel'.
<expC4> No The text to display at the top of the dialog. If not specified, 'lianja' is displayed.

Example

cScript = getfile("Visual FoxPro(*.prg);;Python(*.py);;JavaScript(*.js);;PHP(*.php)","","",0,"Select a script")