Micro Focus QTP (UFT) Forums
error with msdn's description of overwrite value of CreateTextFile ?? - 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: error with msdn's description of overwrite value of CreateTextFile ?? (/Thread-error-with-msdn-s-description-of-overwrite-value-of-CreateTextFile)



error with msdn's description of overwrite value of CreateTextFile ?? - anu05446 - 03-10-2014

Hi,

I see that on MSDN http://msdn.microsoft.com/en-us/library/aa265018(v=vs.60).aspx for CreateTextFile Method
It is written that The overwrite Property is False by Default,

overwrite: (Optional) Boolean value that indicates whether you can overwrite an existing file. The value is True if the file
can be overwritten, False if it can't be overwritten. If omitted, existing files are not overwritten (default False).


The Property by default should be True, I tried it without specifying anything and the text file is getting replaced. Please Verify at your end and let me know what is correct??


RE: error with msdn's description of overwrite value of CreateTextFile ?? - basanth27 - 03-10-2014

I agree, it looks like a documentation error on MSDN. The file does get overwritten. Default seems to be true.

W3Schools quote overwritten default as True. There are conflicting views on the web as well. The below statement from MSDN is also untrue if i had not to specify True or FALSE.

If the overwrite argument is False, or is not provided, for a filename that already exists, an error occurs.

An error does not occur if the argument is not provided.