Re: Bitz and Bytes , saving with fWRITE -
21-01-2004
Ok, I'm assuming this is the line you are referring to:
fwrite(cVisTable, iSize, 1, rbl);
I'm not sure what data type it is, but there is a few strategies I would try:
If it's an array of any kind, I would make a loop and write one element at a time, like you do with the node data.
If it's more like a string, I would create a loop and write pieces of the data (write bytes 1-1000, then write bytes 1001-2000, and so on until the end of the data is reached. In VB it would go something like this:
Sub WriteReallyBigString(BigString as String)
Dim StringChunk as String 'this holds the little piece of BigString
For X = 1 to Len(BigString) Step 1000 'Go through the length of BigString in 1000 byte increments
StringChunk = Mid$(BigString, X, 1000) 'Make StringChunk be 1000 bytes of BigString starting at position X
'Write StringChunk to file here
Next X 'End of for/next loop
If there's any way of accessing a particular byte or sequence of bytes from your vis table, but it doesn't have array elements, this would be the way to go. Hope this helps.
|