Forum Discussion

d_jeziorski's avatar
d_jeziorski
New Contributor
15 years ago

Ord function in delphi script (TC 6.52)

Hello,

I have a question. Does any one have script that would convert ascii code into a character. It's the function which is opposite to the chr() function   



--

Dominik
  • Hi Dominik,




    Try using the Ord function:




    [DelphiScript]




    ...

        Log.Message(Ord('A'));

        Log.Message(Ord('&')); 

    ...

  • Hi,




    You can use a combination of the pound sign and decimal ASCII code like in the following example:




    [DelphiScript]

    ShowMessage(#72#101#108#108#111#32#119#111#114#108#100);

  • Hi Dominik,




    Try using the Ord function:




    [DelphiScript]




    ...

        Log.Message(Ord('A'));

        Log.Message(Ord('&')); 

    ...

  • Hello,



    Actually I would like to have script that would convert for example A letter to 65 in decimal & to to 38 etc.



    --

    Dominik Jeziorski