FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How can I show an empty numeric field without a zero
Posts: 21
Joined: Mon Mar 20, 2006 12:48 PM
How can I show an empty numeric field without a zero
Posted: Mon May 01, 2006 06:09 PM

Hi All,
In an app I have numeric fields in which no result of earlier actions are known yet.
In an TsBrowse presentation I want no "zero" in the field but an empty field presentation.
Dbases tend to put a zero in a numeric field, but in certain cases there is no value available yet.

How can I force that field into an empty field.

Thanks,

Jules

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: How can I show an empty numeric field without a zero
Posted: Mon May 01, 2006 07:16 PM

Just use

TRANSFORM( "@Z ...", FIELD -> number )

as browse column expression or directly

PICTURE "@Z ..."

if your browse supports it.

EMG

Posts: 21
Joined: Mon Mar 20, 2006 12:48 PM
How can I show an empty numeric field without a zero
Posted: Mon May 01, 2006 09:02 PM

Enrico,
Thanks for advising me.
I am not able to do the right thing with it.
I will give some more specific info.
I use TsBrowse with Add Column

  ADD COLUMN TO oBrw[ 1 ];
      HEADER "Runs2" ;
      SIZE 50 PIXELS ;
      DATA FieldWblock("Uitslag2", Select()); 
      COLORS CLR_YELLOW,CLR_BLUE;
      ALIGN DT_CENTER

When nUitslag2 == 0 it should display a blank field.

Is that possible or should I change the next line in a Resource?

REDEFINE GET onUitslag2 VAR nUitslag2 ID 105 OF oDlwBew UPDATE Picture "999"

Thanks,

Jules

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
How can I show an empty numeric field without a zero
Posted: Tue May 02, 2006 06:38 AM

Try
ADD COLUMN TO oBrw[ 1 ];
HEADER "Runs2" ;
SIZE 50 PIXELS ;
DATA FieldWblock("Uitslag2", Select());
COLORS CLR_YELLOW,CLR_BLUE;
ALIGN DT_CENTER;
PICTURE "@Z 999"

or, if that command doesn't support PICTURE clause

DATA TRANSFORM( "@Z 999", FIELD -> Uitslag2 );

EMG

Posts: 21
Joined: Mon Mar 20, 2006 12:48 PM
How can I show an empty numeric field without a zero
Posted: Tue May 02, 2006 11:30 PM

Enrico,
This works OK:

ADD COLUMN TO oBrw[ 1 ];
HEADER "Runs2" ;
SIZE 50 PIXELS ;
DATA FieldWblock("Uitslag2", Select());
COLORS CLR_YELLOW,CLR_BLUE;
ALIGN DT_CENTER;
PICTURE "@Z 999"

TsBrowse does not recognize Transform in this place

DATA TRANSFORM( "@Z 999", FIELD -> Uitslag2 );

However in my database I have to differentiate between certain records with a different field content to show zero's or blanks.

It does not work when I use :
If Gesp == "J"
Add Column etc
Picture "@Z 999"
Else
Add Column etc
Endif

So it is all blanks or zero's.
I need both depending on field Gesp

Jules

Posts: 83
Joined: Tue Nov 08, 2005 11:09 AM
How can I show an empty numeric field without a zero
Posted: Wed May 03, 2006 01:54 PM

ADD COLUMN ...
:
:
PICTURE if(Gesp='J','@Z 999','999')

Regards

Hoe, email: easywin3@yahoo.com
Posts: 21
Joined: Mon Mar 20, 2006 12:48 PM
How can I show an empty numeric field without a zero
Posted: Wed May 03, 2006 11:07 PM

Great TNHOE,

It works perfectly.
Thanks,

Jules

Continue the discussion