Micro Focus QTP (UFT) Forums
How to save files with dynamic file names?? - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: How to save files with dynamic file names?? (/Thread-How-to-save-files-with-dynamic-file-names)



How to save files with dynamic file names?? - jyotikrushna - 01-03-2010

After creating a script I want to save it, so I clicked on "Save As" from "File" menu then a window appeared and asked me to enter a file name to save. my question is how we can give the file name dynamically instead of giving static file name like"file1 or file2 etc..)?

Please help me out this question


RE: How to save files with dynamic file names?? - Saket - 01-04-2010

what exactly you mean by a dynamic file name. would you like to elaborate your query for what exactly you want to do?


RE: How to save files with dynamic file names?? - jyotikrushna - 01-04-2010

dynamic names means when to save a file , it will ask you to give a suitable name for ex; file1, file2...etc. my question is we have to write such a script that it will automatically generate a unique name and save the file with this name. no need to give a file name manually enter through keyboard..


RE: How to save files with dynamic file names?? - satan - 01-05-2010

Code:
Dim mt,mdt
mt=Time
mdt=Date
rndm=mdt&"_"&mt
rndm=Replace(rndm,"/","_")
rndm=Replace(rndm,":","_")
use rndm variable for your file name