FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour harbour behaviour on DIALOG INIT
Posts: 104
Joined: Tue Feb 09, 2021 04:20 PM
harbour behaviour on DIALOG INIT
Posted: Wed Mar 05, 2025 03:40 PM
SYSTEM ERROR
Error BASE/1004 Message not found: TDIALOG:BCODEBLOCK
Called from __ERRRT_SBASE(0)
Called from TDIALOG:ERROR(0)
Called from (b)HBOBJECT(0)
Called from TDIALOG:MSGNOTFOUND(0)
Called from TDIALOG:BCODEBLOCK(0)
Called from (b)DLGTEXTMSGCLASS_EXECUTE(118)
Called from TDIALOG:INITIATE(0)
Called from TDIALOG:HANDLEEVENT(0)
Called from DIALOGBOXINDIRECT(0)
Called from TDIALOG:ACTIVATE(0)
Called from DLGTEXTMSGCLASS:EXECUTE(118)
Called from ZE_FWTEXTMSG(9)
Called from DO(0)
Called from DOPRG(152)
First code, ok no error:
PROCEDURE ze_fwTextMsg

   LOCAL oDlgMsg

   oDlgMsg := DlgTextMsgClass():New()
   oDlgMsg:bCodeBlock := { || ThisTest( oDlgMsg ) }
   oDlgMsg:Execute()
Class ok
CREATE CLASS DlgTextMsgClass

   VAR xDlg
   ...
   VAR bCodeBlock
   METHOD Execute()
Method Execute() have the "problem"
METHOD Execute() CLASS DlgTextMsgClass
...
   IF ::bCodeBlock == Nil
      ACTIVATE DIALOG ::xDlg CENTERED
   ELSE
      ACTIVATE DIALOG ::xDlg CENTERED ;
         ON INIT ( (Self), Eval( ::bCodeBlock ) )
   ENDIF
...
What is the problem ?
ON INIT uses Self as parameter - Self is TDIALOG
Eval( ::bCodeBlock ) uses Self, but uses TDIALOG Class and not DlgTextMsgClass
TDIALOG does not have bCodeBlock.

José M. C. Quintas Brazil

gtwvg, fivewin 25.12, hwgui, mingw 15.2 (32 bits)

Posts: 104
Joined: Tue Feb 09, 2021 04:20 PM
Re: harbour behaviour on DIALOG INIT
Posted: Wed Mar 05, 2025 04:14 PM

May be the #translate or anything else.

I will made a test using oDlg:bInit.

José M. C. Quintas Brazil

gtwvg, fivewin 25.12, hwgui, mingw 15.2 (32 bits)

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: harbour behaviour on DIALOG INIT
Posted: Wed Mar 05, 2025 05:58 PM
Dear Jose,

Please try it this way:
METHOD Execute() CLASS DlgTextMsgClass
   local oThis := Self
...
   IF ::bCodeBlock == Nil
      ACTIVATE DIALOG ::xDlg CENTERED
   ELSE
      ACTIVATE DIALOG ::xDlg CENTERED ;
         ON INIT ( (Self), Eval( oThis:bCodeBlock ) )
   ENDIF
...
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 104
Joined: Tue Feb 09, 2021 04:20 PM
Re: harbour behaviour on DIALOG INIT
Posted: Thu Mar 06, 2025 02:56 PM
Found this way
IF ::bCodeBlock != Nil
   ::xDlg:bInit := ::bCodeBlock
ENDIF   
ACTIVATE DIALOG ::xDLG CENTERED
Thanks.

Note:
Behaviour is created by #xcommand using self as parameter, to be used on codeblock.
[{|Self|<uInit>}]
If change this, it may becames incompatible with existing routines.
Souce code looks clearer using bInit.

José M. C. Quintas Brazil

gtwvg, fivewin 25.12, hwgui, mingw 15.2 (32 bits)

Continue the discussion