AskFileName Limit

Started by richardh, May 21, 2014, 09:42:48 AM

Previous topic - Next topic

richardh

Documented In Help:

** If the "flag" specified is 2  (Open Style, allowing multiple files to be selected), the selected files will be returned as a delimited list. The combined file names selected cannot exceed 2048 characters, otherwise the AskFileName dialog will be re-displayed. In other words, the number of files that can be selected is limited. Do not use this function to select multiple files, if the potential number of files to be selected, could exceed this maximum.

While testing and trying to trigger my routine to handle incoming files that exceed the 2048 limit, I've been successfully running AskFileName with strings as large as to 4391 without issue?

Has this function been updated to handle a larger string limit? or am I just getting lucky... lol

Update - just ran a file string that was over 5000 characters... no problem

Thanks,
RH


Deana

RH,

What version of WinBatch do you have installed?

As far as I am aware the function should redisplay if the 2048 character user selection limit is exceeded. I suppose it is possible this limit has changed since Unicode support was added....but I would need to confirm with the developers.

Quote
Starting in WinBatch 2012A:
   Incorporated workaround for bug in Windows Vista and newer Common Dialogs
   that caused the WinBatch "AskFileName" function to return random
   characters instead of redisplaying if a user selected to many files
   when calling the function with multi-selection flag 2.

Have you confirmed that the returned data is valid?

Deana F.
Technical Support
Wilson WindowWare Inc.

richardh

Hi Deana,

Hope you are well...

Version - WinBatch 2014A

Yes... the file name extracts coming from the list are correct.

Thanks,
RH

td

The 2 flag buffer limit only refers to the file names sans paths.  The functions normalizes the file names to include full paths so the returned list can easily exceed the 2048 buffer limit.

If you don't want to worry about the buffer limit use flag 102 instead of 2.   As indicated in the help file, the buffer limit only applies to flag 2.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

richardh

Ahhh, I missed help distinguishing between the 2 flag types * and **

I am using the 102 flag, thanks for the help, nice to know 2048 limit won't be a problem.

RH