You are invited to Log in or Register a free Frihost Account!

Delphi Function not Recognized..?

Hello all. Smile

I was just trying to code something that will translate HEX codes copied from disassembler into Ascii symbols.
(Hex copied from disassemblers etc looks like this: '47 75 73 68 65')
So my Idea was:
- Change all the spaces into $ + add a $ at the beginning. ($47$75$73$68$65)
- Than place each 3 bytes into a array: array[1] := '$47'; array[2] := '$47',...
- Use IntToStr to make Integer values from them (= the Decimal values).
- Use Chr to transate those into Ascii.

But already in the beginning I'm encountering a problem.
I wanted to use the AnsiReplaceText or AnsiReplaceStr functions to replace the spaces into $.

The problem is; my Compiler wouldn't want to understand AnsiReplaceText or AnsiReplaceStr as functions. (I'm using Delphi 10 Lite)
In my Help file AnsiReplaceStr & AnsiReplaceText are identified as funtions.. but they don't seem to be working..

Does anyone knows what could be going wrong here..? Confused

Thanx in Advance;
~ GuShe.;
can't help you on the delphi functions, being a C programmer, but there are a few things I notice:

1- why do you need to change the spaces anyway?
2- you don't want to get DECIMAL (0-9) values, as the data is in HEXADECIMAL (0-F).

Why not just grab the characters as they are? if you're accessing the characters as an array... you can just take the characters you need. i.e. '47','75','73'etc.. if you're putting them into an array anyway... why are you making yourself do so much more?
Well; I have like no Clue how to do it.
the $ indicates that the numbers behind it are Hex: and the StrToInt function should be able to interprete Hex values too; so that's how I was thinking..

I mean; Delphi doesn't seem to have a Hex 2 Ordinal, nor Ascii function. So I'll probby have to code one myself; I just do not have a clue how to.. :S

Can perhaps anyone help me on this..? Smile

Thanx in Advance;
~ GuShe.
Related topics
Rules for posting in the General Chat forum
PHP Mail Function
PHP function(); &file=""?
Programming links, info, and tutorials
Search function
ftp function
Syndicate Rich Media
MySQL DB Backup script - minor problem
F. Nietzsche
Function "Rotate90", how do do it guys?
javascript function not being seen
(server 2) php function exif_read_data() not supported ?
Are there any Delphi programmers in here?
Delphi Tlistbox things..
Reply to topic    Frihost Forum Index -> Scripting -> Others

© 2005-2011 Frihost, forums powered by phpBB.