RE: [mapguide-users] Need help with IF-statment in Tool Tip

2009-11-13 Thread Martin Morrison
If the "empty" values are truly null, then check for null instead of checking 
the length. E.G

if($featureReader->IsNull('BILLING_ADD')){ 
$billing_address = " "; 
}


-Original Message-
From: mapguide-users-boun...@lists.osgeo.org 
[mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Kratz
Sent: Thursday, November 12, 2009 11:11 AM
To: mapguide-users@lists.osgeo.org
Subject: RE: [mapguide-users] Need help with IF-statment in Tool Tip


I cant understand how this If-statement works 

I thought the [condition] was integer based. ex Length(BYGGINV_1)>0 
But obviously not... 

Could someone help explain how this If-statement work or better up how I can
find out whether the atribute contains any text (string) or not! 

Ex of how my table looks like:
http://n2.nabble.com/file/n3993782/Tabel.bmp 
-- 
View this message in context: 
http://n2.nabble.com/Need-help-with-IF-statment-in-Tool-Tip-tp3985605p3993782.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users

___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


RE: [mapguide-users] Need help with IF-statment in Tool Tip

2009-11-12 Thread Kratz

I cant understand how this If-statement works 

I thought the [condition] was integer based. ex Length(BYGGINV_1)>0 
But obviously not... 

Could someone help explain how this If-statement work or better up how I can
find out whether the atribute contains any text (string) or not! 

Ex of how my table looks like:
http://n2.nabble.com/file/n3993782/Tabel.bmp 
-- 
View this message in context: 
http://n2.nabble.com/Need-help-with-IF-statment-in-Tool-Tip-tp3985605p3993782.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


RE: [mapguide-users] Need help with IF-statment in Tool Tip

2009-11-11 Thread Martin Morrison
Check for null before you run your if statement...

From: mapguide-users-boun...@lists.osgeo.org 
[mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Kratz Fredrik - SBF
Sent: Wednesday, November 11, 2009 10:35 AM
To: MapGuide Users Mail List
Subject: SV: [mapguide-users] Need help with IF-statment in Tool Tip

BYGGINV_2 is a string, the name of a document (if existing).




Från: mapguide-users-boun...@lists.osgeo.org 
[mailto:mapguide-users-boun...@lists.osgeo.org] För Martin Morrison
Skickat: den 11 november 2009 14:43
Till: MapGuide Users Mail List
Ämne: RE: [mapguide-users] Need help with IF-statment in Tool Tip

Is your BYGGINV_2 an integer/double/etc field or is it a string?  As far as I 
know length only works on a string.

Martin

From: mapguide-users-boun...@lists.osgeo.org 
[mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Kratz
Sent: Wednesday, November 11, 2009 8:41 AM
To: mapguide-users@lists.osgeo.org
Subject: SV: [mapguide-users] Need help with IF-statment in Tool Tip

Here is the error message:

The expression is invalid
Error: Argument types for function 'If' are mismatched. Click here to move the 
cursor to the error (1)#1
Error: Result types are mismatched: the validation operation expected 'Text' 
but the expression returned 'Unknown'


It’s the same whether I use  If (  LENGTH(BYGGINV_2) > 0,  BYGGINV_2 , 0)  or 
If (  LENGTH(BYGGINV_2) > 0,  BYGGINV_2 , ' ' )

I get the feeling that the problem is LENGTH(BYGGINV_2) > 0 but I cant 
understand how ?

Från: JamesDudden [via OSGeo.org] [mailto:[hidden 
email]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3986496&i=0>]
Skickat: den 11 november 2009 13:31
Till: Kratz Fredrik - SBF
Ämne: Re: [mapguide-users] Need help with IF-statment in Tool Tip

What does the error say? It normally points to which bit is wrong.

Is it the empty string?
Try putting a 0 instead like this:
If (  LENGTH(BYGGINV_2) > 0,  BYGGINV_2 , 0)
Kratz wrote:
Hi!

I need help writing a correct string with an if-statement.

Trying to determine whether an attribute contains any value(string) or not.

Why doesn't this string work?

If (  LENGTH(BYGGINV_2) > 0,  BYGGINV_2 , ' ' )


Default:
If ( [condition], [trueValue], [falseValue] )
Software Matters<http://www.software-matters.co.uk> - Bespoke 
Database<http://www.software-matters.co.uk/bespoke-database-design.html> and 
Software Solutions


View message @ 
http://n2.nabble.com/Need-help-with-IF-statment-in-Tool-Tip-tp3985605p3986117.html
To unsubscribe from Need help with IF-statment in Tool Tip, click here.


________________
View this message in context: SV: [mapguide-users] Need help with IF-statment 
in Tool 
Tip<http://n2.nabble.com/Need-help-with-IF-statment-in-Tool-Tip-tp3985605p3986496.html>
Sent from the MapGuide Users mailing list 
archive<http://n2.nabble.com/MapGuide-Users-f1803227.html> at Nabble.com.
___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


SV: [mapguide-users] Need help with IF-statment in Tool Tip

2009-11-11 Thread Kratz Fredrik - SBF
BYGGINV_2 is a string, the name of a document (if existing).

 

 

  

 

Från: mapguide-users-boun...@lists.osgeo.org 
[mailto:mapguide-users-boun...@lists.osgeo.org] För Martin Morrison
Skickat: den 11 november 2009 14:43
Till: MapGuide Users Mail List
Ämne: RE: [mapguide-users] Need help with IF-statment in Tool Tip

 

Is your BYGGINV_2 an integer/double/etc field or is it a string?  As far as I 
know length only works on a string.

 

Martin

 

From: mapguide-users-boun...@lists.osgeo.org 
[mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Kratz
Sent: Wednesday, November 11, 2009 8:41 AM
To: mapguide-users@lists.osgeo.org
Subject: SV: [mapguide-users] Need help with IF-statment in Tool Tip

 

Here is the error message:

 

The expression is invalid

Error: Argument types for function 'If' are mismatched. Click here to move the 
cursor to the error (1)#1

Error: Result types are mismatched: the validation operation expected 'Text' 
but the expression returned 'Unknown'

 

 

It’s the same whether I use  If (  LENGTH(BYGGINV_2) > 0,  BYGGINV_2 , 0)  or 
If (  LENGTH(BYGGINV_2) > 0,  BYGGINV_2 , ' ' )  

 

I get the feeling that the problem is LENGTH(BYGGINV_2) > 0 but I cant 
understand how ?

 

Från: JamesDudden [via OSGeo.org] [mailto:[hidden email] 
<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3986496&i=0> ] 
Skickat: den 11 november 2009 13:31
Till: Kratz Fredrik - SBF
Ämne: Re: [mapguide-users] Need help with IF-statment in Tool Tip

 

What does the error say? It normally points to which bit is wrong. 

Is it the empty string? 
Try putting a 0 instead like this: 
If (  LENGTH(BYGGINV_2) > 0,  BYGGINV_2 , 0)   

Kratz wrote:

Hi! 

I need help writing a correct string with an if-statement. 

Trying to determine whether an attribute contains any value(string) or not. 

Why doesn't this string work? 

If (  LENGTH(BYGGINV_2) > 0,  BYGGINV_2 , ' ' )   


Default: 
If ( [condition], [trueValue], [falseValue] )   

Software Matters <http://www.software-matters.co.uk>  - Bespoke Database 
<http://www.software-matters.co.uk/bespoke-database-design.html>  and Software 
Solutions

 



View message @ 
http://n2.nabble.com/Need-help-with-IF-statment-in-Tool-Tip-tp3985605p3986117.html
 
To unsubscribe from Need help with IF-statment in Tool Tip, click here. 

 

 

________________

View this message in context: SV: [mapguide-users] Need help with IF-statment 
in Tool Tip 
<http://n2.nabble.com/Need-help-with-IF-statment-in-Tool-Tip-tp3985605p3986496.html>
 
Sent from the MapGuide Users mailing list archive 
<http://n2.nabble.com/MapGuide-Users-f1803227.html>  at Nabble.com.

___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


RE: [mapguide-users] Need help with IF-statment in Tool Tip

2009-11-11 Thread Martin Morrison
Is your BYGGINV_2 an integer/double/etc field or is it a string?  As far as I 
know length only works on a string.

Martin

From: mapguide-users-boun...@lists.osgeo.org 
[mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of Kratz
Sent: Wednesday, November 11, 2009 8:41 AM
To: mapguide-users@lists.osgeo.org
Subject: SV: [mapguide-users] Need help with IF-statment in Tool Tip

Here is the error message:

The expression is invalid
Error: Argument types for function 'If' are mismatched. Click here to move the 
cursor to the error (1)#1
Error: Result types are mismatched: the validation operation expected 'Text' 
but the expression returned 'Unknown'


It’s the same whether I use  If (  LENGTH(BYGGINV_2) > 0,  BYGGINV_2 , 0)  or 
If (  LENGTH(BYGGINV_2) > 0,  BYGGINV_2 , ' ' )

I get the feeling that the problem is LENGTH(BYGGINV_2) > 0 but I cant 
understand how ?

Från: JamesDudden [via OSGeo.org] [mailto:[hidden 
email]<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3986496&i=0>]
Skickat: den 11 november 2009 13:31
Till: Kratz Fredrik - SBF
Ämne: Re: [mapguide-users] Need help with IF-statment in Tool Tip

What does the error say? It normally points to which bit is wrong.

Is it the empty string?
Try putting a 0 instead like this:
If (  LENGTH(BYGGINV_2) > 0,  BYGGINV_2 , 0)
Kratz wrote:
Hi!

I need help writing a correct string with an if-statement.

Trying to determine whether an attribute contains any value(string) or not.

Why doesn't this string work?

If (  LENGTH(BYGGINV_2) > 0,  BYGGINV_2 , ' ' )


Default:
If ( [condition], [trueValue], [falseValue] )
Software Matters<http://www.software-matters.co.uk> - Bespoke 
Database<http://www.software-matters.co.uk/bespoke-database-design.html> and 
Software Solutions


View message @ 
http://n2.nabble.com/Need-help-with-IF-statment-in-Tool-Tip-tp3985605p3986117.html
To unsubscribe from Need help with IF-statment in Tool Tip, click here.


________________
View this message in context: SV: [mapguide-users] Need help with IF-statment 
in Tool 
Tip<http://n2.nabble.com/Need-help-with-IF-statment-in-Tool-Tip-tp3985605p3986496.html>
Sent from the MapGuide Users mailing list 
archive<http://n2.nabble.com/MapGuide-Users-f1803227.html> at Nabble.com.
___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


SV: [mapguide-users] Need help with IF-statment in Tool Tip

2009-11-11 Thread Kratz

Here is the error message:

 

The expression is invalid

Error: Argument types for function 'If' are mismatched. Click here to move the 
cursor to the error (1)#1

Error: Result types are mismatched: the validation operation expected 'Text' 
but the expression returned 'Unknown'

 

 

It's the same whether I use  If (  LENGTH(BYGGINV_2) > 0,  BYGGINV_2 , 0)  or 
If (  LENGTH(BYGGINV_2) > 0,  BYGGINV_2 , ' ' )  

 

I get the feeling that the problem is LENGTH(BYGGINV_2) > 0 but I cant 
understand how ?

 

Från: JamesDudden [via OSGeo.org] 
[mailto:ml-node+3986117-1900696...@n2.nabble.com] 
Skickat: den 11 november 2009 13:31
Till: Kratz Fredrik - SBF
Ämne: Re: [mapguide-users] Need help with IF-statment in Tool Tip

 

What does the error say? It normally points to which bit is wrong. 

Is it the empty string? 
Try putting a 0 instead like this: 
If (  LENGTH(BYGGINV_2) > 0,  BYGGINV_2 , 0)   

Kratz wrote:

Hi! 

I need help writing a correct string with an if-statement. 

Trying to determine whether an attribute contains any value(string) or not. 

Why doesn't this string work? 

If (  LENGTH(BYGGINV_2) > 0,  BYGGINV_2 , ' ' )   


Default: 
If ( [condition], [trueValue], [falseValue] )   

Software Matters <http://www.software-matters.co.uk>  - Bespoke Database 
<http://www.software-matters.co.uk/bespoke-database-design.html>  and Software 
Solutions

 



View message @ 
http://n2.nabble.com/Need-help-with-IF-statment-in-Tool-Tip-tp3985605p3986117.html
 
To unsubscribe from Need help with IF-statment in Tool Tip, click here < (link 
removed) > . 

 


-- 
View this message in context: 
http://n2.nabble.com/Need-help-with-IF-statment-in-Tool-Tip-tp3985605p3986496.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


Re: [mapguide-users] Need help with IF-statment in Tool Tip

2009-11-11 Thread JamesDudden

What does the error say? It normally points to which bit is wrong.

Is it the empty string? 
Try putting a 0 instead like this:
If (  LENGTH(BYGGINV_2) > 0,  BYGGINV_2 , 0)   


Kratz wrote:
> 
> Hi!
> 
> I need help writing a correct string with an if-statement.
> 
> Trying to determine whether an attribute contains any value(string) or
> not.
> 
> Why doesn't this string work?
> 
> If (  LENGTH(BYGGINV_2) > 0,  BYGGINV_2 , ' ' )   
> 
> 
> Default:
> If ( [condition], [trueValue], [falseValue] )  
> 


-
http://www.software-matters.co.uk Software Matters  - 
http://www.software-matters.co.uk/bespoke-database-design.html Bespoke
Database  and Software Solutions
-- 
View this message in context: 
http://n2.nabble.com/Need-help-with-IF-statment-in-Tool-Tip-tp3985605p3986117.html
Sent from the MapGuide Users mailing list archive at Nabble.com.
___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users