FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Euro sign in Word with Harbour
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Euro sign in Word with Harbour
Posted: Wed May 29, 2013 04:44 PM

Hello
I have a probelm with Euro sign and HArbour

This works well with xHarbour
oText:TypeText( "€ " + "123.00")

in Harbour I have Ç 123,00 ( in video and in print )

some solution ?

Regard MAurizio

Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Re: Euro sign in Word with Harbour
Posted: Thu May 30, 2013 08:41 AM
Maurizio

Same for accented characters , looks like Harbour does not like them with OLE

Sending to Excel , same problem

I have on the top of my program
REQUEST HB_LANG_FR

and also HB_langSelect("FR")

but does not make a différence

Antonio any idea ?

this is a small sample

Code (fw): Select all Collapse
   TRY
       oExcel := CREATEOBJECT( "Excel.Application" )
    CATCH
       MSGSTOP("L'Application Microsoft Excel n'est pas installée sur cet Ordinateur !" )
       RETURN NIL
   END

   oBook  := oExcel:WorkBooks:Add()
   oSheet := oBook:Worksheets(1)

   nLine := 1
 
   oSheet:Cells( nLine, 1 ):Value = "Désignation"
    oSheet:Cells( nLine,2 ):Value = "Quantité"

   oExcel:Visible := .T.

   oexcel := nil


Richard
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: Euro sign in Word with Harbour Solved
Posted: Thu May 30, 2013 09:31 AM

Hello Richard

request HB_CODEPAGE_ITWIN
set( _SET_CODEPAGE, "ITWIN" )

Regards Maurizio

www.nipeservice.com

Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Euro sign in Word with Harbour
Posted: Thu May 30, 2013 10:07 AM
thereis an code
do you tried with #DEFINE EURO CHR(128)

(Alt + 128 is the symbol of euro )

on Print
oPrn:CmSay( x,y,Transform( Factura->Total,"@E 999,999.99" ) + Space(1) + Chr(128),oFont )

it coul be
oText:TypeText( chr(128) + "123.00")

to control make
#include "Fivewin.ch"
FUNCTION MAIN()

? ISOEM( CHR( 128 ) )
? ISANSI( CHR( 128 ) )

RETURN NIL

and remade these function
Code (fw): Select all Collapse
    CLIPPER ISANSI( PARAMS )         // cString    --> lAnsi
    {
       LPBYTE pString = ( LPBYTE ) _parc( 1 );
       WORD  w = 0, wLen = _parclen( 1 );
       BOOL  bAnsi = FALSE;

       while( w < wLen && ! bAnsi )
       {
          bAnsi = ( pString[ w ] >= 224 && pString[ w ] <= 255 ) || pString[ w ] == 128;
          w++;
       }

       _retl( bAnsi );
    }

    //----------------------------------------------------------------------------//

    CLIPPER ISOEM( PARAMS )         // cString    --> lOem
    {
       LPBYTE pString = ( LPBYTE ) _parc( 1 );
       WORD  w = 0, wLen = _parclen( 1 );
       BOOL  bOem = FALSE;

       while( w < wLen && ! bOem )
       {
          bOem = pString[ w ] > 128 && pString[ w ] <= 168;
          w++;
       }

       _retl( bOem );
    }
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Re: Euro sign in Word with Harbour Solved
Posted: Thu May 30, 2013 10:25 AM

Maurizio

Perfect ,

Thank you

Richard

http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013

Continue the discussion