Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASCII values?

Status
Not open for further replies.

mike777

Programmer
Jun 3, 2000
387
US
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
 
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.
 
Thanks, Opp.
I suppose, then, you'd have to do a series of If statements like:
Code:
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
 
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 :


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.
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top