06-17-2011 11:01 AM
The problem statement: Create a test application that saves the test report with a filename that increments each time the test is run.
Example:
VR-1524-NXX-XXXXXXXX-June 17, 2011 - 100015
VR-1524-NXX-XXXXXXXX-June 17, 2011 - 100016
VR-1524-NXX-XXXXXXXX-June 17, 2011 - 100017
The next time the application is opened and the product is tested, the number needs to increment to 100018.
Aside from creating a txt file that contains the increment number, what is the best practices method for solving this issue?
06-17-2011 11:50 AM
If I understand your problem correctly, the application whenever runs test a file is created and it is incremented when you run it again, and when you close the application and open it at different time to runt test again the file numbering should be continuous right ?
As you already have said text file is better method, but instead of having increment number let it hold file name of the last file.
One more thing what you can do is, read how many files are there in the saved folder and use that count to start incrementing the file number, but if someone deletes the file then numbering may not be continuous.
06-17-2011 12:16 PM
Here is how I would do the name part. From here you just need to save the name in the text file and make it so it can open it.
06-17-2011 12:16 PM
If the only thing in the directory is report files and if they all have the same filename format you can use something like this
06-17-2011 04:50 PM
You can save it to a text file, as has been suggested, or use the config file VIs.