I do not think this is going to be possible with native CognosScript code. To accomplish the converion to binary, you would need to create a byte array. Unfortunately there is no Byte datatype in CognosScript.
Alternatively, you could create a VB COM dll that would perform the conversion for you. If you have VB, let me know and I'll help code a solution.
First, I found how to do this with CSNG function. the instruction is : csng(asc(char) xor 1 xor number) and it works. I want to read this new result in caracter but it's impossible because the value is now too long.
Second, in vbscript it's impossible to have a string return, it's for this raison I want to do this in cognos script but you said VBcom dll. I don't know how to interface with dll? Could you want to tell me how?
I believe you are casting to an ascii character using the asc function rather than to a binary value.
ie:
cslg(asc("A")) = 65 however the binary value of "A" is really 01000001. I suspect you would then want to perform your bitwise operation on the binary value using the xor function(??).
I am not clear as to what you actually need done here. Can you post some example data values?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.