From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-30-2013 10:11 AM
I am in need of being able to user select multple file patterns (*.bin, *.exe...) in a file dialosg similar to the express File Dialog VI where it lists the directory and allows the user to select multiple files from a windows dir listing. The express VI has a patterns input that takes multiple patterns separated by a semimcolon but there appears to not be a way of providing a ring control for file type and letting the user select the pattern that he wants to filter the directory listing with. I.E> > If the user wants to only load files that are *.bin, he only wants to view them in the listing. How can I do this without mutliple dialog boxes?
Solved! Go to Solution.
01-30-2013 10:32 AM
Can you post your code? That might help some. Also, you could try a Combo Box to output strings, use a Case Structure for filtering selections, etc. There's a lot of ways to do it.
01-30-2013 10:34 AM
I am merely looking to see if there is a way to use an off the shelf type of control that I dont know about. Right now I am just looking at using the file dialog express VI.
01-30-2013 12:22 PM
Off-the-shelf might be something like a list box that allows multiple selections. Or you could drop a cluster of booleans on the FP and parse the selected file types and place ;'s between them. You could have multiple string controls that the user inputs the file extension and then you programmatically insert a ; I can't think of something off-the-shelf that easily does what you are looking for, these suggestions require a little bit of programming but should get you off to a good start at least.
This is the approach for choosing any desired types from a list. If you want to choose only one, use a ring or combo box or enum... Much simpler when only choosing one of many.
01-30-2013 01:46 PM
You mean something like this:
Wire the discription of the first type of file into the "Pattern Display" input (I.E., "Word Files")
Then right click the format string and enable "codes display"
Then try something like this
"*.doc;*.docx)\00*.doc;*.docx;\00Bitmaps\s(*.bmp)\00*.bmp\00\00"
01-30-2013 02:05 PM
Don, thanks I tried what you said but i got a labview crash error. Maybe I was doing something wrong here. Can you make sure that I am doing what you said to?
01-30-2013 02:23 PM
Your format string is incorrect. Change the ?00 to \00.
01-30-2013 02:25 PM
U da man -Thanks. Thats exactly what I wanted...
01-30-2013 03:00 PM
Any leads as to where this string syntax is documented would be beneficial to my cause.
01-30-2013 03:16 PM
The first time I saw it (from NIs side) was from one of Darren's Weekly Nuggets:
http://forums.ni.com/ni/board/message?board.id=170&message.id=497502&query.id=3663527#M497502
That dialog, I believe, is hooked from the Windows API so the best place it is documented are external sites dedicated to Windows API programming.
Example:
http://www.winprog.org/tutorial/app_two.html
ofn.lpstrFilter = "Text Files (*.txt)\0*.txt\0All Files (*.*)\0*.*\0";
This is roughly the same type of format string. We just need to enable special codes display to place in the nulls.