Why not use Form event.objectName ?

I find it very useful ; I use it and write in form method :

Case of
   :(Form event.code=On data change)
      Case of
         :(Form event.objectName="Name)
            Object get pointer(Object named;"Name")->:=MyMethodUppercase( 
Object get pointer(Object named;"Name")->)
         :(Form event.objectName="Address)
            Object get pointer(Object named;"Address")->:=MyMethodUppercase( 
Object get pointer(Object named;"Address")->)
         :(Form event.objectName="Form.Note)
            Object get pointer(Object named;"Form.Note")->:=MyMethodUppercase( 
Object get pointer(Object named;"Form.Note")->)
       End case
End case

Two solutions for MyMethod :
- if used elsewhere, use a method (waiting for classes)
- if used locally, made a call to form method : Execute method(Current method 
name;….

Cordialement,

Bernard Escaich



> Le 29 avr. 2020 à 19:15, lists via 4D_Tech <[email protected]> a écrit :
> 
> 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?

**********************************************************************
4D Internet Users Group (4D iNUG)
New Forum: https://discuss.4D.com
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to