Hi All, Does anybody know the syntax for returning the ASCII code of a character in NAVISION? I have this problem whereby I need to return the ASCII equivalent of all the characters in a string, and add 'em up to compute some hash total. Your help will be greatly appreciated. Thanks.
Hi. Try it with FORMAT. TextVar := ‘X’; MESSAGE(’%1’, FORMAT(TextVar[1], 0, ‘’)); This should give you a message ‘88’.
You can also try creating a function in your code called HashTotal: FUNCTION HashTotal(TextIn : Text[30]) HashTotal : Integer { HashTotal := 0; FOR i := 1 TO STRLEN(TextIn) DO HashTotal += TextIn[i]; } It works because TextIn[i] represents a Char datatype which is stored as an integer.
Hi Martin & John, Thanks.