Hello
I want to convert text to hex using AL code. Is there any function that can do so?
I am working on cloud Business Central so I can't use any Dot Net library.
example:
Text Input = Bobs Records
Hex Result = 426F6273205265636F726473
Thanks
Hello
I want to convert text to hex using AL code. Is there any function that can do so?
I am working on cloud Business Central so I can't use any Dot Net library.
example:
Text Input = Bobs Records
Hex Result = 426F6273205265636F726473
Thanks
it works. thank you
Hi
See this post forum.mibuso.com/.../how-to-convert-text-to-hexadecimal-in-nav-2005
specially the following by Duikmeester
OnRun() MESSAGE('0x%1',ConvertBase16('Hogan')); LOCAL ConvertBase16(theInput : Text[512]) theOutput : Text[1024] FOR aIndex := 1 TO STRLEN(theInput) DO BEGIN aInt := theInput[aIndex]; aLeft := ROUND(aInt / 16,1,'<'); aRight := aInt MOD 16; theOutput += HexValue(aLeft) + HexValue(aRight); END; LOCAL HexValue(theValue : Integer) : Text[1] CASE theValue OF 0..9: EXIT(FORMAT(theValue)); 10: EXIT('A'); 11: EXIT('B'); 12: EXIT('C'); 13: EXIT('D'); 14: EXIT('E'); 15: EXIT('F'); END;
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,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156