a symbol for "cents"

G

Guest

I have Windows 98. Yes, I know it is out-dated. Is there a way to print a
cents sign, as in "it cost 5 cents" ?
 
J

John W. Vinson

I have Windows 98. Yes, I know it is out-dated. Is there a way to print a
cents sign, as in "it cost 5 cents" ?

alt-0162 (on the numeric keypad) will do so - this may vary with the font
you're using. Just my 2¢.


John W. Vinson [MVP]
 
G

Guest

That is because the ASCII representation is 162
To return the letter X for example, it would be <Alt> 088

So, Chr(162) will return ¢
 
D

David W. Fenton

That is because the ASCII representation is 162
To return the letter X for example, it would be <Alt> 088

So, Chr(162) will return ½

That would be ANSI representation.

The ASCII is 155.

The fact that Asc("¢") returns 155 is something of a problem, I
guess.
 
G

Guest

I stand corrected. Things have changed. I was not aware we were now using
ANSI code rather than ASCII codes.
In the original days of the BASIC language, it was ASCII codes (that's where
Asc came from).

I believe the original set (0 - 127) of ASCII and ANSI are the same. There
are some differences in the upper set.
 
J

John W. Vinson

I stand corrected. Things have changed. I was not aware we were now using
ANSI code rather than ASCII codes.

As the old saying goes...

"ASCII a silly question - get a silly ANSI!"

<g, d & r>

John W. Vinson [MVP]
 
R

RD

That would be ANSI representation.

The ASCII is 155.

The fact that Asc("¢") returns 155 is something of a problem, I
guess.

Hmmm ... being the curious type, I just tried it in the Immediate window:

?Asc("¢")
162

?Chr(155)
Am I missing something? What gives?

Color me curious,
RD
 
J

John W. Vinson

I am going to come to your house and do something disgusting on your carpet :)

So *YOU'RE* the one who bribed KalliCat to bring in the gopher...!

John W. Vinson [MVP]
 
J

John W. Vinson

Copied and pasted from the Immediate window (Access2003, fully patched,
WindowsXP, American English language settings, default fonts):

?Asc("¢")
162
?chr(162)
¢
?chr(155)

I believe Mr. Fenton is incorrect. I get the same results you did.

John W. Vinson [MVP]
 
D

David W. Fenton

I stand corrected. Things have changed. I was not aware we were
now using ANSI code rather than ASCII codes.
In the original days of the BASIC language, it was ASCII codes
(that's where Asc came from).

I believe the original set (0 - 127) of ASCII and ANSI are the
same. There are some differences in the upper set.

The 4-digit codes are ANSI, the 3-digit codes are ASCII.

155 is ASCII for ¢ while 162 is ANSI for ¢.
 
D

David W. Fenton

Copied and pasted from the Immediate window (Access2003, fully
patched, WindowsXP, American English language settings, default
fonts):

?Asc("½")
162
?chr(162)
½
?chr(155)

Yes, of course that's what you get because those are all ANSI
values, which is what Asc() and Chr() use.

Type Alt-0162 on the numeric keyboard and you'll get the ANSI
result.

Type Alt-155 and you'll get the ASCII result.

In both cases, that's ¢.

This is *really* basic, folks, and has been the case since at least
Windows 3.x.

I don't know why Asc() returns ANSII values, but that is really what
it's doing.
 
G

Guest

You are correct about what the codes are. Where the confusion lies is that
in the early days of the BASIC language, the function did use ASCII codes.
That is why the name of the function is Asc and not Ans. At what point
Microsoft chose to change to ANSI, I don't know, but it was a suprise to me.
Where some of the confusion came from is that

Alt 0162 returns ¢
Alt 162 returns ó
Alt 0155 returns ›
Alt 155 returns ¢

So it appears that Alt and 4 disgits returns ANSI codes and Alt and 3 digits
returns ASCII codes.

You will note that if you use 3 and 4 digits on the lower 128, with a few
exceptions, they are the same.
 
D

David W. Fenton

You are correct about what the codes are. Where the confusion
lies is that in the early days of the BASIC language, the function
did use ASCII codes. That is why the name of the function is Asc
and not Ans. At what point Microsoft chose to change to ANSI, I
don't know, but it was a suprise to me.

I would expect it came with the advent of VB -- they used the QB
function but since VB was running on Windows, which used ANSI code
pages by default, they just changed it to use ANSI codes instead of
ASCII.
Where some of the confusion came from is that

Alt 0162 returns ½

Er, no, it returns ¢.
Alt 162 returns ¢

Er, no, it returns ó.
Alt 0155 returns ?

No, it returns ›.
Alt 155 returns ½

And that returns ¢.

Of course, the problem here is likely that your post had an
incorrect character-set declaration. You only see the right things
above *if* you are using a Windows character set, which is
iso-8859-1 or iso-8859-15. Apparently your news reader doesn't honor
the character encoding in my post, which was iso-8859-15, or my
newsreader/news proxy is not altering the character set in *your*
post (which appears to me in my newsreader as iso-8859-15).

Actually, Usenet wasn't really designed for modern character sets --
there is no official support for UTF-8 (Unicode). I'm using a news
proxy called Mime Proxy to make sure that posts are all in the same
character set, but if your post lacked a character set declaration
in the header, my news reader/news proxy may be misinterpreting it.
So it appears that Alt and 4 disgits returns ANSI codes and Alt
and 3 digits returns ASCII codes.

Yes, that's what I said. And it has always been that way since at
least Win 3.x.
You will note that if you use 3 and 4 digits on the lower 128,
with a few exceptions, they are the same.

Yes, that's correct, because the lower half of the ANSI character
set is identical to the lower half of all ASCII code pages. It's the
difference between 7-bit and 8-bit encoding.
 
G

Guest

All very interesting. Thanks for your input.
Interestingly, there is some translation problem between IE6 and your
newsreader. The characters I actually posted were not what you sent back.
They were in fact what you said were correct.
 
D

David W. Fenton

All very interesting. Thanks for your input.
Interestingly, there is some translation problem between IE6 and
your newsreader. The characters I actually posted were not what
you sent back. They were in fact what you said were correct.

From my point of view, it was *your* post's encoding that was
incorrect. The fact is that Usenet never really properly crossed the
7-bit border.

The Mime Proxy that I use was suggested to me by a tri-lingual
individual who posts on Usenet all the time and does Web
development. She is native German, speaks French like a native and
writes English so idiomatically that you'd think she was a native
speaker. Given that she posts to Usenet in three different languages
on a regular basis, she had to solve the character encoding issue,
and she said the correct way to do it based on the Usenet RFCs and
current technology was to use something like Mime Proxy.

So, I would tend to believe that the problem is with your software,
as I'm using the software that those who *must* post 8-bit use when
posting to Usenet.
 
G

Guest

I don't recall trying to assign any blame. All I said was they were not in
sync. I use IE6 for these newsgroups as I am not allowed software not
licensed by my employer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top