Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POffsetInfoType_String (UnspecifiedOffsetinfo1 and UnspecifiedOffsetinfo1) #25

Open
aarmando73 opened this issue Jan 12, 2024 · 1 comment

Comments

@aarmando73
Copy link

Hello Thomas,
I see UnspecifiedOffsetinfo1 and UnspecifiedOffsetinfo1 in POffsetInfoType_String are the max size of the string (one is 2 bigger because consider the parameters MaxLength (i.e. 256) and UsedLength (i.e 254)).

It is curious that sometimes the UnspecifiedOffsetinfo1=254 and UnspecifiedOffsetinfo2=256 and sometime UnspecifiedOffsetinfo1=256 and UnspecifiedOffsetinfo2=254.
If you read the single item obviously this is not a problem.

@thomas-v2
Copy link
Owner

In my test with plain string variables (no array) it was always as expected.

I see a difference when there's a Array of WString. Then I get at Offsetinfo1 = 254 (correct) but Offsetinfo2 = 512. But a plain WString in the same datablock gives Offsetinfo1 = 254 and Offsetinfo2 = 256. But this difference comes from padding bytes, which are added in a WString-Array (can be seen in a not-optimized DB).

At least for writing strings the values should be correct, because you need to write the complete length with the string-header.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants