IonicWind Software

IWBasic => GUI Central => Topic started by: jerryclement on August 30, 2007, 05:51:09 AM

Title: FileRequest Syntax
Post by: jerryclement on August 30, 2007, 05:51:09 AM
 ???

I need help!  I'm trying to have FileRequest open to a particular directory. Initdir looks like it should do this: (from help file)

FILEREQUEST

STRING = FILEREQUEST(title as STRING,parent as POINTER,nOpen as INT,OPT filter as STRING,OPT ext as STRING,OPT flags as INT,OPT initdir as STRING)

Description
Opens the standard file dialog and returns a string containing the fully qualified pathname to the user-selected file. For a â€ËÅ"Save as’ dialog nOpen should be 0. For an â€ËÅ"Open’ type dialog nOpen should be 1.

Parameters
title - Title of the file dialog
parent - Parent window or dialog, can be NULL
nOpen - Open dialog specifier.
filter - Filter string
ext - Default extension
flags - Additional style flags
initdir - Initial directory

================================================
I have tried all types of syntax methods and all I get is syntax error.

This is the last one I tried copied from someone's coding:
Filter$ = "Dictionary files|*.dic||"
filename = filerequest("Load DICTIONARY",win,1,Filter$,"",(),"C:\\Program files")

I don't want a multi-file dialog if possible.

Thanks ahead for anyone helping.

Jerry C.
Title: Re: FileRequest Syntax
Post by: Ionic Wind Support Team on August 30, 2007, 06:13:38 AM
filename = filerequest("Load DICTIONARY",win,1,Filter$,"",0,"C:\\Program files")

You were close.  Don't know where the ( ) came from for "flags". 
Title: Re: FileRequest Syntax
Post by: jerryclement on August 30, 2007, 06:50:51 AM
 ;D
Thanks Paul, the zero did it - must have been my lousy eyesight!

Question:  Whenever there is an "OPT" parameter, can we directly substitute a null or no OPT desired by inserting a nothing for the DATATYPE?

I'm not clear when to or not, sometimes I see just ,, double commas to bypass a parameter and sometimes just omit the parameter?

Jerry C.
Title: Re: FileRequest Syntax
Post by: Ionic Wind Support Team on August 30, 2007, 07:06:45 AM
In Emergence you need the parameter if you are specifying a later optional parameter.  "" works for strings and NULL for other parameters if you want to skip them.
Title: Re: FileRequest Syntax
Post by: jerryclement on August 30, 2007, 07:18:10 AM
Thank you!

Jerry C.