Notifications
Announcements
No record found.
Hi
I have a string like INV-1819-0001. I want to get Ascii value of each character of a string
Thanks
*This post is locked for comments
You can use the below function to get the Ascii Value of each character from the string.
LOCAL GetASCIIValue(pText : Text) //Variables //Name DataType //lAscii Integer //li Integer FOR li := 1 TO STRLEN(pText) DO BEGIN lAscii := pText[li]; MESSAGE('Character %1 Ascii Value %2',pText[li],lAscii); END; LOCAL GetASCIIValue2(pText : Text) //Variables //Name DataType //lChar Char //lAscii Integer //li Integer FOR li := 1 TO STRLEN(pText) DO BEGIN lChar := pText[li]; lAscii := lChar; MESSAGE('Character %1 Ascii Value %2',pText[li],lAscii); END;
Hope this helps. Thanks
I have below code and how i should convert sAscii to Ascii value.
array1[1] := "No.";
FOR i := 1 TO STRLEN(array1[1]) DO BEGINsAscii := COPYSTR(array1[1], i,1);END;
Since you have not provided more details on your reply, I have assumed the Data Type of the Array1 is Integer, below is the code for updating the Ascii value to Array1.
lText := "No."; FOR li := 1 TO STRLEN(lText) DO BEGIN Array1[li] := lText[li]; END;
Hi Divesh
i am able to get Ascii values . For eg i have text = INV . I have got values 73,78,86. Now i want to save these values in one string
like 73&78&86&
So where you want to use the ascii value ?
I want to save the values in a string and then pass to parameter
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.