Here is my issue in a nutshell. A customer of mine has an ascii file filled with records. Every record is 256 bytes long, so I have setup types (using the vba TYPE statement) for each type of record there is.
The problem is, I have no way of knowing which type a record is until I read it into memory from the file. The indicator is the first 5 characters of the record are a code telling me which type to use. Is there a function that performs a direct memory copy from a variable of one type to a variable of another type.
Currently I am reading the data into the most common record type and then checking the code. If the type is incorrect, I write the data out to a temporary file and read it back in again to the correct type. This is (obviously) VERY inefficient because of all the useless disc reads/writes.
I have done linux programming and used the memcpy and bcopy functions. Do such functions exist in windows anywhere?
Any help would be greatly appreciated.
The problem is, I have no way of knowing which type a record is until I read it into memory from the file. The indicator is the first 5 characters of the record are a code telling me which type to use. Is there a function that performs a direct memory copy from a variable of one type to a variable of another type.
Currently I am reading the data into the most common record type and then checking the code. If the type is incorrect, I write the data out to a temporary file and read it back in again to the correct type. This is (obviously) VERY inefficient because of all the useless disc reads/writes.
I have done linux programming and used the memcpy and bcopy functions. Do such functions exist in windows anywhere?
Any help would be greatly appreciated.