calculating text-fields

Questions, tips and tricks and techniques for scripting in Servoy

calculating text-fields

Postby Harjo » Sat Jun 07, 2003 11:24 am

Hi,
I have three text fields: titel, voorletter, achternaam
I have one calculated field(stored): naamcompleet:

return titel + " " + voorletter = " " + achternaam;

Oke that works, but if one field is null (not filled in!) the calculation returns: null in text format.
Is there something to be done? or do have to check every field for empty and null values?

BTW the values don't become empty when I only click in and out of a field. I have to put some text, delete it and then it becomes empty. is this normal?
Last edited by Harjo on Tue Jun 10, 2003 8:59 am, edited 1 time in total.
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby Ron » Sat Jun 07, 2003 2:56 pm

No you don't have to check this.
You simply have to be sure the ALLOW NULL box is empty in the
dataproviders/column_tab!!
Ron
 
Posts: 315
Joined: Fri May 23, 2003 12:30 am
Location: Netherlands

Postby Harjo » Tue Jun 10, 2003 9:01 am

Jan/Maarten/anyone,

Is this the best solution? or are there other ones?
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby Jan Aleman » Tue Jun 10, 2003 1:43 pm

The checkbox ALLOW NULL has a very different purpose. 'ALLOW NULL' means that a value is ALLOWED to be NULL and nothing more or less.

We are looking into parsing null's differently so that you don't get null in your strings if you concatenate. We don't know yet if that will make it into 1.1 final. For the time being you will have to use mergefields to acoomplish this or use if's in your calc to check for null
Jan Aleman
Servoy
Jan Aleman
 
Posts: 2083
Joined: Wed Apr 23, 2003 9:49 pm
Location: Planet Earth

Postby Harjo » Tue Jun 10, 2003 2:59 pm

The suggestion of Ron works fine, until I restart Servoy Developer!
All my fields are checked with: ALLOW NULL again!!!

Is this a bug?
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby jcompagner » Sun Jul 13, 2003 1:55 pm

in RC4 null values of strings are concated as empty strings now.
So no need to check for null anymore when you want to concat strings.
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Methods

Who is online

Users browsing this forum: No registered users and 3 guests