June 20, 2018 at 10:39 am #15882
I can’t seem to find a way to get this recently introduced function to work properly.
If I write down something like this:
Do bintobase64(lBinVar) Returns lCharVar
Do bintobase64(“static string”) Returns lCharVar
All I get is a conversion error (binary to char error, which is actually strange on its own since binary can be easily converted to a single char or string…)
Can anyone please post a working example of usage for this function?
Thank you in advanceJune 21, 2018 at 9:16 am #15891
Relevant info: i’m using OS 8.15July 3, 2018 at 9:22 am #16009Henk NoppeParticipant
How is the contents of lBinVar constructed? Has lBinVar the datatype binary?
Grtz HenkJuly 3, 2018 at 11:55 am #16010
Hi, thanks for your answer.
Yes, lBinVar is a generic binary variable, whereas lCharVar is a character value (of proper length).
What bugs me is that the bintobase64() function seems to always return a binary variable rather than a char(string). I think this is wrong since a conversion to base64 is supposed to return a string..
So i thought that either I’m not using this function the correct way or the function is bugged/not properly documented. I’m currently forced to use the OXML object, which usage is not recommended for REST requests.
I’m looking forward for an answer. ByeJuly 3, 2018 at 12:35 pm #16011Henk NoppeParticipant
I did some experimenting and came up with the following code:
Calculate charValue as ‘Hello World’
Do chartoutf8(charValue) Returns binValue
Do bintobase64(binValue) Returns base64Bin
Do utf8tochar(base64Bin) Returns base64value
; base64value will be SGVsbG8gV29ybGQ=
I am not sure why you do not get a character out of the bintobase64 function. Would make more sense to me, but maybe one of the Omnis Software fellows who are lurking here (or anyone else) can shed some light on this topic…
Grtz HenkJuly 3, 2018 at 2:48 pm #16020
I couldn’t manage to come up with your solution and I think it is actually a good workaround, although not the best in terms of performance.
I’ll keep experimenting with it, at least now i know how to put it to good use. 🙂
Let’s hope we will receive an official statement regarding this function’s behavior and correct usage.
For now, thank you again.
- This reply was modified 2 years, 7 months ago by Dario L..
You must be logged in to reply to this topic.