Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie question - ascii character manipulation

Status
Not open for further replies.

RonMc

Programmer
Jul 13, 2002
3
CA
Hello! I'm new to Delphi, using 3, need to do a very simple utility that uses some ascii character manipulation. The code below is Macromedia Authorware script, the logic of which I must convert into Delphi 3. I don't know the string manipulation functions in Delphi and am stuck. This is what I need to do:

repeat with x := 1 to CharCount(Temp) --temp being a file I read in
// Dummy := Dummy^Char(Code(SubStr(Temp,x,x))-126) --decrypt the file
//end repeat

Basically I want to read in characters one at a time and subtract 126 from their ascii code then convert them into a visible character on the screen. The simple encryption method just adds 126 to the normal character code, now I'm converting them back from funny keyboard symbols to meaninful words. Can someone tell me which functions in Delphi I should use to do this? TIA RonMc
 
Code:
for x := 1 to Length(Temp) do //assuming temp is a string
	Dummy := Dummy + Chr(Ord(Temp[x]) - 126);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top