Hex-values in CALcode or CONVERT ASCII 2 ANSI?

Hallo, please give me some help. I created a text-file in Navision Financials 2.01 . Navision default is ASCII, but I need this file in ANSI. So I thought to change the record before write it , with CONVERTSTR. But therefore I need the “ToCharacters” in hexdecimal . Now the question, how can I type in these “hexa-values” in CAL-Code, I don’t know the syntax, I didn’t find something in my documentation. May be anyone has an example for me, or anyone has a better, simple idea ? Please let me hear about it, or send me a file to: heinsohn@wibo-werk.com thanks in advance for your help Rolf

Hi Rolf, I wrote some code some time ago, that converted some text from ASCII to ANSI, or the other way around… hope this is some input:


ASCII2ANSI(_String : Text[5]) : Text[5]
{
FromChars := '¡¢£¤¥¦§¨©ª';
ToChars   := 'íóúñѪº¿®¬';
}
FromChars := '';
FromChars [1] := 161;
FromChars [2] := 162;
FromChars [3] := 163;
FromChars [4] := 164;
FromChars [5] := 165;
FromChars [6] := 166;
FromChars [7] := 167;
FromChars [8] := 168;
FromChars [9] := 169;
FromChars [10] := 170;

ToChars := '';
ToChars [1] := 173;
ToChars [2] := 189;
ToChars [3] := 156;
ToChars [4] := 207;
ToChars [5] := 190;
ToChars [6] := 204;
ToChars [7] := 245;
ToChars [8] := 249;
ToChars [9] := 184;
ToChars [10] := 166;

EXIT (CONVERTSTR (_String, FromChars, ToChars));

FromChars and ToChars are text vbles, but if you assign them by chars you can use the corresponding ASCII codes. Hope this helps. [;)] Saludos Nils

Hi Nils, thx for that reply. I modified it for my application and it works. Rolf

For a more complete list of FromChars, ToChars see http://www.mbsonline.org/forum/topic.asp?TOPIC_ID=4359