×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

ASCII values?

ASCII values?

ASCII values?

(OP)
Does anyone know how to return the ASCII character for a numeric value? Example: I provide 65, the application returns "A".
Thank you.
-Mike Kemp

RE: ASCII values?

Not sure if there is a generic method using Interbase. Think perhaps you should look at creating a UDF and calling this from Interbase.

Opp.

RE: ASCII values?

(OP)
Thanks, Opp.
I suppose, then, you'd have to do a series of If statements like:
Create procedure ASCIIVals(InStr varchar(1)) returns (RetVal integer) as
begin
if InStr="a" then
     RetVal=97;
if InStr="b" then
     RetVal=98;
if InStr="c" then
     RetVal=99;
etc.

Does this sound correct?
Thanks.
-Mike

RE: ASCII values?

Yes Mike, but you wont be able to do this using VBA. UDF's need to be compiled into a DLL to be used by Interbase. Check out this article :

http://community.borland.com/article/0,1410,27134,00.ht...

Im sure there are free UDF's around - and may be worth checking those out (one may give you the functionality you need.) Hope this helps..

Opp.

RE: ASCII values?

There's an UDF that comes with IB:

Returns the ASCII value of the character passed in.
DECLARE EXTERNAL FUNCTION ASCII_VAL
CHAR(1)
RETURNS INTEGER BY VALUE
ENTRY_POINT 'IB_UDF_ascii_val' MODULE_NAME 'ib_udf';


Martijn Tonies
Database Workbench - the developer tool for InterBase, Firebird and MS SQL Server
http://www.upscene.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close