DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

COMMON SCRIPT FOR DIFFERENT FILE FORMATS

Solved!
Go to solution
Solution
Accepted by RSH

Hi RSH,

 

Of course you can have one script do it all.  But you yourself said that you want to load one file type AT A TIME, not all file types together.  You're popping up a file dialog, right?  So then don't you want the file dialog you pop up to ONLY show *.DAT files or to ONLY show *.mme data files, depending on which type you want to got get?  Or perhaps show all of them briefly?  If you want an all-in-one approach, then try this:

 

DlgTitle = "Insert File Dialog Title Here..."
StartPath = ProgramDrv & "Examples\Data\"
FileExts = "ALL Data Files,*.iso;*.dat;*.egv,ISO Data Files,*.iso,DAT Data Files,*.dat,EGV Data Files,*.egv"

Call FileNameGet("Any", "FileRead", StartPath, FileExts, "Nul", True, DlgTitle)
IF DlgState = "IDCancel" THEN Call AutoQuit
FilePaths = Split("|" & FileDlgFileName,"|")

FOR i = 1 TO UBound(FilePaths)
  Call DataFileLoad(FilePaths(i), "")
NEXT

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 11 of 11
(820 Views)