How Come?

Deskin, Bob Bob.Deskin@Cognos.COM
Tue, 8 Dec 1998 22:02:43 -0500


As others have stated, but just for the record, the reason is that
expressions are not allowed on the left side of the comparison operator. In
other words, you must say

If 0 < size(fieldtext)

rather than the more natural

If size(fieldtext) > 0

The reason for the restriction is the way the PowerHouse parser works. In
order to figure out whether an expression is valid, it needs to know the
type (character, numeric, or date). Granted, it could just parse until there
was something wrong or error if the right side was the wrong type, but
that's the way it is.

Bob Deskin              
Senior Product Advisor  bob.deskin@cognos.com
Cognos Inc.             (613) 738-1338 ext 4205 FAX: (613) 228-3149
3755 Riverside Drive P.O. Box 9707 Stn. T, Ottawa ON K1G 4K9 CANADA


> ----------
> From: 	Terry Pickering[SMTP:pickering@myself.com]
> Sent: 	December 8, 1998 3:49 PM
> To: 	powerh-l@lists.swau.edu
> Subject: 	How Come?
> 
> I know this has probably been explained before but....... 
> 
> Can someone explain in QUICK the difference in the following two syntax
> examples, and which is the "better" way to code. 
> 
> 
> IF FIELD-AMT = 0  
>    THEN .... 
> 
> IF 0 = FIELD-AMT 
>    THEN .... 
> 
> The reason I'm asking, is because when I code, I normally use the first
> method and it usually works just fine. But if I try to use the following
> syntax, it doesn't work unless I put the field name on the right of the
> equation. 
> 
> IF FIELD-AMT - 10 = 0 
>    THEN .... 
> (does not work) 
> 
> IF 0 = FIELD-AMT - 10 
>    THEN .... 
> (works just fine) 
> 
> 
> 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
> Terry Pickering        Consultant Extraordinare 
> Monday and Friday        Tuesday - Thursday 
> Portland                 Eugene 
> (503) 245-7178           (541) 687-3416 
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ = = = = = = = =
> = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = Subscribe:
> "subscribe powerh-l" in message body to majordomo@lists.swau.edu
> Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
> powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l This
> list is closed, thus to post to the list, you must be a subscriber.
> 
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.