RPR GetUserFileNameForRead

From CockosWiki

(Difference between revisions)
Jump to: navigation, search
(Python)
(Examples)
 
(3 intermediate revisions not shown)
Line 2: Line 2:
=GetUserFileNameForRead()=
=GetUserFileNameForRead()=
'''bool GetUserFileNameForRead(char* filename, const char* title, const char* defext)'''
'''bool GetUserFileNameForRead(char* filename, const char* title, const char* defext)'''
 +
 +
Displays a standard Windows Open File dialogue box allowing the user to choose an existing file. It returns results in an array, documented below.
==Parameters==
==Parameters==
Line 29: Line 31:
==Examples==
==Examples==
-
==C++==
+
===C++===
-
<pre>
+
<source lang=cpp>
-
</pre>
+
</source>
 +
 
 +
 
===Perl===
===Perl===
-
<pre>
+
<source lang=perl>
-
#
+
# GetUserFileNameForRead.pl
-
# GetUserInput.pl
+
#
#
Line 41: Line 44:
use warnings;
use warnings;
-
use constant TITLE => "GetUserInputs";
+
my ($result, $filename, $title, $defext);
-
use constant NUM_INPUTS => 2;
+
 
-
use constant CAPTIONS_CSV => "Caption 1,Caption 2";
+
$title = "Go Mad, Choose a file...";
-
use constant MAX_RETVAL_LEN => 10;
+
$defext = '*';
 +
 
 +
($result, $filename, undef, undef) = RPR_GetUserFileNameForRead($filename, $title, $defext);
-
my $retvals_csv = "one,two";
+
RPR_ShowConsoleMsg("$result, $filename");
 +
</source>
-
my @response = RPR_GetUserInputs(TITLE, NUM_INPUTS, CAPTIONS_CSV, $retvals_csv, MAX_RETVAL_LEN);
 
-
RPR_ShowConsoleMsg("retvals_csv $retvals_csv\n");
 
-
RPR_ShowConsoleMsg("\n");
 
-
RPR_ShowConsoleMsg("response @response\n");
 
-
RPR_ShowConsoleMsg("\n");
 
-
RPR_ShowConsoleMsg("response[4] $response[4]\n");
 
-
RPR_ShowConsoleMsg("\n");
 
-
</pre>
 
===Python===
===Python===
-
<pre>
+
<source lang=python>
-
</pre>
+
</source>
==See Also==
==See Also==

Latest revision as of 09:55, 29 January 2010

Main Page > REAPER Documentation > ReaScript > ReaScript API, Functions > RPR GetUserFileNameForRead
Main Page > REAPER Documentation > REAPER API > REAPER API Functions > RPR GetUserFileNameForRead

Contents

GetUserFileNameForRead()

bool GetUserFileNameForRead(char* filename, const char* title, const char* defext)

Displays a standard Windows Open File dialogue box allowing the user to choose an existing file. It returns results in an array, documented below.

Parameters

TypeNameDescription
char*filenameThe default filename displayed by the dialogue box to the user.
const char*titleThe title of the Windows dialogue box.
const char*defextThe default file extension for the Windows dialogue box.

Returns

An array or list, the elements of which are:

TypeNameDescription
booleanresult1 if user pressed ok, 0 if user pressed cancel
char*filenameThe filename chosen by the user.
const char*titleThe title of the Windows dialogue box, this can be ignored.
const char*defextThe default file extension for the Windows dialogue box, this can be ignored.

Examples

C++

 


Perl

# GetUserFileNameForRead.pl
#
 
use strict;
use warnings;
 
my ($result, $filename, $title, $defext);
 
$title = "Go Mad, Choose a file...";
$defext = '*';
 
($result, $filename, undef, undef) = RPR_GetUserFileNameForRead($filename, $title, $defext);
 
RPR_ShowConsoleMsg("$result, $filename");


Python

 

See Also

Stuff

Main Page > REAPER Documentation > ReaScript > ReaScript API, Functions > RPR GetUserFileNameForRead
Main Page > REAPER Documentation > REAPER API > REAPER API Functions > RPR GetUserFileNameForRead

Personal tools