Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Convert Character Variable to Integer Variable

Reply
Thread Tools

Convert Character Variable to Integer Variable

 
 
Brad Smallridge
Guest
Posts: n/a
 
      11-18-2004
How do you convert a character variable to an integer variable?

variable my_char_v : character;
variable file_size : integer;

.. . .

file_size := ???? my_char_v;


 
Reply With Quote
 
 
 
 
Mike Treseler
Guest
Posts: n/a
 
      11-18-2004
Brad Smallridge wrote:
> How do you convert a character variable to an integer variable?
> variable my_char_v : character;
> variable file_size : integer;
>
> file_size := ???? my_char_v;



file_size := character'pos(my_char_v);


-- Mike Treseler
 
Reply With Quote
 
 
 
 
Brad Smallridge
Guest
Posts: n/a
 
      11-18-2004
> file_size := character'pos(my_char_v);

Yeah that worked. Now one would think that'd
only work to convert to a character.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert an integer value to ASCII character Xianwen Chen C Programming 9 10-31-2012 11:16 AM
check and convert lower character to upper character alessio211734@yahoo.it C++ 3 11-18-2007 11:28 AM
How to convert a 4 byte character string to its equivalent 4 byte integer value? Polaris431 C Programming 8 12-04-2006 07:00 AM
How to convert an integer to ASCII character ? akarui.tomodachi@gmail.com C Programming 16 03-03-2006 02:01 AM
convert scientific integer to normal integer les ander Python 4 10-05-2004 04:26 PM



Advertisments