Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GETFILE() bug?

Status
Not open for further replies.

Neil Toulouse

Programmer
Mar 18, 2002
882
0
0
GB
Hi folks!

Have come across a pain of a scenario (VFP6).

I need to specify 22 extensions in the GETFILE() function, but it appears to throw a wobbly at exactly 22!

To see the effect:

Code:
= GETFILE( 'CSV;C01;C02;C03;F01;F02;F03;F04;F05;W01;W02;W03;W04;W05;W06;W07;W08;W09;W10;W11;W12;W13', '', 'Select', 0, 'Select File' )

...now remove the W13 extension:

Code:
= GETFILE( 'CSV;C01;C02;C03;F01;F02;F03;F04;F05;W01;W02;W03;W04;W05;W06;W07;W08;W09;W10;W11;W12', '', 'Select', 0, 'Select File' )

Is there a work around (except ugrading to VFP8 where it seems to work fine!!)?

TIA
Neil



I like work. It fascinates me. I can sit and look at it for hours...
 
Neil,

Don't have an answer for you, but some observations:

I see this odd behavior in VFP 9 (SP1), too, and cannot make it go away by first assigning the file extensions string to a variable! It doesn't seem to be tied to the number (22 or more) of extensions but the length of the string (more than 84 characters). If you change a couple of the extensions to two characters instead of three, you can get 22 extensions in the drop-down, but not the correct 22, so I realize that that won't solve your problem.

Teresa
 
Neil,

Following Teresa's suggestion, perhaps you could to something like this:

Code:
GETFILE('CSV;C0?;F0?;W0??', '', 'Select', 0, 'Select File' )

Not quite what you wanted to achieve, but close.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Hi Mike!

Thats is where I was thinking of going with it, and adding a check after the selection to see if a valid file had been selected (the extensions listed are the only valid ones for this application).

Thanks :)

Neil

I like work. It fascinates me. I can sit and look at it for hours...
 
>> It doesn't seem to be tied to the number (22 or more) of extensions but the length of the string (more than 84 characters).

According to the help file the length limit for the File Extension parameter in VFP 9.0 is 254 characters, not 84. So I don't think that can be the issue. However, there is no mention of any limit in previous versions of VFP so I am not sure if this represents a change, or if it was always this way.

However, I notice that the original string is using ";" as a spearator and, again according to the help file, the separator in lists of extensions should actually be a ",".

The ";" is defined as the separator for groups of extensions associated with a description.
i.e.
"Data Files:dbf,fpt,cdx;Text Files:txt,csv,xml;Other:bak"

What happens if you replace the ";" with "," ?


----
Andy Kramek
Visual FoxPro MVP
 
Hi Andy!

Swapping the ';' for ',' doesn't do anything, as in the dialogue doesn't even appear! (VFP6)

So I thought I would do a bit of both to group the relevant files together, like:

Code:
= GETFILE( 'CSV;C01,C02,C03;F01,F02,F03,F04,F05;W01,W02,W03,W04,W05,W06,W07,W08,W09,W10,W11,W12,W13', '', 'Select', 0, 'Select File' )

...which I think does actually look better, but I still get the same problem!

Neil

I like work. It fascinates me. I can sit and look at it for hours...
 
>>which I think does actually look better, but I still get the same problem!

I have VFP 6 installed on another machine, I will try and investigate over the weekend and see if I can find out what is going on here.

----
Andy Kramek
Visual FoxPro MVP
 
Hi Andy!

Thanks dude, however on the weekend I would expect you to be entertaining Marcia and not worrying about this issue :)

(BTW - You know me, think AQUA (Birmingham) ....)

Ciao

Neil

I like work. It fascinates me. I can sit and look at it for hours...
 
I would expect you to be entertaining Marcia and not worrying about this issue

The two are not necessarily mutually exclusive. Knowing Marcia, she will probably find Andy's experiments with VFP 6 very entertaining.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Andy said:
According to the help file the length limit for the File Extension parameter in VFP 9.0 is 254 characters, not 84. So I don't think that can be the issue.

Well, if 254 characters worked, it wouldn't be a bug now, would it? :)

Neil said:
Swapping the ';' for ',' doesn't do anything, as in the dialogue doesn't even appear! (VFP6)

Same thing in VFP 9, too, and I have to remove W10, W11, W12, and W13 before the dialog will appear. (In that instance, the expression string is only 71 characters. Still not 254 but also not 84, either!) Strange!

Teresa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top