#command Syntax

Post Reply
User avatar
Jimmy
Posts: 165
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

#command Syntax

Post by Jimmy »

hi,

when have a Method using Xbase++ Syntax like this

Code: Select all

METHOD XbpPBar:SetMaximum( nMaximum )
i can use

Code: Select all

   #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: Select all

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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: #command Syntax

Post by Antonio Linares »

Jimmy,

Please provide full XbpPBar.prg source code to help you
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Jimmy
Posts: 165
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: #command Syntax

Post by Jimmy »

hm ... em, äh ...
that sample is only a Demo Code for this Type of Syntax used by Alaska :roll:

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: Select all

   ASSIGN METHOD SetMaximum() VAR Maximum
  ACCESS METHOD GetMaximum() VAR Maximum
 
i think it must be something like

Code: Select all

   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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: #command Syntax

Post by Antonio Linares »

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
User avatar
Jimmy
Posts: 165
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: #command Syntax

Post by Jimmy »

hi Antonio,
Antonio Linares wrote:The simplest way uses to be the best one :-)
i agree : keep it simple

Code: Select all

   oProgress:SetMaximum( 12345 )
but there is also this Syntax

Code: Select all

   oProgress:Maximum := 12345
that is why Alaska also use ASSIGN / ACCESS Method and Xbase++ User can " := " Syntax.

Code: Select all

   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: Select all

#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. :roll:

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
Post Reply