xsharp.eu • How to get raw byte array or Binary{} from a memo-field?
Page 1 of 1

How to get raw byte array or Binary{} from a memo-field?

Posted: Thu Mar 18, 2021 12:59 pm
by Serggio
DBFCDX (with FPT support). How to get/put memo-field as a raw value - BYTE[] (if possible without first 8 bytes of a header) ? BlobGet, as far as I see, returns a string, which is grinded with encoding.

regards,
Serggio

How to get raw byte array or Binary{} from a memo-field?

Posted: Thu Mar 18, 2021 4:55 pm
by wriedmann
Hi Serggio,
please look at the function FieldGetBytes() in the online help.
AFAIK the DBServer has no suchg method.
Wolfgang

How to get raw byte array or Binary{} from a memo-field?

Posted: Thu Mar 18, 2021 4:58 pm
by wriedmann
Hi Serggio,
sorry, I was wrong: since 2.6 there is such a method in the RDD classes.
There is a method FieldPutBytes() and FieldGetBytes():
https://www.xsharp.eu/help/versionhisto ... ldgetbytes
Wolfgang

How to get raw byte array or Binary{} from a memo-field?

Posted: Thu Mar 18, 2021 6:54 pm
by Chris
Hi Wolfgang,

I must admit I had not realized Robert has already added this also to the SDK, I was about to log a feature request to add it, but then I saw your reply :)

How to get raw byte array or Binary{} from a memo-field?

Posted: Thu Mar 18, 2021 7:25 pm
by wriedmann
Hi Chris,
I know I have asked for this method because I need it for several migrations, but probably I had read the whatsnew document to fast to realize that this is now implemented.
As you probably know, I'm storing many different things in DBF fields - from compressed bitmaps to crypted content, and I need to retrieve a byte array for this.
Wolfgang

How to get raw byte array or Binary{} from a memo-field?

Posted: Mon Mar 22, 2021 2:53 pm
by Serggio
Thanks a lot for this suggestion!
Haven't tried it yet, but I'm sure it will work.

Serggio