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
Hi
I want to save the values in a string and then pass to parameter
Thanks
So where you want to use the ascii value ?
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&
Thanks
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
I have below code and how i should convert sAscii to Ascii value.
array1[1] := "No.";
FOR i := 1 TO STRLEN(array1[1]) DO BEGIN
sAscii := COPYSTR(array1[1], i,1);
END;
Thanks
Hi
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
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156