Remember that a * read returns the byte value read, and you need $C()
to convert it back to a character:
USER>F I=1:1:5 R *X(I)
HELLO
USER>F I=1:1:5 W $C(X(I))
HELLO
USER>
$A is the inverse operation, giving you the integer value of a
character.
BTW, if you want to be consistent with VA programming standards, you
should not use * or # reads. Use XGF instead.
===
Gregory Woodhouse
[EMAIL PROTECTED]
Better. Faster. Cheaper. Pick two.
On Jun 25, 2005, at 1:21 PM, Kevin Toppenberg wrote:
Can someone explain what is going on this code?
GTM>for i=1:1:5 read *k w "=",$ascii(k),!
a=57
b=57
c=57
d=49
e=49
GTM>for i=1:1:5 read k#1 w "=",$ascii(k),!
a=97
b=98
c=99
d=100
e=101
Why doesn't *k seem to read in the code properly?
Also, how would you read in the key [ESC]? When I
enter it at a read prompt, it cancels the read, rather
than returning a value of 27. I want to read in an
escape sequence from a user (i.e. Esc[A for 'up')
Thanks
Kevin
____________________________________________________
Yahoo! Sports
Rekindle the Rivalries. Sign up for Fantasy Football
http://football.fantasysports.yahoo.com
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Hardhats-members mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hardhats-members
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Hardhats-members mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hardhats-members