OK, so can we get a real example of how to replace the *old* way with the new?  
In a case where there are several entry objects:

Form.Name
Form.Address
Form.Note

I want to enforce a proper uppercase/lowercase on all three, so in the old days 
I created an object, set the method to "UpperLower(self)", duplicated it three 
times, change the object name and I'm done.  For simplicity sake, lets say that 
UpperLower simply do $1->:=Uppercase($1->).

How would you do the same while using object notation instead of a variable, 
dynamic or not?

Thanks,

Lahav


-----Original Message-----
From: 4D_Tech <[email protected]> On Behalf Of Keisuke Miyako via 
4D_Tech
Sent: Wednesday, April 29, 2020 10:14 AM
To: 4D iNug Technical <[email protected]>
Cc: Keisuke Miyako <[email protected]>
Subject: Re: Object notation replacement for use of Self in a script — v18

my feeling is that generic coding is very much possible in object notation, but 
we need to accept that the approach is different.

if you prefer to use pointers such as "Self", I think it's best to avoid object 
notation, at least if your goal is to make the code generic.

it's not a defect of object notation,
but the way to write generic code is different.

if you want to make your code generic in object notation, I think you need to 
fully commit.

what I mean by that, is that you need to think of objects and classes, 
properties and methods.

basically, instead of

doIt(Self)

you would write

$obj.doIt()

where the doIt() formula works on "This".

in my opinion, to take full advantage of object notation, it is pretty much 
mandatory to use 

This
Signal
Formula
Form

extensively, as well as 

Storage
New shared object
New shared collection

strategically.

simply replacing interprocess/process variables with object notation, may 
semantically look like object based coding, but at that level you may be losing 
major advantages of classic code, while not gaining much from what the new way 
of coding has to offer.

> On Apr 29, 2020, at 14:55, Chris Belanger via 4D_Tech <[email protected]> 
> wrote:
> And v18r3 does not even have a solution to this in its documentation.

**********************************************************************
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]
**********************************************************************
**********************************************************************
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]
**********************************************************************

Reply via email to