I need proof of this...

Deskin, Bob Bob.Deskin at Cognos.COM
Fri Sep 23 05:58:07 CDT 2005


The PowerHouse parser requires that expressions appear on the right in a condition. If you have a simple item name on the left it will work, i.e. IF ITEM_NAME = 0, however, once you have an expression or substring, the constant must go on the left and the expression on the right, i.e. IF 0 = SIZE(FIELDTEXT). This also means that if you're comparing two expressions, you have to declare at least one of them as a DEFINE and use that on the left. I know that strictly speaking you could argue that it's still an expression, but that's the way the parser works rather than when it's processed.
 
So the parser checks tokens and loads the expression processor at parse time. The parser doesn't mind a simple item on the left even if it's a defined item because it's the item reference that's loaded. At execution time, the expression processor sees the defined item reference, evaluates the define and then proceeds with the expression on the right.
 
As for why the parser is like this, I don't know. That's the way it was written many years ago and we never changed. At this point we won't because we don't want to introduce any negative functional differences (bugs or otherwise).
 
Sorry if that was a bit long winded.
 
Bob

-----Original Message-----
From: powerh-l-bounces+bob.deskin=cognos.com at lists.sowder.com [mailto:powerh-l-bounces+bob.deskin=cognos.com at lists.sowder.com]On Behalf Of fernando.olmos at hpa.com.au
Sent: September 22, 2005 9:18 PM
To: powerh-l at lists.sowder.com
Subject: RE: I need proof of this...


So you're saying that if I have a field without a value on the left hand side, the program will fail? But I thought all temporaries default to 0 or blank before they are used? This sounds familiar. Thanks
 
-----Original Message-----
From: mgo at columbus.rr.com [mailto:mgo at columbus.rr.com] 
Sent: Friday, September 23, 2005 11:15 AM
To: Fernando Olmos; powerh-l at lists.sowder.com
Subject: RE: I need proof of this...



Fernando,

Powerhouse must have a constant value or one field that contains a value on the left side of the comparison operation. The right side may contain equations or other values that can be derived and distilled into a value for the purpose of the comparison.

Mike

 

 

-----Original Message-----
From: powerh-l-bounces+mgo=columbus.rr.com at lists.sowder.com [mailto:powerh-l-bounces+mgo=columbus.rr.com at lists.sowder.com] On Behalf Of fernando.olmos at hpa.com.au
Sent: Thursday, September 22, 2005 9:07 PM
To: powerh-l at lists.sowder.com
Subject: I need proof of this...

 

I cannot remember why I do it this way, but I was wondering if someone out there may be able to help me remember. 

For some reason, I write my IF statements with the literal FIRST before the item been tested ... 

i.e.:   if 0 = t_field1 ... 

Some people write it as ... 

        if t_field1 = 0 ... 

Now I would prefer to do it the 2nd way, but I believe there are some cases in Powerhouse where it gets confused if you do it like in the 2nd method. I think if you tried ...

        if index(T_field, "string") > 0 

it's not the same as ... 
        if 0 < index (t_field, "string") 

Now I know that sounds ridiculous, but I did come across problems with this years ago, but I don't remember exactly what it was. The point now is that I have got stuck into a habit with the 1st method mentioned above.

Cheers 

Fernando Olmos 
M.I.S. 

HPA
Direct:  03 9217 5411
Mobile: 0410 382 857
Fax:     03 9217 5716 

 <file:///H:\Appdata\Microsoft\Signatures\www.hpa.com.au> www.hpa.com.au 
  
       This message may contain privileged and/or confidential information.  If you have received this e-mail in error or are not the intended recipient, you may not use, copy, disseminate or distribute it; do not open any attachments, delete it immediately from your system and notify the sender promptly by e-mail that you have done so.  Thank you. 
        
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sowder.com/pipermail/powerh-l/attachments/20050923/3bfb132e/attachment.htm


More information about the powerh-l mailing list