Hi,
i'm new to OutSystems and i'm searching for replacement or a way to do some Conversion
i have a Text var ="123456789CW123" for example and i need to replace every Char with its ASCII value.
i tried to use TextToBinaryData but it return Binary and i can't add it to the Text any how.
Thank you
Hi Tamer,
Now that I understood your need better, I went ahead and created an extension which does the trick. See below a demo:
I am sending you an .OAP in attachment with the extension and the demo.
Hope it helps.
Kind Regards,João
I am not sure what you are trying to achieve. do you want the text to be converted from utf-8 to ascii or do you want the ascii-codes for each character?
The other way around is standard available in outsystems: chr(c). Ofcourse its very easy to create it yourself, but i would guess something already exists in the forge, hence my question.
Hi Stefano,
what exactly i need is to check for any letter in the Text and replace it with its ascii code.
var ="123456789SA123" => to be"1234567898365123"
chr() take integer to get the corresponding letter, i need the reverse action.
You can try to use the ASCII Utilities or HEX_ASCII_Converter forge components, they should provide actions for your purpose.
Kind Regards,
João
Hi João,
it's not what i needed, Thank you.
You beat me to it :)
If you need this servserside you need to create an extension.
Most easy way is to use javascript:
function ascii (a) { return a.charCodeAt(0); }
Thank you both for your responses.
i was trying to avoid creating an extension, by finding built-in methods /API to do so.
Thank you again
hi @João Marques @Stefano Valente ,
Both of you are awesome!
Learning a lot from you both.
Regards,
Chris