RE: Finding the ascii code of a non-printable.
- From: HyperAnalyst <HyperAnalyst@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 24 Aug 2008 18:14:01 -0700
Well, I wasn't getting back any question mark (only numeric values, since
that's asc's "range"); but, Wow, thanks!--that really helped:
I got hex(ascw())=94 (or "\u0094"). It's a Cancel Character, "CCH", off
the C1 Controls and Latin-1 Supplement.
Awesome...thanks!!
--
HyperAnalyst
"Old Pedant" wrote:
"HyperAnalyst" wrote:.
(here is a copy of the non-printable [I will put in double-quotes]:"")
The function seems to be returning "asc()=63", decimal 63. Oddly enough,
the question mark on my keyboard, "?", also gives the same value, decimal 63.
Not odd, at all. The ASC( ) function will never return a value outside of
the range of 0 to 255. If the character is actually outside of that range,
it's treated as a bad translation and you get back a question mark.
Now try using
ASCW( )
where the "W" stands for "W"ide characters. That is, Unicode characters,
which are what VBS *always* uses.
But chances are good that the value you get will be 65535 (which is hex
0xFFFF) meaning that you really have a wrongly translated character, in the
first place. But maybe not.
Personally, I always use
HEX(ASCW(...))
because I find the hex easier to read and look up in various tables.
How could 2 different "characters" be transformed to the same value, through
"asc()"? Are they really different "characters"? Could this be an
indication of a VB Scripting bug?
- Follow-Ups:
- RE: Finding the ascii code of a non-printable.
- From: Old Pedant
- RE: Finding the ascii code of a non-printable.
- References:
- RE: Finding the ascii code of a non-printable.
- From: Old Pedant
- RE: Finding the ascii code of a non-printable.
- Prev by Date: Re: Using sendkeys in a web form
- Next by Date: Re: Using sendkeys in a web form
- Previous by thread: RE: Finding the ascii code of a non-printable.
- Next by thread: RE: Finding the ascii code of a non-printable.
- Index(es):
Relevant Pages
|