FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Preprocessor advice needed? (SOLVED)
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Preprocessor advice needed? (SOLVED)
Posted: Fri May 02, 2014 09:23 AM
Hi

I have a to xcommand like below.

Code (fw): Select all Collapse
#xcommand DOSYA_AC <oData>;
            [INDEX <xxIND>] ;
            [ORDER <xxcORDER>]  ;
            [ISLEM <xxK>];
            [ <lSoftSEEK: SOFTSEEK> ] ;
            [ALIAS <xxALIAS>] ;
            [ <lReadOnly: READONLY> ] ;
            [ <lOpenMode: EXCLUSIVE> ] ;
    =><oData>:D_AC(<xxIND>, <xxK>, <.lSoftSEEK.>, <xxALIAS>, <.lReadOnly.>, ;
                        <xxcORDER>, <.lOpenMode.>)
#xcommand DOSYA_ACN <oData>;
            PTYPE <oPtype>  ;
            [INDEX <xxIND>] ;
            [ORDER <xxcORDER>]  ;
            [ISLEM <xxK>];
            [ <lSoftSEEK: SOFTSEEK> ] ;
            [ALIAS <xxALIAS>] ;
            [ <lReadOnly: READONLY> ] ;
            [ <lOpenMode: EXCLUSIVE> ] ;
    =><oData>:= <oPtype>:Clone();;
      <oData>:D_AC(<xxIND>, <xxK>, <.lSoftSEEK.>, <xxALIAS>, <.lReadOnly.>, ;
                        <xxcORDER>, <.lOpenMode.>)


I need the define PTYPE is OPTIONAL like that

Code (fw): Select all Collapse
#xcommand DOSYA_ACN <oData>;
            [PTYPE <oPtype>]  ;                <<<=========
            [INDEX <xxIND>] ;
            [ORDER <xxcORDER>]  ;
            [ISLEM <xxK>];
            [ <lSoftSEEK: SOFTSEEK> ] ;
            [ALIAS <xxALIAS>] ;
            [ <lReadOnly: READONLY> ] ;
            [ <lOpenMode: EXCLUSIVE> ] ;
    =><oData>:= <oPtype>:Clone();;
      <oData>:D_AC(<xxIND>, <xxK>, <.lSoftSEEK.>, <xxALIAS>, <.lReadOnly.>, ;
                        <xxcORDER>, <.lOpenMode.>


What should I change the command line? (=>)

Thanks.
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Preprocessor advice needed?
Posted: Fri May 02, 2014 10:42 AM
Hakan,

Code (fw): Select all Collapse
#xcommand DOSYA_ACN <oData>;
            [PTYPE <oPtype>]  ;                <<<=========
            [INDEX <xxIND>] ;
            [ORDER <xxcORDER>]  ;
            [ISLEM <xxK>];
            [ <lSoftSEEK: SOFTSEEK> ] ;
            [ALIAS <xxALIAS>] ;
            [ <lReadOnly: READONLY> ] ;
            [ <lOpenMode: EXCLUSIVE> ] ;
    =><oData>:= <oPtype>:Clone();;
      <oData>:D_AC(<xxIND>, <xxK>, <.lSoftSEEK.>, <xxALIAS>, <.lReadOnly.>, ;
                        <xxcORDER>, <.lOpenMode.> [,<oPtype>] )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Preprocessor advice needed?
Posted: Fri May 02, 2014 10:42 AM

or

<xxcORDER>, <.lOpenMode.>, [<oPtype>] )

in case you may add some new parameters in the future

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: Preprocessor advice needed?
Posted: Fri May 02, 2014 11:00 AM
Thank you Antonio,

but there is two command line in =>

Code (fw): Select all Collapse
<oData>:= <oPtype>:Clone()
<oData>:D_AC(<xxIND>, <xxK>, <.lSoftSEEK.>, <xxALIAS>, <.lReadOnly.>, ;
                        <xxcORDER>, <.lOpenMode.> )


oPType is first in line. I need if oPType is null, there will be no first line.
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 1515
Joined: Thu Oct 30, 2008 02:37 PM
Re: Preprocessor advice needed?
Posted: Fri May 02, 2014 12:02 PM
Hi

Code (fw): Select all Collapse
<oData>:= If(<.oPtype.>, <oPtype>:Clone(), NIL)        // Note <.xxx.> label
<oData>:D_AC(<xxIND>, <xxK>, <.lSoftSEEK.>, <xxALIAS>, <.lReadOnly.>, ;
                        <xxcORDER>, <.lOpenMode.> )


Regards
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: Preprocessor advice needed? (SOLVED)
Posted: Fri May 02, 2014 12:41 PM
hmpaquito wrote:Hi

Code (fw): Select all Collapse
<oData>:= If(<.oPtype.>, <oPtype>:Clone(), NIL)        // Note <.xxx.> label
<oData>:D_AC(<xxIND>, <xxK>, <.lSoftSEEK.>, <xxALIAS>, <.lReadOnly.>, ;
                        <xxcORDER>, <.lOpenMode.> )


Regards


Thank you. I have change like that and It works.

Code (fw): Select all Collapse
<oData>:= If(<.oPtype.>, [<oPtype>:Clone()],<oData> )        // Note <.xxx.> label
<oData>:D_AC(<xxIND>, <xxK>, <.lSoftSEEK.>, <xxALIAS>, <.lReadOnly.>, ;
                        <xxcORDER>, <.lOpenMode.> )
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Preprocessor advice needed? (SOLVED)
Posted: Fri May 02, 2014 02:47 PM

Hakan,

Yes, I missed the first line, sorry

You can make it entirely optional too:

[ <oData>:= <oPtype>:Clone() ;] ;

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1387
Joined: Fri May 23, 2008 01:33 PM
Re: Preprocessor advice needed? (SOLVED)
Posted: Sat May 03, 2014 08:24 AM
Antonio Linares wrote:Hakan,

Yes, I missed the first line, sorry

You can make it entirely optional too:

[ <oData>:= <oPtype>:Clone() ;] ;


Hi Antonio

I tried your suggested solution and It does not work.

ppo result is below.

Code (fw): Select all Collapse
ooTb_Temp:=:Clone(); ooTb_Temp:D_AC(,, .F.,, .T., "ADR_0", .F.)


I just want to inform you. Thanks again.
Regards,



Hakan ONEMLI



Harbour & MSVC 2022 & FWH 23.06
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Preprocessor advice needed? (SOLVED)
Posted: Sat May 03, 2014 10:06 AM

Hakan,

Yes, you are right, the problem is that <oData> exists so the entire clause is NOT optional.

In such case, yes, the above posted working solution is the right one :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion