Solved

converting integer to ascii

Posted on 2000-04-03
9
468 Views
Last Modified: 2010-04-04
hi,
i want to be able to enter any number from 0 to 200 and i want to get the ascii character corrosponding to that number. how do can i do this? converting into bytes is ok as well but you would have to be explicit, i haven't used bytes before. how do i define a variable as a byte? but in the end i would prefer to do it without using bytes. so to reiterate, i want to be able to take an integer and get the ascii character that integer represents. please help.
thank you.
0
Comment
Question by:twilight_prince
9 Comments
 
LVL 9

Expert Comment

by:ITugay
ID: 2679916
Let suppose you have two TEdit controls on your form.
First - where you type number (0..200)
Second - where you want to see a char.
then you need code
------
begin
   Edit2.Text:=Char(StrToInt(Edit1.Text));
end;
-----
Cheers,
Igor.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2679926
Use

Var
  value: Byte;
Begin
  value := 65;
  Label1.Caption := Chr(value);
End;


Regards,

Eps.
0
 
LVL 9

Expert Comment

by:ITugay
ID: 2679935
Epsylon;)
Ooops....
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 13

Expert Comment

by:Epsylon
ID: 2679937
Instead of defining value as Byte, you can also define it as Integer, but Chr only accept values from 0 to 255.
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2679942
:o)

We don't have the same answer, but I'll withdraw mine...
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 2680944
its all said
chr() is the function you need
0
 
LVL 10

Expert Comment

by:ptmcomp
ID: 2685494
In Delphi all ordinal types are compatible:

var
  b: Byte;
  i: Integer;
  m: 1..1000;
  i64: Int64;
begin
  b:=3;
  i:=b; m:=i; i64:=m;
  ....
0
 
LVL 13

Expert Comment

by:Epsylon
ID: 2688230
>LOCK<
0
 
LVL 13

Accepted Solution

by:
Epsylon earned 100 total points
ID: 2688231
>LOCK<
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question