LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a new file in the FileSelectPopup()

Hello, I'm wondering if anyone has insight to the FileSelectPopup() function of Labwindows 7.0.
I'm allowing the user to select a file and save their program configuration.  But when you are saving something you usually do it because it doesn't already exist.  Which means a new file.  But this prompt generates an error when you type in a name that doesn't already exist.  Is there a way to change that?  I noticed that the possible return values are VAL_EXISTING_FILE_SELECTED and VAL_NEW_FILE_SELECTED, but I haven't been able select a non-existent filename yet.
At the moment, the user has to right click->new->text document and rename it manually.  Any better ideas?
Thanks in advance.
0 Kudos
Message 1 of 3
(3,140 Views)
Hello,

The fifth parameter to the function specifies the label of the OK/Save/Load/Select button, but it also affects the kind of file that can be selected.  OK and Save allow the user to select a non-existent file, but Load/Select do not (this is noted in the help for that parameter).  Just change your button label to VAL_OK_BUTTON or VAL_SAVE_BUTTON, and you should be in good shape.

Hope this helps.

Mert A.
National Instruments
Message 2 of 3
(3,133 Views)
That's perfect!  Thanks, I never would have thought to look at that.
Now I can save files that may exist, and only load files that do exist.
0 Kudos
Message 3 of 3
(3,127 Views)