JCrum


I want to evaluate two fields before I include it in my report.
I'm not sure if what I have is correct, can someone help me with the syntax:

IIF(EMPTY(grntradd) OR ISNULL(grntradd) OR PROPER(grntradd)=PROPER(mailaddr),"Not Available",PROPER(grntradd)))

Thanks,
Jennifer



Re: Need help with report expression

Vladimir Zografski


Hi Jennifer

Code Snippet

IIF(EMPTY(grntradd) OR ISNULL(grntradd) OR PROPER(grntradd)=PROPER(mailaddr),"Not Available",PROPER(grntradd)) &&& )









Re: Need help with report expression

dni

So, where is the difference What is doing &&&, please...







Re: Need help with report expression

Vladimir Zografski

Hi Dni
One more parenthesis to the right in this command

IIF(EMPTY(grntradd) OR ISNULL(grntradd) OR PROPER(grntradd)=PROPER(mailaddr),"Not Available",PROPER(grntradd)))

Correct is

Code Snippet

IIF(EMPTY(grntradd) OR ISNULL(grntradd) OR PROPER(grntradd)=PROPER(mailaddr),"Not Available",PROPER(grntradd))








Re: Need help with report expression

Tamar E. Granor

And here's a little trick for checking parens (though I need much less now that VFP shows me what's inside when I close a paren):

Start at the left hand side of your expression and count. Go up one for each left paren and down one for each right. If you don't wind up at 0, then you don't have matched parens. (With the original expression in this thread, you'd end up at -1, meaning one right paren too many.)

This still doesn't resolve getting them in the right places, but you can apply the same technique to a subset of an expression.

Tamar




Re: Need help with report expression

dni

You are right. Thanks.






Re: Need help with report expression

JCrum

I'm confused, the &&& adds a prenthesis




Re: Need help with report expression

JCrum

Never mind. I get it now. It's been a long day....




Re: Need help with report expression

JCrum

I actually did have the third parens already in my code.
So the evaluation of:
PROPER(grntradd)=PROPER(mailaddr)

is correct