Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

converting integer to ascii

Posted on 2000-04-03
9
Medium Priority
?
473 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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 400 total points
ID: 2688231
>LOCK<
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

618 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