FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Meaningless use of expression ':'
Posts: 166
Joined: Wed Aug 29, 2012 08:25 AM

Meaningless use of expression ':'

Posted: Wed Sep 12, 2012 10:11 AM
Hello

Next code gives this warning W0027

Code (fw): Select all Collapse
@ 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 (fw): Select all Collapse
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
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM

Re: Meaningless use of expression ':'

Posted: 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 (fw): Select all Collapse
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
Marco Boschi
info@marcoboschi.it
Posts: 166
Joined: Wed Aug 29, 2012 08:25 AM

Re: Solved

Posted: Wed Sep 12, 2012 07: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

Continue the discussion