436
Views
9
Comments
Solved
Data Conversion
Application Type
Traditional Web
Service Studio Version
11.10.9 (Build 38645)

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

2018-10-29 08-31-03
João Marques
 
MVP
Solution

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

SwapCharsByASCIIValue.oap
2020-09-01 10-42-42
Stefano Valente

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.

2022-10-03 13-01-16
Tamer Ahmed

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.

Thank you

2018-10-29 08-31-03
João Marques
 
MVP

Hi Tamer,


You can try to use the ASCII Utilities or HEX_ASCII_Converter forge components, they should provide actions for your purpose.


Hope it helps.


Kind Regards,

João


2022-10-03 13-01-16
Tamer Ahmed

Hi João,

it's not what i needed, Thank you.

2018-10-29 08-31-03
João Marques
 
MVP
Solution

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

SwapCharsByASCIIValue.oap
2020-09-01 10-42-42
Stefano Valente
2020-09-01 10-42-42
Stefano Valente

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); }
2022-10-03 13-01-16
Tamer Ahmed

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 

2024-10-25 09-14-42
Christopher Bautista

hi @João Marques @Stefano Valente ,

Both of you are awesome!

Learning a lot from you both.

Regards,

Chris

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.