Meaningless use of expression ':'

Meaningless use of expression ':'

Postby Franklin Demont » Wed Sep 12, 2012 10:11 am

Hello

Next code gives this warning W0027

Code: Select all  Expand view

@ 130 , 50 GET oGet VAR ww PICT "!!" OF oDLg PIXEL ;
SIZE 20,12 ;
PASSWORD ;
VALID (IIF(ww==HB_DeCrypt(BEDIENDE->WW,"BRECHT") .OR. tel > 2 , (lOk := .T. , oDlg:End ) , tel++)  , oBrw:SetFocus() , .T. )
 

PPO :
Code: Select all  Expand view

oGet := TGet():New( 130, 50, { | u | If( PCount()==0, ww, ww:= u ) }, oDLg, 20, 12, "!!",;
 {|| (IIF(ww==HB_DeCrypt(BEDIENDE->WW,"BRECHT") .OR. tel > 2 , (lOk := .T. , oDlg:End ) , tel++)  , oBrw:SetFocus() , .T. )},,,, .F.,, .T.,, .F.,, .F., .F.,, .F., .T.,,,,,,,,,, "ww", )
 


What is wrong ?

Frank
test
Franklin Demont
 
Posts: 166
Joined: Wed Aug 29, 2012 8:25 am

Re: Meaningless use of expression ':'

Postby MarcoBoschi » Wed Sep 12, 2012 12:26 pm

Try to rewrite IIF command line in a function and write the code like this


@ 130 , 50 GET oGet VAR ww PICT "!!" OF oDLg PIXEL ;
SIZE 20,12 ;
PASSWORD ;
VALID myvalid( ww , tel , oDlg )

Code: Select all  Expand view

FUNCTION myvalid(ww , tel , oDlg )

IF ww == HB_DeCrypt( BEDIENDE->WW , "BRECHT" ) .OR. tel > 2
   lOk := .T.
   oDlg:End
ELSE
   tel++
ENDIF
oBrw:SetFocus()
RETURN .T.

 


I have no solution
just try it
User avatar
MarcoBoschi
 
Posts: 1065
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Re: Solved

Postby Franklin Demont » Wed Sep 12, 2012 7:29 pm

Marco ,

Thanks for the tip. Excluding the IIF statemant solves the problem , but the reason was oDlg:end , it must be oDlg:end()

I try to make a conversion from xharbour to harbour and had to change next line to :

OBrw:bPastEof() := ... in OBrw:bPastEof := ...

In this stage from conversion i have compiler option w1 and es2. I tested again with xharbour , but the compiler seems not to generate a warning.

Frank
test
Franklin Demont
 
Posts: 166
Joined: Wed Aug 29, 2012 8:25 am


Return to FiveWin for Harbour/xHarbour

Who is online

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