wwUtils::File2Var

Retrieves a file from disk into a string, and stores a string to a file. Dual function method handles both reading and writing of strings to and from files.

Unlike STRTOFILE and FILETOSTR in the VFP language, File2Var is multi-user safe and provides for retries if a file is locked.

o.File2Var(tcFileName, tcString, tlSharedWriteMode)

Return Value

String when reading from file or "" if an error occurs.
.T. or .F. when writing a string to file.

Parameters

tcFileName
File name to retrieve when reading to string.
File name to save to when saving to file.

tcString
String to write to file when writing to file.

tlSharedWriteMode
Only applies to writing - when .T. the file is written in shared write mode which means if the file is open in another application in shared mode the file will get written anyway. Be careful with this mode flag as it can easily cause confusion between two applications.

See also:

Library wwUtils

© West Wind Technologies, 2004-2017 • Updated: 12/26/05
Comment or report problem with topic