DEFINE MESSAGE BAR is pre-processed incorrectly?

Post Reply
hua
Posts: 861
Joined: Fri Oct 28, 2005 2:27 am

DEFINE MESSAGE BAR is pre-processed incorrectly?

Post 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?
FWH 11.08/FWH 19.03
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: DEFINE MESSAGE BAR is pre-processed incorrectly?

Post 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

   ...
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
hua
Posts: 861
Joined: Fri Oct 28, 2005 2:27 am

Re: DEFINE MESSAGE BAR is pre-processed incorrectly?

Post by hua »

Thanks for the quick fix Antonio :)
FWH 11.08/FWH 19.03
xHarbour 1.2.1 (Rev 6406) + BCC
Harbour 3.1 (Rev 17062) + BCC
Harbour 3.2.0dev (r1904111533) + BCC
Post Reply