Jump to content
Developer Wiki and Function Reference Links ×

GetFileN


Sam Jones

Recommended Posts

How do I use GetFileN?  It is defined in the custom reference as:

FUNCTION GetFileN(title:STRING,

                                    defaultFolder:STRING,

                                    mask:STRING,

                                    VAR filename:STRING)

1. What is "title"

2. What is the “mask”

I want to specify the folder that is displayed when GetFile() is used.  I had hoped to do it with GetFileN()

TIA (yet again).

Sam

 

Link to comment

defaultFolder is the Posix path to the folder you are interested in. Easiest way in many cases to get this is to use the GetFolderPath() with the proper code for the folder you are interested in. On the Mac this will give you back an HFS path (departed with colons (:))  Run this through the ConvertHSF2PosixPath command (note the misspelling of HSF not HFS.)

 

If you want to build the path yourself you can access the root level of the disk with just '/'.  To access my Desktop folder I used '/Users/Pat/Desktop'

 

Procedure Test;

Var S1:String;
	B1:Boolean;
	S2:String;


Begin
B1:=ConvertHSF2PosixPath(GetFolderPath(-15),S2);
AlrtDialog(S2);
B1:=GetFileN('Dialog Title',S2,'txt;vwx',S1);

End;

Run(Test);

 

mask is a list of file extensions that you want to be selectable separated by semicolons (;)

 

'vwx' will return just Vectorworks files. 'vwx;txt' will return all Vectorworks files and all TXT files as selectable in the dialog.

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...