LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

giving system date and time as default file name in FileSelectPopup command

hi,
In my application iam asking user to enter the file name for storing a graph thru FileSelectPopup command.
I want to give system date and time as the default file name,how can i do that?
i got the system time and date thru GetSysDate and GetSysTime.
thanks for the answer.
 
akath
0 Kudos
Message 1 of 3
(2,987 Views)
The CVI help for FileSelectPopup() suggests that, if the defaultFileSpec parameter is set to a filename, then this name will appear in the name box.
 
JR
0 Kudos
Message 2 of 3
(2,984 Views)
The following creates a file names "probexxxxonYYYYMMDD.dat"

where:
File_Name is a string
 the xxxx is a serial number
on just makes it read better
YYYY is the year
MM is the month
DD is the day of the month.
You should be able to modify it to suit your needs.


      sprintf( File_Name, "Probe%09don%04i%02i%02i.dat",
           CP_ID_Num, Date_Rec.Year, Date_Rec.Month, Date_Rec.Date);
     
       
      //open a file for writing diagnostics
      My_File = fopen( File_Name, "w" );

0 Kudos
Message 3 of 3
(2,976 Views)