rollback the read() operation of a filer?

rollback the read() operation of a filer?

Anonymous
Not applicable
326 Views
3 Replies
Message 1 of 4

rollback the read() operation of a filer?

Anonymous
Not applicable
Hi,

I read an object in dwgInFields(), but
there are 2 versions out there:

1:
int
int

2:
int
int
string
int

How can I read both correctly? The first 2 fields (int) are identical in both objects.
What I can do (can I?): read first 2 int's, then read string,and if it's a "real string continue reading; otherwise "rollback" the read operation.

But is there any way to "rollback" the read operation?
0 Likes
327 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
> How can I read both correctly? You need to read the appropriate fields depending on the version number. :) -- Owen Wengerd President, ManuSoft ==> http://www.manusoft.com VP Americas, CADLock, Inc. ==> http://www.cadlock.com
0 Likes
Message 3 of 4

Anonymous
Not applicable
Hi, I can only agree with Owen, your object should have from start had a version number as the first item which tells your code how to read the object. If you haven't implemented a version number then you are in trouble as you're seen. Since dwgfilers do not support seek() method, nor rollback, you do not have any solution good solution. Is your second version currently under development ? Is your first version of your object limited to r14, and the new object version for 2000 file format ? In those case there are workarounds, otherwise you will need to doing a live object type conversion as shown in the ADN Devnote #26695 to introduce a version number live. Natural sequences should be: 1: int version number = 1 int int 2: int version number = 2 int int string int So your code can switch from 1 case to the other, and is ready for future. Cheers cyrille
0 Likes
Message 4 of 4

Anonymous
Not applicable
Well, I know that 🙂 That's what I normally do :))
But the code was already there. And I have to deal with 2 versions of object. some users used 1 version, another -the other. 😞

There is no "version" field, as you can see from the description. First 2 ints are sizes of the object.
Message was edited by: andru123
0 Likes