Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to do this using Delphi

Status
Not open for further replies.

milan.rajik

Banned
Advanced Member level 5
Joined
Apr 1, 2013
Messages
2,524
Helped
540
Reputation
1,078
Reaction score
524
Trophy points
1,393
Activity points
0
I am using RAD Studio XE6. I want to know how to extract characters from a Edit Box that is I have something like EDABoard in EditBox and I want to extract one character at a time from the EditBox like 'E', 'D', 'A', .... and also want to get the ascill value of the charcaters of each extracted characters.
 

The entire content of the EditBox is held in its Text property like this: EditBox1.Text
To get one character from that just use an index. EditBox1.text[1] is the first character in the string.
To get the ASCII value of a character use the ord function.
So you could have something like this:

Code:
var
  ASCII_Val : byte;
  i : integer;
begin
  for i := 1 to length(Edit1.Text) do
  begin
    ASCII_Val := ord(Edit1.Text[i]);
    // Do whatever you want with the ASCII value here
  end;
end;
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top