FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour #command Syntax
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
#command Syntax
Posted: Fri Oct 18, 2019 06:23 AM
hi,

when have a Method using Xbase++ Syntax like this
Code (fw): Select all Collapse
METHOD XbpPBar:SetMaximum( nMaximum )


i can use
Code (fw): Select all Collapse
   #xcommand METHOD <!ClassName!>:<MethodName> => METHOD <MethodName> CLASS <ClassName>
to change it to harbour Style

now when have this Code how to enhance it to harbour Syntax :-)
Code (fw): Select all Collapse
CLASS XbpPBar FROM XbpIWindow, DataRef

   PROTECTED:
      VAR nMaximum
      ... 
   EXPORTED:
      ASSIGN METHOD SetMaximum() VAR Maximum
      ACCESS METHOD GetMaximum() VAR Maximum
      ... 
ENDCLASS

METHOD XbpPBar:SetMaximum( nMaximum )
...

who can help me to translate it :-)

p.s. this Progressbar also have ITaskbarList3 Interface to display Animation in Taskbar-Icon
http://www.hmgforum.com/download/file.php?id=9165
greeting,

Jimmy
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: #command Syntax
Posted: Fri Oct 18, 2019 06:26 AM

Jimmy,

Please provide full XbpPBar.prg source code to help you

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: #command Syntax
Posted: Fri Oct 18, 2019 07:33 AM
hm ... em, äh ...
that sample is only a Demo Code for this Type of Syntax used by Alaska :-)

i have my own native Control using Ot4Xb and hope Pablo will help me to "translate" it to harbour

---

but i like to learn how to translate Xbase++ CLASS Syntax to harbour CLASS Code
Code (fw): Select all Collapse
   ASSIGN METHOD SetMaximum() VAR Maximum
  ACCESS METHOD GetMaximum() VAR Maximum

i think it must be something like
Code (fw): Select all Collapse
   ASSIGN SetMaximum( nVal ) INLINE ::SetMaximum(  nVal )
  ACCESS GetMaximum()       INLINE ::GetMaximum()  // -> RETURN ::Maximum

is this the right Syntax :-)
any chance to use #xcommmand to translate Xbase++ Code to harbour Syntax :-)
greeting,

Jimmy
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: #command Syntax
Posted: Fri Oct 18, 2019 11:15 AM

DATA nMaximum

METHOD SetMaximum( nVal ) INLINE ::nMaximum := nVal

METHOD GetMaximum() INLINE ::nMaximum

The simplest way uses to be the best one :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: #command Syntax
Posted: Sat Oct 19, 2019 04:03 AM
hi Antonio,
Antonio Linares wrote:The simplest way uses to be the best one :-)

i agree : keep it simple
Code (fw): Select all Collapse
   oProgress:SetMaximum( 12345 )

but there is also this Syntax
Code (fw): Select all Collapse
   oProgress:Maximum := 12345

that is why Alaska also use ASSIGN / ACCESS Method and Xbase++ User can " := " Syntax.
Code (fw): Select all Collapse
   PROTECTED:
      VAR nMaximum
   EXPORTED:
      ACCESS METHOD GetMaximum() VAR Maximum
      ASSIGN METHOD SetMaximum() VAR Maximum
ENDCLASS
METHOD XbpPBar:SetMaximum( nMaximum )
   IF nMaximum < ::nMinimum
      ::nMaximum := ::nMinimum
      ::nMinimum := nMaximum
   ELSE
      ::nMaximum := nMaximum
   ENDIF

i'm searching for a (easy) Way to run (those) existing Xbase++ Code under harbour.

i have a HbXbase.CH like this and #include it in my Project
Code (fw): Select all Collapse
#IFDEF __XPP__
   // Xbase++ Code
#ELSE
   // different harbour Code
   #xtranslate XbpDialog                       =>  WvgDialog
   #xtranslate XbpStatusBar                    =>  WvgStatusBar
   #xtranslate XbpStatic                       =>  WvgStatic
   ...
   #xcommand METHOD <!ClassName!>:<MethodName> => METHOD <MethodName> CLASS <ClassName>
   ...
#ENDIF
that Way it is less work to change Xbase++ Source to get it compile/link ... than the real Work begin. :-)

so how do more #xcommand with harbour :-)

---
p.s.
Progressbar is just a Sample.
i saw FW have a "green" Progressbar (PROGRESS_CLASSA) which i want to use in next Step.
greeting,

Jimmy

Continue the discussion