Meaningless use of expression 'Logical'

Meaningless use of expression 'Logical'

Postby camelot » 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
camelot
 
Posts: 6
Joined: Wed May 30, 2007 1:17 pm

Re: Meaningless use of expression 'Logical'

Postby ukoenig » Sun Sep 27, 2009 11:50 pm

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
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Meaningless use of expression 'Logical'

Postby Detlef Hoefner » Mon Sep 28, 2009 9: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:oDlg:SetFocus())

Regards,
Detlef
User avatar
Detlef Hoefner
 
Posts: 312
Joined: Sat Oct 08, 2005 9:12 am
Location: Germany

Re: Meaningless use of expression 'Logical'

Postby James Bott » Mon Sep 28, 2009 1:35 pm

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

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 86 guests