DEFINE MESSAGE BAR is pre-processed incorrectly?

DEFINE MESSAGE BAR is pre-processed incorrectly?

Postby hua » Thu Oct 13, 2011 9:31 am

The command 'DEFINE MESSAGE BAR of oWnd prompt "ABC" ' seems to be pre-processed into:
Code: Select all  Expand view  RUN

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

instead of
Code: Select all  Expand view  RUN

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.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: DEFINE MESSAGE BAR is pre-processed incorrectly?

Postby Antonio Linares » Thu Oct 13, 2011 10:46 am

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  Expand view  RUN
#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  Expand view  RUN
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
User avatar
Antonio Linares
Site Admin
 
Posts: 42125
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: DEFINE MESSAGE BAR is pre-processed incorrectly?

Postby hua » Thu Oct 13, 2011 10:50 am

Thanks for the quick fix Antonio :)
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am


Return to Bugs report & fixes / Informe de errores y arreglos

Who is online

Users browsing this forum: No registered users and 7 guests