Text or Number

Scott Penrose scottp at dd.com.au
Wed Mar 24 23:46:49 CST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Now I know I am being dumb here...

How can I find out that $x is a single character of ord 00-ff vs a 
number:

	That is - "1" does not eq chr(1);

The reason is that I get a log of people doing this

	$pp->set_byte(0, 1);

And of course I set the value on the parallel port to ord("1").
What I want to do is, if someone has given me a number - rather than a 
string, that I convert it to a character.
	chr(1);

What is the safest way to do this ?

Scott
- -- 
Scott Penrose
Welcome to the Digital Dimension
http://www.dd.com.au/
scottp at dd.com.au

Dismaimer: Contents of this mail and signature are bound to change 
randomly. Whilst every attempt has been made to control said 
randomness, the author wishes to remain blameless for the number of 
eggs that damn chicken laid. Oh and I don't want to hear about 
butterflies either.

Please do not send me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)

iD8DBQFAYnJNDCFCcmAm26YRAkBxAJ98qCq7D8dibjHrFaZyRkFTl5N9DgCfa8Xf
jaLvg5rEnlt6wDAI+YPfjg0=
=Fqgz
-----END PGP SIGNATURE-----




More information about the Melbourne-pm mailing list