Page 1 of 2

Display issue with 2.0

Posted: Thu Oct 22, 2015 8:04 am
by bwolfsohn
The following code has worked for the past 10 years... it is displaying properly under 1.9SL1 (355) the british pound sign does not display properly in xbase++2.0

CREATEGET @PRO_CURRENCY ;
ROW @xx ITEM @num NSAYCOL Saycol NGETCOL getcol+1.5 ;
PICTURE "X";
VALID {|| PRO_CURRENCY$"123 " } ;
PROMPT "Enter currency Designation 1 = US ($) 2 = British (œ) 3 = Euro - (Leave Blank for None)" ;
MESSAGE 'Enter 1 for US Dollar ($) or 2 for British pound (œ) 3 for Euro '

this is all preprocessed into a dcsay/get

has anyone else come across this ??

Re: Display issue with 2.0

Posted: Thu Oct 22, 2015 8:48 am
by rdonnay
Are you using SetLocale() to set the currency?

Re: Display issue with 2.0

Posted: Thu Oct 22, 2015 9:49 am
by Cliff Wiernik
I have not encountered this, but I have other items.

Re: Display issue with 2.0

Posted: Thu Oct 22, 2015 10:11 am
by bwolfsohn
rdonnay wrote:Are you using SetLocale() to set the currency?

only for euro

Code: Select all

IF PRO_CURRENCY=="3"
  SetLocale( NLS_SCURRENCY, Chr(213) )
  SetLocale( NLS_ICURRENCYEURO, "1" )
ELSE
  SetLocale( NLS_SCURRENCY, "$" )
  SetLocale( NLS_ICURRENCYEURO, "0" )
ENDIF


Re: Display issue with 2.0

Posted: Wed Feb 08, 2017 9:26 am
by bwolfsohn
bwolfsohn wrote:
rdonnay wrote:Are you using SetLocale() to set the currency?

only for euro

Code: Select all

IF PRO_CURRENCY=="3"
  SetLocale( NLS_SCURRENCY, Chr(213) )
  SetLocale( NLS_ICURRENCYEURO, "1" )
ELSE
  SetLocale( NLS_SCURRENCY, "$" )
  SetLocale( NLS_ICURRENCYEURO, "0" )
ENDIF

bump...

I've tried
setlocale(NLS_SCURRENCY,"œ") // this s/b the pound sign.. When i paste this into xdot, it shows the lb sign, but it doesn't work... it returns a lower case o
the asc of œ is 111

when i originally wrote this in clipper, it worked.... :clap:
but in 2.0, it doesn't :naughty:

has anyone figured this out ?? :pray:

Re: Display issue with 2.0

Posted: Wed Feb 08, 2017 10:07 am
by reganc
In most of our dialogs we do not actually display a pound sign.

But I do have a couple of dialogs that do display one and in those (in a DCSAY) I have to use ConvToOEMCP(<string including pound sign>) to get it to show correctly.

Re: Display issue with 2.0

Posted: Wed Feb 08, 2017 10:13 am
by bwolfsohn
Reagan,

Thanks for the approach...

We use it more for printing invoices.. it's displayed in a few places, but bills are the key...

Re: Display issue with 2.0

Posted: Wed Feb 08, 2017 10:25 am
by bwolfsohn
reganc wrote:In most of our dialogs we do not actually display a pound sign.

But I do have a couple of dialogs that do display one and in those (in a DCSAY) I have to use ConvToOEMCP(<string including pound sign>) to get it to show correctly.
It doesn't appear to work by itself, xdot still display a lower case o

are you using SET_CHARSET or localeconfigure() ??

I'm unable to test ? localeconfigure() in xdot since it throws an error...

Re: Display issue with 2.0

Posted: Wed Feb 08, 2017 10:54 am
by reganc
bwolfsohn wrote:
reganc wrote:In most of our dialogs we do not actually display a pound sign.

But I do have a couple of dialogs that do display one and in those (in a DCSAY) I have to use ConvToOEMCP(<string including pound sign>) to get it to show correctly.
It doesn't appear to work by itself, xdot still display a lower case o

are you using SET_CHARSET or localeconfigure() ??

I'm unable to test ? localeconfigure() in xdot since it throws an error...
I don't use localeconfigure or SET CHARSET TO at all. Or XDot really.

On that dialog I have this DCSAY:

@ nRow,nCol DCSAY {|| UPLIFT_Disp_Value(iif(aTakings[TAK_EL_FO_VALUE]<>0,aTakings[TAK_EL_FO_VALUE],aTakings[TAK_EL_FO_ARRAY_TOTAL])) } ;
SIZE Rba_Col(12),Rba_GetHeight(1) ;
COLOR GRA_CLR_BLACK , Say_Field_Color() ;
OPTIONS XBPALIGN_RIGHT + XBPALIGN_VCENTER ;
ID "FO_TOTAL"

and the following function is the one used:

STATIC FUNCTION UPLIFT_Disp_Value(nValue)

LOCAL cValue

nValue := round(nValue,2)
if nValue < 0
cValue:="-£"+ntrim(abs(nValue),,2)
else
cValue:="£"+ntrim(nValue,,2)
endif
RETURN ConvToOEMCP(cValue)

The DCSAY on the dialog shows the pound sign followed immediately by the value to 2 decimal places. I have made a couple of small mods to remove some stuff to make it easier to read.

Incidentally, in your 1st post above, the pound sign in the PROMPT string shows as an 'oe' character in brackets...

Re: Display issue with 2.0

Posted: Wed Feb 08, 2017 10:57 am
by bwolfsohn
reganc wrote:
bwolfsohn wrote:
reganc wrote:Incidentally, in your 1st post above, the pound sign in the PROMPT string shows as an 'oe' character in brackets...
In xdot, when i ask it ? pound sign symbol, that is how it displays... :(