Index
2010-01-25 13:44Graham Trott : Use a character from another codepage
2010-01-26 02:50Paul Hill : Re: Use a character from another codepage
2010-01-26 04:37Dan Olsson : Re: Use a character from another codepage
2010-01-26 07:14Lew : Re: Use a character from another codepage
2010-01-26 09:24Jaime Vasquez : Re: Use a character from another codepage
Back to top
Use a character from another codepage

Author: Graham Trott

Posted: 2010-01-25 13:44:08   Link

Would like to use the block character from codepage 437 without changing codepages chr(219)=? and chr(255)= blank space

VFP9 uses codepage 1252. I am not sure what the implications would be of changing the codepage in existing applications. I would just like to create a simple progress bar that does not use any screen real estate. For example:

WAIT REPLICATE(CHR(219),50)+REPLICATE(CHR(255),50) WINDOW nowait

Is there any way to map a character to a different codepage.

--- StripMime Report -- processed MIME parts ---

multipart/alternative

text/plain (text body -- kept)

text/html

---

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/47D3E63D442D4E5FA31C748A069AD3DD@GrahamPC

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2010 Graham Trott
Back to top
Re: Use a character from another codepage

Author: Paul Hill

Posted: 2010-01-26 02:50:53   Link

On Mon, Jan 25, 2010 at 6:44 PM, Graham Trott <grahamskaraoke@gmail.com> wrote:

> Would like to use the block character from codepage 437 without changing codepages chr(219)=? and chr(255)= blank space

>

> VFP9 uses codepage 1252.

1252 is the codepage for Western European languages. In Russia VFP

would use 1251.

> I am not sure what the implications would be of changing the codepage in existing applications.

I don't believe you can change the codepage on an application basis

(especially not to a DOS cp like 437!).

>I would just like to create a simple progress bar that does not use any screen real estate.

©2010 Paul Hill
Back to top
Re: Use a character from another codepage

Author: Dan Olsson

Posted: 2010-01-26 04:37:51   Link

At 2010-01-25 19:44, Graham Trott wrote:

>I would just like to create a simple progress bar that does not use

>any screen real estate.

I have used a routine for many years that resembles FP:s internal

progress bar showing progress during sql-selects. I have propably

"stolen" it somewhere, can't remember...

*!*****************************************************************************

*!

*! Function: PROGRESS()

*!

*!*****************************************************************************

FUNCTION progress

PARAMETERS lnPct, lcTopMsg, lcBotMsg

PRIVATE lnPct, lcBotMsg, lcTopMsg, llGraphic, lnPctAt, lcPctAt

*****

* Validate the Parameters

*****

IF TYPE("m.lnPct") # "N"

m.lnPct = 0

ENDIF

IF TYPE("m.lcBotMsg") # "C"

m.lcBotMsg = ""

ENDIF

IF TYPE("m.lcTopMsg") # "C"

m.lcTopMsg = ""

ENDIF

#DEFINE c_dlgface "MS Sans Serif"

#DEFINE c_dlgsize 8.000

#DEFINE c_dlgstyle "B"

* define window when calling the first time

*

IF NOT WEXIST('W_PROGRESS')

* This only gets run once, first time called

*

SET CURSOR OFF

DEFINE WINDOW w_progress ;

AT INT((SROW() - (( 5.615 * FONTMETRIC(1, c_dlgface,

c_dlgsize, c_dlgstyle )) /

FONTMETRIC(1,WFONT(1,""),WFONT(2,""),WFONT(3,"")))) / 2) , ;

INT((SCOL() - (( 63.833 * FONTMETRIC(6, c_dlgface,

c_dlgsize, c_dlgstyle )) /

FONTMETRIC(1,WFONT(1,""),WFONT(2,""),WFONT(3,"")))) / 2) ;

SIZE 5.615, 63.833 ;

FONT c_dlgface, c_dlgsize ;

STYLE c_dlgstyle ;

NOCLOSE ;

NONE ;

COLOR RGB(0, 0, 0, 192, 192, 192)

* nofloat ;

MOVE WINDOW w_progress CENTER

ACTIVATE WINDOW w_progress NOSHOW

* Draw lines to create 'raised-panel' look:

@ 0.000, 0.000 TO 0.000, 63.833 COLOR RGB( 255, 255, 255,

255, 255, 255)

@ 0.000, 0.000 TO 5.615, 0.000 COLOR RGB( 255, 255, 255,

255, 255, 255)

@ 0.385, 0.667 TO 5.231, 0.667 COLOR RGB( 128, 128, 128,

128, 128, 128)

@ 0.308, 0.667 TO 0.308, 63.167 COLOR RGB( 128, 128, 128,

128, 128, 128)

@ 0.385, 63.000 TO 5.308, 63.000 COLOR RGB( 255, 255, 255,

255, 255, 255)

@ 5.231, 0.667 TO 5.231, 63.167 COLOR RGB( 255, 255, 255,

255, 255, 255)

@ 5.538, 0.000 TO 5.538, 63.833 COLOR RGB( 128, 128, 128,

128, 128, 128)

@ 0.000, 63.667 TO 5.615, 63.667 COLOR RGB( 128, 128, 128,

128, 128, 128)

@ 3.000, 3.333 TO 4.231, 3.333 COLOR RGB( 128, 128, 128,

128, 128, 128)

@ 3.000, 60.333 TO 4.308, 60.333 COLOR RGB( 255, 255, 255,

255, 255, 255)

@ 3.000, 3.333 TO 3.000, 60.333 COLOR RGB( 128, 128, 128,

128, 128, 128)

@ 4.231, 3.333 TO 4.231, 60.500 COLOR RGB( 255, 255, 255,

255, 255, 255)

SHOW WINDOW w_progress TOP

ELSE

ACTIVATE WINDOW w_progress

ENDIF

* Display the horizontal progress bar

DO CASE

CASE m.lnPct > 0 AND m.lnPct < 100

m.nblocks = (m.lnPct / 100) * 57

m.lcPct = LTRIM(STR(m.lnPct))+" %"

IF PARAMETERS() > 2

@ 0.5, 3 SAY m.lcTopMsg FONT c_dlgface, c_dlgsize

STYLE c_dlgstyle

ENDIF

IF PARAMETERS() > 1

@ 1.5, 3 SAY m.lcBotMsg FONT c_dlgface, c_dlgsize

STYLE c_dlgstyle

ENDIF

m.lnPctAt = (WCOLS()-TXTWIDTH(m.lcPct))/2

@ 3.00, 3.33 TO 4.231, m.nBlocks + 3.333 PATTERN 1 COLOR

RGB( 128, 128, 128, 128, 128, 128)

* @ 3.10, m.nBlocks+3.43 TO 4.231, 60.400 PATTERN 1 COLOR

RGB(192, 192, 192, 192, 192, 192)

@ 3.10, m.nBlocks+3.40 TO 4.231, 60.400 PATTERN 1 COLOR

RGB(192, 192, 192, 192, 192, 192) && DO:970901

IF m.lnPct < 50

@ 3.15, m.lnPctAt SAY m.lcPct FONT c_dlgface,

c_dlgsize STYLE c_dlgstyle+"T" COLOR RGB( 0, 0, 0, 192, 192, 192)

ELSE

@ 3.15, m.lnPctAt SAY m.lcPct FONT c_dlgface,

c_dlgsize STYLE c_dlgstyle+"T" COLOR RGB(255, 255, 255, 192, 192, 192)

ENDIF

CASE m.lnPct < 1

m.nblocks = (m.lnPct / 100) * 57

m.lcPct = LTRIM(STR(m.lnPct))+" %"

IF PARAMETERS() > 2

@ 0.5, 3 SAY m.lcTopMsg FONT c_dlgface, c_dlgsize

STYLE c_dlgstyle

ENDIF

IF PARAMETERS() > 1

@ 1.5, 3 SAY m.lcBotMsg FONT c_dlgface, c_dlgsize

STYLE c_dlgstyle

ENDIF

m.lnPctAt = (WCOLS()-TXTWIDTH(m.lcPct))/2

@ 3.00, 3.33 TO 4.231, m.nBlocks + 3.333 PATTERN 1 COLOR

RGB( 128, 128, 128, 128, 128, 128)

@ 3.10, m.nBlocks+3.40 TO 4.231, 60.400 PATTERN 1 COLOR

RGB(192, 192, 192, 192, 192, 192)

IF m.lnPct < 50

@ 3.15, m.lnPctAt SAY m.lcPct FONT c_dlgface,

c_dlgsize STYLE c_dlgstyle+"T" COLOR RGB( 0, 0, 0, 192, 192, 192)

ELSE

@ 3.15, m.lnPctAt SAY m.lcPct FONT c_dlgface,

c_dlgsize STYLE c_dlgstyle+"T" COLOR RGB(255, 255, 255, 192, 192, 192)

ENDIF

CASE m.lnPct >= 100

m.nblocks = 57

m.lcPct = "100 %"

m.lnPctAt = (WCOLS()-TXTWIDTH(m.lcPct))/2

@ 3.000, 3.333 TO 4.231, m.nblocks + 3.333 PATTERN 1 COLOR

RGB(128, 128, 128, 128, 128, 128)

@ 3.15, m.lnPctAt SAY m.lcPct FONT c_dlgface, c_dlgsize

STYLE c_dlgstyle+"T" COLOR RGB(255, 255, 255, 192, 192, 192)

WAIT '' TIMEOUT .5

RELEASE WINDOW w_progress

SET CURSOR ON

ENDCASE

******************************

* Dan Olsson

* <mailto:dan@dolittle.se>

* <http://www.dolittle.se>

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/6.2.5.6.2.20100126102703.10240508@dolittle.se

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2010 Dan Olsson
Back to top
Re: Use a character from another codepage

Author: Lew

Posted: 2010-01-26 07:14:47   Link

Characters appear in fonts, not codepages. The relationship is somewhat more complicated than we assume.

-----Original Message-----

From: Paul Hill <paulroberthill@gmail.com>

Date: Tue, 26 Jan 2010 07:50:53

To: <profoxtech@leafe.com>

Subject: Re: Use a character from another codepage

On Mon, Jan 25, 2010 at 6:44 PM, Graham Trott <grahamskaraoke@gmail.com> wrote:

> Would like to use the block character from codepage 437 without changing codepages chr(219)=? and chr(255)= blank space

>

> VFP9 uses codepage 1252.

1252 is the codepage for Western European languages. In Russia VFP

would use 1251.

> I am not sure what the implications would be of changing the codepage in existing applications.

I don't believe you can change the codepage on an application basis

(especially not to a DOS cp like 437!).

>I would just like to create a simple progress bar that does not use any screen real estate.

©2010 Lew
Back to top
Re: Use a character from another codepage

Author: Jaime Vasquez

Posted: 2010-01-26 09:24:11   Link

Hi,

I don't think you can do that in Windows, but try with cpconvert:

Cpconvert(1252,437,Chr(255))

Greetings

Graham Trott wrote:

> Would like to use the block character from codepage 437 without changing codepages chr(219)=? and chr(255)= blank space

>

> VFP9 uses codepage 1252. I am not sure what the implications would be of changing the codepage in existing applications. I would just like to create a simple progress bar that does not use any screen real estate. For example:

>

> WAIT REPLICATE(CHR(219),50)+REPLICATE(CHR(255),50) WINDOW nowait

>

> Is there any way to map a character to a different codepage.

>

> --- StripMime Report -- processed MIME parts ---

> multipart/alternative

> text/plain (text body -- kept)

> text/html

> ---

>

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/4B5EFB0B.4080505@alexandria.cc

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2010 Jaime Vasquez