How can I show an empty numeric field without a zero

Post Reply
Jules de Pierre
Posts: 21
Joined: Mon Mar 20, 2006 12:48 pm
Location: Netherlands

How can I show an empty numeric field without a zero

Post by Jules de Pierre »

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
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: How can I show an empty numeric field without a zero

Post by Enrico Maria Giordano »

Just use

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

as browse column expression or directly

PICTURE "@Z ..."

if your browse supports it.

EMG
Jules de Pierre
Posts: 21
Joined: Mon Mar 20, 2006 12:48 pm
Location: Netherlands

Post by Jules de Pierre »

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
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Post by Enrico Maria Giordano »

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
Jules de Pierre
Posts: 21
Joined: Mon Mar 20, 2006 12:48 pm
Location: Netherlands

Post by Jules de Pierre »

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
User avatar
tnhoe
Posts: 83
Joined: Tue Nov 08, 2005 11:09 am
Location: Malaysia
Contact:

Post by tnhoe »

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

Hoe, email: easywin3@yahoo.com
Jules de Pierre
Posts: 21
Joined: Mon Mar 20, 2006 12:48 pm
Location: Netherlands

Post by Jules de Pierre »

Great TNHOE,

It works perfectly.
Thanks,

Jules
Post Reply