FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Meaningless use of expression 'Logical'
Posts: 6
Joined: Wed May 30, 2007 01:17 PM
Meaningless use of expression 'Logical'
Posted: Tue Sep 22, 2009 11:13 AM

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

Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Meaningless use of expression 'Logical'
Posted: Sun Sep 27, 2009 11:50 PM
Hello,

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

Best Regards
Uwe :-)
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.
Posts: 312
Joined: Sat Oct 08, 2005 09:12 AM
Re: Meaningless use of expression 'Logical'
Posted: Mon Sep 28, 2009 09:55 AM
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:SetFocus())

Regards,
Detlef
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Meaningless use of expression 'Logical'
Posted: Mon Sep 28, 2009 01:35 PM

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

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion