Meaningless use of expression 'Logical'

Post Reply
camelot
Posts: 6
Joined: Wed May 30, 2007 1:17 pm

Meaningless use of expression 'Logical'

Post by camelot »

Hi All,

I have Updated to the new Version FWH 9.08 and Harbour 2.0
During compilation i get the warning Meaningless use of expression 'Logical'

Example:
REDEFINE BTNBMP ::oBtn[14,1] ID 95 noborder;
RESOURCE "MGET1","","MGET11" OF ::oFld:aDialogs[1] ;
ACTION (IF(oSchl:Formular(oSchl:oSchlDbf), oSchl:BtnUpdate("STAMM"), .T. ),oSchl:oDlg:SetFocus()) ;
TOOLTIP "Formular-Texte" ;
MESSAGE "Formular-Texte in der ausgewählten Sprache"
::oBtn[14,2] := {|| IF(! ::oSchlDbf:lReadOnly .OR. ::oSchlDbf:sprache="DEUTSCH" , .T., .F.)}

this get the warning
ACTION (IF(oSchl:Formular(oSchl:oSchlDbf), oSchl:BtnUpdate("STAMM"), .T. ),oSchl:oDlg:SetFocus()) ;
but this works
ACTION (IF(oSchl:Formular(oSchl:oSchlDbf), oSchl:BtnUpdate("STAMM"), ),oSchl:oDlg:SetFocus()) ;

I will not change my complete sourcecode.
Have you any solution for me

Thanks in advance
camelot
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: Meaningless use of expression 'Logical'

Post by ukoenig »

Hello,

I think using Your syntax :
IF(! ::oSchlDbf:lReadOnly .OR. ::oSchlDbf:sprache="DEUTSCH" , .T., .F.)
it must be :
IIF(! ::oSchlDbf:lReadOnly .OR. ::oSchlDbf:sprache="DEUTSCH" , .T., .F.)

Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
Detlef Hoefner
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany
Contact:

Re: Meaningless use of expression 'Logical'

Post by Detlef Hoefner »

camelot,

if() or iif() is the same.

But the compiler is correct.
An action like '.t.' is meaningless, because it is no action.
You should write 'NIL' in case the second state of your if doesn't need an action.

ACTION (IF(oSchl:Formular(oSchl:oSchlDbf), oSchl:BtnUpdate("STAMM"), NIL ),oSchl:oDlg:SetFocus())

Regards,
Detlef
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Meaningless use of expression 'Logical'

Post by James Bott »

I agree with Detlef, it should either be NIL or left blank.

James
Post Reply