[Harbour-users] Warning about IIF statement question

Przemysław Czerpak druzus at acn.waw.pl
Thu Feb 4 08:05:28 EST 2010


On Wed, 03 Feb 2010, smu johnson wrote:

Hi,

> Hi, is there anyway to avoid the warning when I use an IFF without bothering
> to pass it an ELSE statement?  This is probably not a problem or anything,
> but just curious.
> Warning --> hello.PRG(4) Warning W0027  Meaningless use of expression
> 'Logical'

Clean your code and remove meaningless expression :-)
Above warning nicely help to clean the code and eliminate typos or
redundant/dummy expressions.

> ---- code ---
> FUNC MAIN()
>   LOCAL xSDate
>   Eval({|| iif(Empty(xSDate),xSDate:=date(),.t.),.t.})

First .T. is redundant and does nothing. Change the code to:
   Eval({|| iif(Empty(xSDate),xSDate:=date(),),.t.})

best regards,
Przemek


More information about the Harbour-users mailing list