• Looking for guru on #translate or #xtranslate

    From John Ward@21:1/5 to All on Tue Jul 24 08:46:41 2018
    I need to perform a large update to Clipper code and thought it would be easier to use #translate or #xtranslate.

    I have a field I need to change the name on.

    I need to change:
    dbname1->fieldname1

    to:
    dbname1->fieldname2

    I figure out how to do the simple version and just reference the field name, but I am concerned about the impact.

    #xtranslate fieldname1 => fieldname2

    Does anyone know the sytnax to include the ">" as part of the translate matchPattern?

    This syntax does not work:
    #xtranslate '>ownconstate' => '>ownconstat'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From mirda@21:1/5 to John Ward on Tue Jul 24 20:27:49 2018
    On Tue, 24 Jul 2018 08:46:41 -0700 (PDT), John Ward wrote:

    I need to perform a large update to Clipper code and thought it would be easier to use #translate or #xtranslate.

    I have a field I need to change the name on.

    I need to change:
    dbname1->fieldname1

    to:
    dbname1->fieldname2

    I figure out how to do the simple version and just reference the field name, but I am concerned about the impact.

    #xtranslate fieldname1 => fieldname2

    Does anyone know the sytnax to include the ">" as part of the translate matchPattern?

    This syntax does not work:
    #xtranslate '>ownconstate' => '>ownconstat'



    Hi John!

    have you tried with:

    #xtranslate dbname1->fieldname1 => dbname1->fieldname2

    Regards

    Damir

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From John Ward@21:1/5 to mirda on Tue Jul 24 11:35:06 2018
    On Tuesday, July 24, 2018 at 2:29:02 PM UTC-4, mirda wrote:
    On Tue, 24 Jul 2018 08:46:41 -0700 (PDT), John Ward wrote:

    I need to perform a large update to Clipper code and thought it would be easier to use #translate or #xtranslate.

    I have a field I need to change the name on.

    I need to change:
    dbname1->fieldname1

    to:
    dbname1->fieldname2

    I figure out how to do the simple version and just reference the field name, but I am concerned about the impact.

    #xtranslate fieldname1 => fieldname2

    Does anyone know the sytnax to include the ">" as part of the translate matchPattern?

    This syntax does not work:
    #xtranslate '>ownconstate' => '>ownconstat'



    Hi John!

    have you tried with:

    #xtranslate dbname1->fieldname1 => dbname1->fieldname2

    Regards

    Damir

    Thanks! I do not know why I did not think to try the who thing. It seems to work.

    John

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From lohen@21:1/5 to All on Tue Jul 24 20:38:55 2018
    Hi John,

    Be aware that a pp rule cannot start with a match marker (in Harbour it
    _can_, not in Clipper), that's a starter
    Some operators pose a problem since < and > are also (match/result) marker delimiters to the pp, but that's easy to circumvent by inserting a \ before
    the > or <, although in your case the -> operator is seen as one token by
    the pp, so here no \ is needed (yet in the <= and >= operators, because < or
    is upfront)

    #xtranslate -> fieldname1 => -> fieldname2

    is supported; but it's a half measure; also whatever -> fieldname1 will trigger; moreover, what if your code also contains dbname1 -> ( FIELDPOS( "fieldname1" ))?

    iow, i don't think it's a good idea; a batch search and replace with manual confirmation from within an editor is much safer

    hth,

    Frank

    "John Ward" <net4ward@gmail.com> schreef in bericht news:2848d55e-3037-4112-ae39-bf2c1fef69c9@googlegroups.com...
    I need to perform a large update to Clipper code and thought it would be >easier to use #translate or #xtranslate.

    I have a field I need to change the name on.

    I need to change:
    dbname1->fieldname1

    to:
    dbname1->fieldname2

    I figure out how to do the simple version and just reference the field
    name, but I am concerned about the impact.

    #xtranslate fieldname1 => fieldname2

    Does anyone know the sytnax to include the ">" as part of the translate matchPattern?

    This syntax does not work:
    #xtranslate '>ownconstate' => '>ownconstat'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From lohen@21:1/5 to All on Thu Aug 16 20:54:50 2018
    <stevestraley@gmail.com> schreef in bericht news:98835b14-64ed-4b35-93f0-9cd733432d7d@googlegroups.com...

    I haven't seen a reference to the PP in over 18 years :-)

    Hi Steve,

    fyi, the CA-Clipper pp is at the heart of a transpiler implementation which converts a proprietary language into pure Clipper (with Class(y)), allowing that project to redesign the whole CA-Clipper api's into full Object
    Oriented syntax; iow, the CA-Clipper pp is tremendously powerful (but it
    took years to push it that far)

    you're the author to alot of interesting books, which i'm currently
    rereading :-)

    Perhaps have a visit at my site, the project is called "_o_ceans (for CA-Clipper)" - a download or two showcase the runtime, and gives the best results combined with vDosPlus (even for 64bit Windows)

    best regards,

    Frank

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From stevestraley@gmail.com@21:1/5 to All on Thu Aug 16 11:29:15 2018
    I haven't seen a reference to the PP in over 18 years :-)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From stevestraley@gmail.com@21:1/5 to All on Thu Aug 16 14:09:24 2018
    Frank - yes I am aware of the PP... I did an audio tape series on the subject. I also remember Class(y); although in the new world I wouldn't call it object oriented by any stretch.

    Thanks but I apologize up front for my books... it's like the old saying, "It seemed like a good idea at the time"....

    Steve

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)