Syntactically there is no difference between FUNCTION and PROCEDURE statements in VFP. In other languages, that have both statements, a function can return a value and a procedure cannot. In VFP the difference comes in the way a procedure/function is called. By default VFP passes parameters by value in call to the functions, by reference to the procedures ( DO ...) and only former allows for a return value.
|This is sample code. Add error handling and adjust to your requirements as necessary.
Relevant links: http://www.summitinstruments.com/knowledge_center/pdf/TN410.pdf http://www.lammertbies.nl/comm/info/crc-calculation.html?crc=1234567898765421&method=ascii
The CopyFile() and MoveFile() WIN API functions preserve the case of the name for the destination file. Alternatively, WSH can be used.
The source and destination file names should include the directory name in both cases.
Note 1 A Copy operation will not change file name case when destination file already exists (overwritten).
Note 2 The WinApiErrMsg is used to retrieve Windows API error message in case of error.