Page 1 of 1

DEFINE MESSAGE BAR is pre-processed incorrectly?

Posted: Thu Oct 13, 2011 9:31 am
by hua
The command 'DEFINE MESSAGE BAR of oWnd prompt "ABC" ' seems to be pre-processed into:

Code: Select all

BAR:= oWnd:oMsgBar := TMsgBar():New( oWnd, "ABC", .F., .F., .F., .F.,,,,, .F., if( .F., .F., .F. ) )
instead of

Code: Select all

oWnd:oMsgBar := TMsgBar():New( oWnd, "ABC", .F., .F., .F., .F.,,,,, .F., if( .F., .F., .F. ) )
This caused a warning messsage during compilation, Warning W0001 Ambiguous reference 'BAR'

Tested with Harbour+FWH11.8

Is this a bug or I did something wrong?

Re: DEFINE MESSAGE BAR is pre-processed incorrectly?

Posted: Thu Oct 13, 2011 10:46 am
by Antonio Linares
Hua,

This fix is required in FiveWin.ch, as it seems as a preprocessor issue based on the order of the xcommand:

Code: Select all

#xcommand DEFINE <msg: MESSAGE BAR, MESSAGE, MSGBAR> [<oMsg>] ;   <<< Here !!!
             [ OF <oWnd> ] ;
             [ <prm: PROMPT, TITLE> <cMsg> ] ;
             [ <center: CENTER, CENTERED> ] ;
             [ <clock: CLOCK, TIME> ] ;
             [ <date: DATE> ] ;
             [ <kbd: KEYBOARD> ] ;
             [ FONT <oFont> ] ;
             [ <color: COLOR, COLORS> <nClrFore> [,<nClrBack> ] ] ;
             [ <inset: NO INSET, NOINSET> ] ;
             [ <l2007: 2007, _2007> ] ;
             [ <l2010: 2010, _2010> ] ;
      => ;
         [<oMsg> := ] TMsgBar():New( <oWnd>, <cMsg>, <.center.>,;   <<< Here !!!
                                     <.clock.>, <.date.>, <.kbd.>,;
                                     <nClrFore>, <nClrBack>, <oFont>,;
                                     [!<.inset.>], <.l2007.>, if( <.l2007.>, .F., <.l2010.> ) )
Also this change in Class TMsgBar:

Code: Select all

METHOD New( oWnd, cPrompt, lCentered, lClock, lDate, lKbd,;
            nClrFore, nClrBack, oFont, lInset, l2007, l2010 ) CLASS TMsgBar

   ...

   ::oWnd        = oWnd
   ::oWnd:oMsgBar = Self    <<< Here !!!
   ::cMsg        = ::cMsgDef  := cPrompt

   ...
 

Re: DEFINE MESSAGE BAR is pre-processed incorrectly?

Posted: Thu Oct 13, 2011 10:50 am
by hua
Thanks for the quick fix Antonio :)