#command Syntax

#command Syntax

Postby Jimmy » Fri Oct 18, 2019 6:23 am

hi,

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


i can use
Code: Select all  Expand view
  #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  Expand view

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

Re: #command Syntax

Postby Antonio Linares » Fri Oct 18, 2019 6:26 am

Jimmy,

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41858
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: #command Syntax

Postby Jimmy » Fri Oct 18, 2019 7:33 am

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  Expand view
  ASSIGN METHOD SetMaximum() VAR Maximum
  ACCESS METHOD GetMaximum() VAR Maximum
 

i think it must be something like
Code: Select all  Expand view
  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
Jimmy
 
Posts: 1689
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: #command Syntax

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

Re: #command Syntax

Postby Jimmy » Sat Oct 19, 2019 4:03 am

hi Antonio,
Antonio Linares wrote:The simplest way uses to be the best one :-)

i agree : keep it simple
Code: Select all  Expand view
  oProgress:SetMaximum( 12345 )

but there is also this Syntax
Code: Select all  Expand view
  oProgress:Maximum := 12345

that is why Alaska also use ASSIGN / ACCESS Method and Xbase++ User can " := " Syntax.
Code: Select all  Expand view
   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  Expand view
#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
User avatar
Jimmy
 
Posts: 1689
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 110 guests