I need to get at the character code used to represent a character. I
realise that “f”[0] will return the code for “f” (102), but I read in
a FAQ that this behaviour may change, and I can’t find any other way
of doing it. Would somebody point me to what I am missing, please?
I need to get at the character code used to represent a character. I
realise that “f”[0] will return the code for “f” (102), but I read in
a FAQ that this behaviour may change, and I can’t find any other way
of doing it. Would somebody point me to what I am missing, please?
On Wed, Aug 20, 2003 at 12:42:20AM +0100, Tim Rowe wrote:
I need to get at the character code used to represent a character. I
realise that “f”[0] will return the code for “f” (102), but I read in
a FAQ that this behaviour may change, and I can’t find any other way
of doing it. Would somebody point me to what I am missing, please?
There may be a better way of which I’m unaware. Actually, even if
there isn’t a better way at the moment, there probably will be at some
point before foo[0] stops working.
-Mark
···
On Wed, Aug 20, 2003 at 11:46:42AM +0100, Tim Rowe wrote:
Sorry, I wasn’t completely clear. In my problem the character I want
to find the code for is (has to be!) in a variable.
foo = “f”
puts foo[0]
works at the moment, but may not continue to do so.