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

This forum is meant for questions and discussions about the X# language and tools
Post Reply
Serggio
Posts: 46
Joined: Sun May 14, 2017 5:03 pm
Location: Ukraine

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

Post 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
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

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

Post by wriedmann »

Hi Serggio,
please look at the function FieldGetBytes() in the online help.
AFAIK the DBServer has no suchg method.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

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

Post 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
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Chris
Posts: 4906
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

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

Post 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 :)
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

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

Post 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
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Serggio
Posts: 46
Joined: Sun May 14, 2017 5:03 pm
Location: Ukraine

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

Post by Serggio »

Thanks a lot for this suggestion!
Haven't tried it yet, but I'm sure it will work.

Serggio
Post Reply