Hi Narender,
Welcome back.
Changing the variable declarations is a simple regex exercise. In fact I
think 4DPOP may have a command in it already for doing so. If not it's not
too difficult to write a method to loop through all the code, find the old
strings and replace them.
I don't have any code on hand at the moment but a REGEX pattern like:
"_o_.+STRING \(\d+;"
will find either declaration. The "\d+;" bit deals with whatever number is
present as well as the extra ; you won't need.
Then you can pull that substring and see if it contains "ARRAY" and know
what to replace it with:
"ARRAY TEXT ("
"C_TEXT ("
Hope that helps.
On Fri, Jun 7, 2019 at 8:49 AM Narinder Chandi via 4D_Tech <
[email protected]> wrote:
> Hi all. I am migrating a v15 database to v17, 4D Server running on Mac. I
> need some opinions as to what to do with regards to converting commands
> marked as obsolete as per this article:
>
>
> https://doc.4d.com/4Dv15/4D/15/Deprecated-or-removed-features-in-v15-product-range.200-2063067.en.html
>
> I have been addressing them by theme, and in some cases the conversion is
> straight forward, e.g. _o_ENABLE BUTTON/_o_DISABLE BUTTON is replaced by
> OBJECT SET ENABLED whilst some others can be removed completely, e.g.
> _o_REDRAW LIST.
>
> I am now looking at how to deal with the obsolete Compiler theme commands
> _o_C_INTEGER, _o_C_STRING and _o_ARRAY STRING.
>
> _o_C_INTEGER I have simply replaced with C_LONGINT as the docs state that
> "...4D and the compiler retype Integers into Longints internally."
>
> However, I am conflicted as to how best to deal with _o_C_STRING and
> _o_ARRAY STRING which are replaced by C_TEXT and ARRAY TEXT respectively.
> The docs state "The operation of the [_o_C_STRING/_o_ARRAY STRING] command
> is strictly identical to that of the [C_TEXT/ARRAY TEXT]". Of course the
> string length parameter in the obsoleted commands makes the conversion
> non-trivial and code will need to reviewed for any functional regressions,
> e.g. in relation to database fields of type String where the length can
> still be defined (auto-truncation may not be the desired/intended
> behaviour!).
>
> I have searched the archives on this topic but opinions seem to be divided
> on whether or not to do this conversion? Perhaps I am mistaken, but I am of
> the opinion that it will have to be done sooner or later as 4D reserves the
> right to remove obsoleted commands and will eventually do so?
>
> TL;DR the options are:
> 1. Replace
> 2. Do nothing for v17
>
> Thoughts?
>
> I will deal with my questions and options regarding Subrecords in a
> separate email!
>
> Regards,
>
> Narinder Chandi,
> ToolBox Systems Ltd.
> --
>
>
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive: http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub: mailto:[email protected]
> **********************************************************************
--
Kirk Brooks
San Francisco, CA
=======================
What can be said, can be said clearly,
and what you can’t say, you should shut up about
*Wittgenstein and the Computer *
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive: http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:[email protected]
**********************************************************************