Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to CHR() Greek ASCII Characters

Status
Not open for further replies.

ermcclenton

Programmer
Jul 21, 2009
1
US
I am having trouble using the CHR() function to print Greek ASCII characters. The CHR() function seems to only work with numbers between 0 and 255. Whenever I attempt to print a Greek ASCII character, I get an error.

Example:
? CHR(946)
? CHR(913)

[ERROR] - Function argument value, type, or count is invalid.

Does anybody know how to get Visual FoxPro to render ASCII characters beyond "255"?
 
ASCII always goes from 0 to 255. Unicode has a block of Greek characters from 0x370 to 0x3FF. CHR() is not for Unicode, it's for ASCII/ANSI.

VFP supports ANSI codepages and so you'd set it to the greek Windows codepage 1253, if you need greek characters.

Eg by CODEPAGE=1253 in config.fpw

Bye, Olaf.
 
Also take a look at the options of STRCONV(). And the FontCharSet property and Codepages in general in the VFP help.

Bye, Olaf.
 
Ermcclenton,

If you have a suitable font, you can do it like this:

Code:
? "Hello World in Greek" FONT "Arial", 12, 161

161 being the character set ID for Greek. But you must choose a font with a Greek characer set.

Another possibility would be to use the Symbol font, which comes with Windows. This has the Greek alphabet, upper and lower case, but not the other usual characters like digits or punctuation marks.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top