[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 178
  • Last Modified:

Hexidecimal Word Proccessor

I would like to make a pascal program that will allow me
to type in phrases, sentences, etc, and it will display
its appropiate ASCII converted Hexidecimal output.
I would like this to work if i type in hexideciaml, for the
ascii output as well.  thanks
0
weinrj
Asked:
weinrj
  • 3
  • 2
1 Solution
 
omsecCommented:

Hi ! To convert decimal numbers to hexadecimal strings isn't hard ! Check out the source procedure i wrote below. You may convert with it decimal numbers to any other mathematical systems like Hexadecimal, Binary or Octal etc.

Function DezConvert(Zahl : LongInt; Basis : Byte) : String;

Const
  HexStr      : String[16] = '0123456789ABCDEF';

Var
  HlpStr      : String;

Begin
   If Zahl = 0 Then
     HlpStr := '0'
   Else
     HlpStr := '';
   While Zahl <> 0 do
     Begin
       HlpStr := HexStr[(Zahl mod Basis) + 1] + HlpStr;
       Zahl   := Zahl div Basis;
     End;
   DezConvert := HlpStr;
End;

ZAHL is the number you wanna convert.
BASIS is the system's basis

to hex : BASIS is 16
to bin : BASIS is  2
to oct : BASIS is  8

Greets, Omsec
0
 
omsecCommented:
That is only one way to do that... One of the fastest i know.
0
 
weinrjAuthor Commented:
thanks.  I figured what Zahl was since i know some german.
thank you for your help.  but would this work for

"Hello" into hexidecimal conversions?

thanks
0
Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

 
omsecCommented:
Hexacedimal is a methamtic type. And 'HELLO' is a string. You cannot convert that "HELLO" in a number.
0
 
FuzzyLogicCommented:
I think what weinrj wants is to convert the string "HELLO" into hexadeciaml form char by char. That means "48454C4C4F".
If this is what you want, you can easily modify omsec function to do that.

FuzzyLogic
0
 
weinrjAuthor Commented:
what fuzzylogic said is what i want.
please help me on this.
thanks


0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now