special characters

msalva

New Member
Hi,

I want to print reports and redirect output to a file or a PDF file using special characters to draw a box,
for example chr(218) for left upper corner, chr(191) right upper corner,chr(217) right lower corner, etc.

┌───┐
└───┘

I already found here that these special characters should be found in the IBM850 codepage, i try with the following code but it does't work.

DEF VAR ttt AS INTEGER.
Repeat ttt = 191 to 218:
DISP ttt CHR(ttt,"ibm850").
End.

Please, help.
 

GregTomkins

Active Member
This code worked OK unmolested for me.

On Windows, each item produces a "non-traditional ASCII" character, some of which look like you could use them to print a box.

On Unix, about half of them produce nothing, I guess this is because of differences in the interpretation of the code page.

We do a lot of stuff where we print boxes around text and so on, but we do it using PostScript macros (output from P4GL and interspersed with data extracted from the DB), some of which are thousands of lines long.
 

msalva

New Member
Please tell me where i can find the information on how to change de codepage.
Do you have any example?.
 

tamhas

ProgressTalk.com Sponsor
There are two places to change code page. One is the -cp* parameters which you will find in the parameter documentation. These alter the internal and external code pages used with any given session. Depending on the code pages involved, one can have maps which convert one code page to another, although one obviously can't convert something like double byte Chinese to 8859-1.

The other place you need to look is in the database documentation. Easiest, of course, is to set the code page when you create the database, but there are techniques for converting an existing database. Someone else will have to tell you the procedure though, so I would start with the manuals. Naturally, the code page from and to have to be sensible or the conversion isn't going to make much sense.
 

yoachan

Member
Why do you have to use special character to draw box? Why don't you use pdf_rect or pdf_rect2 from PDFIinclude by Gordon Campbell. It draws rect like a magic :)
 

msalva

New Member
When I print forms like invoices in plain paper, i draw boxes and lines to make the invoice more readable, organized.
I put the special characters in the display code and the related data will appear inside a box, for example customer name and address in inside a box, each items number and description, price , ect in another box.


Why do you have to use special character to draw box? Why don't you use pdf_rect or pdf_rect2 from PDFIinclude by Gordon Campbell. It draws rect like a magic :)
 

msalva

New Member
When i run the following:

Display chr(192), Progress show this character: À
but i want this character:

In this site I read than the ibm850 codepage already has the characters that i want, if that where true i should be capable to run the next code and get wat i want without changing the startup parameters:

DISP CHR(192,"ibm850").

With this Progress change the output display, it display a dot "." not the └ that i want.

I understant that i can change the ibm850.dat file and 'add' the characters that i want, then with the command
proutil -C codepage-compiler generate a new convmap.cp.

My question is: how i can change the ibm850 to add the characters that i want?.



There are two places to change code page. One is the -cp* parameters which you will find in the parameter documentation. These alter the internal and external code pages used with any given session. Depending on the code pages involved, one can have maps which convert one code page to another, although one obviously can't convert something like double byte Chinese to 8859-1.

The other place you need to look is in the database documentation. Easiest, of course, is to set the code page when you create the database, but there are techniques for converting an existing database. Someone else will have to tell you the procedure though, so I would start with the manuals. Naturally, the code page from and to have to be sensible or the conversion isn't going to make much sense.
 

tamhas

ProgressTalk.com Sponsor
You might want to re-open this question on an i18n forum where there will be people who are experts with code pages. My understanding is that you don't need to do any conversions here, you just need to make sure that the code page of the place you want to see the character matches the code page of the ASCII value you are using.
 

msalva

New Member
Thanks for your help, i will post in i18n.

You might want to re-open this question on an i18n forum where there will be people who are experts with code pages. My understanding is that you don't need to do any conversions here, you just need to make sure that the code page of the place you want to see the character matches the code page of the ASCII value you are using.
 
Top