Inverse of CHAR function

Chris Sharman Chris.Sharman@ccagroup.co.uk
Fri, 28 Jan 2000 08:50:41 +0000


>Last question of the day:
>
>Does anyone know what function is the inverse of the CHAR function?  IE.
>function x("A")=65.

A fine question.
Don't use the CHARACTERS function as per the example in the docs:

define itemx char*20 = encrypt(characters(phone),"INDEX")

They carefully leave the recovery of 'phone' as an exercise for the reader, and
a very challenging exercise it is too, since there is no inverse CHAR function
available ...

Techniques available (all with limitations) are:

3GL call (from Quick).
INDEX function (ie INDEX("ABCDEFGHIJKLMNOPQRSTUVWXYZ",ch)+64 )
Redefinition in the dictionary.

Good luck,
Chris
_______________________________________________________________________
Chris.Sharman@CCAgroup.co.uk		http://www.ccastat.demon.co.uk/
CCA Stationery Ltd, Eastway, Fulwood, Preston, Lancashire, PR2 9WS.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
This list is closed, thus to post to the list, you must be a subscriber.