Using a chr character code higher than 255?

J

JBHansen

I'm trying to use the replace command to pull out all the horizontal ellipsis
characters [chr(8230), or '...'] from a string, but the chr() command won't
accept anything higher than 255. I likewise can't search for three dots
because they've already been converted into a single character.

I'd rather not have to replace them all manually, although that is an
option. Is there a <smarter> way to do this?

JBHansen
 
J

JBHansen

Well, to report back, I just copy-pasted the actual '…' character into VBA
and it seems to work fine. I had assumed that wouldn't work, but so far so
good.
 
J

John Spencer

Chr(133) is usually the ellipsis character.

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
Well, to report back, I just copy-pasted the actual '…' character into VBA
and it seems to work fine. I had assumed that wouldn't work, but so far so
good.

JBHansen said:
I'm trying to use the replace command to pull out all the horizontal ellipsis
characters [chr(8230), or '...'] from a string, but the chr() command won't
accept anything higher than 255. I likewise can't search for three dots
because they've already been converted into a single character.

I'd rather not have to replace them all manually, although that is an
option. Is there a <smarter> way to do this?

JBHansen
 
R

raskew via AccessMonster.com

The asc() for "]" is not 8230 -- it's 93. See below.

? asc("]")
93
? chr(93)
]
Well, to report back, I just copy-pasted the actual '…' character into VBA
and it seems to work fine. I had assumed that wouldn't work, but so far so
good.
I'm trying to use the replace command to pull out all the horizontal ellipsis
characters [chr(8230), or '...'] from a string, but the chr() command won't
[quoted text clipped - 5 lines]
 
R

raskew via AccessMonster.com

Chr(133) is a hypen.

Bob
The asc() for "]" is not 8230 -- it's 93. See below.

? asc("]")
93
? chr(93)
]
Well, to report back, I just copy-pasted the actual '…' character into VBA
and it seems to work fine. I had assumed that wouldn't work, but so far so
[quoted text clipped - 5 lines]
 
R

raskew via AccessMonster.com

Oops,

Chr(133) is not a hyphen. Not sure what it is, e.g.
? asc("…")
133
? chr(133)
…

Sorry 'bout that

Bob

Chr(133) is a hypen.

Bob
The asc() for "]" is not 8230 -- it's 93. See below.
[quoted text clipped - 8 lines]
 
D

Dirk Goldgar

JBHansen said:
I'm trying to use the replace command to pull out all the horizontal
ellipsis
characters [chr(8230), or '...'] from a string, but the chr() command
won't
accept anything higher than 255. I likewise can't search for three dots
because they've already been converted into a single character.

I'd rather not have to replace them all manually, although that is an
option. Is there a <smarter> way to do this?


Try the ChrW function.
 
J

John W. Vinson

Oops,

Chr(133) is not a hyphen. Not sure what it is, e.g.
? asc("…")
133
? chr(133)

It may print as a hyphen or as an underscore in some fonts. Fonts aren't all
that consistant above the ASCII standard set.
 
Top