Re: V18 plugins not showing as Notarized?

2020-05-01 Thread Randy Jaynes via 4D_Tech
I’ve found that you also have to be careful when copying your development 
structure from 1 machine to another.

When you copy or unzip a version on the Catalina machine, it invalidates the 
notarization of the plugins and you get the alerts when opening the database 
that the plugins are damaged.

They’re not.

You then have to go to System Preferences > Security & Privacy > General to use 
the “Blah blah anyway” button. Multiple times if you have several plugins with 
the issue.

As a result I have a folder on the desktop of my Catalina testing machine where 
all the plugins are noticed in case I forget again.

I found I have to use Miyako’s buildApp database to codesign each plugin.bundle 
when this happens.

Randy

--
Randy Jaynes
Senior Programmer and Customer Support

http://printpoint.com • 845.687.3741 • PrintPoint, Inc • 57 Ludlow Lane • 
Palisades, NY 10964 
Please send all email contacts to supp...@printpoint.com



> On May 1, 2020, at 1:06 AM, Ronald Rosell via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I knew it would be something simple.  I’d actually completely forgotten that 
> 4D InternetCommands is included in the 4D application package … I’ve 
> generally had a copy in the database folder -> Plugins when compiling.
> 
> I just took that latter copy out, relaunched, and problem solved!  Thank you 
> Miyako!
> 
> Ron Rosell
> __
> 
> Ron Rosell
> President
> StreamLMS
> 
>> On Apr 30, 2020, at 9:29 PM, Keisuke Miyako via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> only the plugins pre-installed with the application (inside 4D or 4D Server) 
>> are notarised.
>> 
>> the folder adjacent to the application are copies for distribution and 
>> therefore not code signed at all.
>> 
>>> On May 1, 2020, at 12:00, Ronald Rosell via 4D_Tech <4d_tech@lists.4d.com> 
>>> wrote:
>>> Executing codesign --verify -- verbose against 4D InternetCommands.bundle, 
>>> for example, brings back:
>>> /Applications/4D v18.1/Plugins/4D InternetCommands.bundle: code object 
>>> is not signed at all
>> 
>> **
>> 4D Internet Users Group (4D iNUG)
>> Archive:  http://lists.4d.com/archives.html
>> Options: https://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Object notation replacement for use of Self in a script — v18

2020-05-01 Thread John DeSoi via 4D_Tech
Here is an idea which seems to work, but needs more evaluation. What if you 
named the form object with the property path in the form data? Even if periods 
are not allowed (they seem to be), another character could be used. I think the 
maximum length of an object name is 255 characters which should be plenty.

Here is an example. I created a form with one in input and the object method 
below. The form object name is "some.property.path" and the expression is 
Form.some.property.path.

Case of 
  : (Form event code=On Load)
Form.some:=New object
Form.some.property:=New object
Form.some.property.path:="TEST 123"

  : (Form event code=On Data Change)
C_TEXT($name)
C_COLLECTION($cPath)
C_OBJECT($object)

$name:=OBJECT Get name(Object current)
$cPath:=Split string($name;".")
$object:=Form
For each ($name;$cPath.slice(0;-1))  //All except last element to get the 
object.
  $object:=$object[$name]
End for each 

$name:=$cPath.pop()
$object[$name]:=Uppercase($object[$name])
End case 

John DeSoi, Ph.D.



> On Apr 30, 2020, at 7:53 PM, Peter Hay via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> What we really need is a way to access a Form Object's "Variable or
> Expression".  There's a Command named "Object Get Data Source" which was
> added in v14, but it only returns a Pointer if  "Variable or Expression" is
> a Variable.  If it's an Expression it returns Nil.

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Object notation replacement for use of Self in a script — v18

2020-05-01 Thread James Crate via 4D_Tech
On May 1, 2020, at 10:07 AM, John DeSoi via 4D_Tech <4d_tech@lists.4d.com> 
wrote:

> Here is an idea which seems to work, but needs more evaluation. What if you 
> named the form object with the property path in the form data? Even if 
> periods are not allowed (they seem to be), another character could be used. I 
> think the maximum length of an object name is 255 characters which should be 
> plenty.

The problem with this approach, as others have mentioned, is that you can no 
longer use object name prefixes to show/hide/enable/etc groups of form objects.

On Apr 30, 2020, at 7:53 PM, Peter Hay via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> What we really need is a way to access a Form Object's "Variable or
> Expression".  There's a Command named "Object Get Data Source" which was
> added in v14, but it only returns a Pointer if  "Variable or Expression" is
> a Variable.  If it's an Expression it returns Nil.

Yes, and it’s likely it will be added eventually. I mean we got a built-in 
string split command in v17, so it’s never too late!

For the foreseeable future, there is no way to get a pointer to an object 
attribute and you can’t work with the form object value directly. 

In Laurent’s 2020 Summit presentation on classes (Entity extensions), he showed 
setting up a “virtual attribute” with custom getter/setter methods. I assume 
you will be able to set up custom getter/setter methods for datastore 
attributes as well, so when you are able to use that functionality (v18R?), you 
will be able to specify that logic in the Entity class extension and not the 
form. 

Realistically, if you want to be “all-in” on ORDA, you’ll want to use the 4D 
v18R? release that supports classes, DataClass and Entity extensions as soon as 
it’s available. Currently you spend much of your time working around the lack 
of those things.

Jim Crate

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Object notation replacement for use of Self in a script — v18

2020-05-01 Thread Kirk Brooks via 4D_Tech
Jim,

On Fri, May 1, 2020 at 11:14 AM James Crate via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> The problem with this approach, as others have mentioned, is that you can
> no longer use object name prefixes to show/hide/enable/etc groups of form
> objects.
>

Why do you say that?

In v18R2 I'm using:

*OBJECT SET ENABLED*(*;"btn_setDoc";*Form*.files_LB.curItem#*Null*)  //  enable
when file is selected

*OBJECT SET VISIBLE*(*;"btn_setDoc";*Form*.files_LB.curItem#*Null*)


I added the set visible just to verify if works. It does. I also have an
input which displays an object named "Input2" and this works on it as well.
And I have forms using things like:

*OBJECT SET VISIBLE*(*;"btn_nav@";*Form*.files_LB.curItem#*Null*)


Am I missing something?

-- 
Kirk Brooks
San Francisco, CA
==
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Object notation replacement for use of Self in a script — v18

2020-05-01 Thread James Crate via 4D_Tech
On May 1, 2020, at 2:23 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> On Fri, May 1, 2020 at 11:14 AM James Crate via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
>> The problem with this approach, as others have mentioned, is that you can
>> no longer use object name prefixes to show/hide/enable/etc groups of form
>> objects.
>> 
> 
> Why do you say that?

John was talking about using the form expression as the form object name. 

> Here is an example. I created a form with one in input and the object method 
> below. The form object name is "some.property.path" and the expression is 
> Form.some.property.path.

Suppose you have a section on the form with labels/fields for payment info. You 
have a popup with payment type, and fields for credit card, ACH (bank name/acct 
number), check, cash. When you choose a payment type, you want to show the 
labels/fields for that payment type, and hide any other payment labels/fields. 
If you thought far enough ahead to name all your payment fields correctly, 
maybe you can make it work. But if your fields aren’t already prefixed properly 
so you can do this with wildcards, then you have a lot more messing around to 
do. 

Jim Crate

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

signal problem

2020-05-01 Thread Jeremy Roussak via 4D_Tech
4D v18.1, Mac Mojave

I think I’m following the documentation of signals to the letter, but it’s not 
happening.

Main process:

C_OBJECT($signal)
C_BOOLEAN($done)

$signal:=New signal(“fred”)

CALL WORKER(“Show”;”Show”;$signal)

$done:=$signal.wait(5)

-

Method “Show”

C_OBJECT($1;$signal)
$signal:=$1

OPEN FORM WINDOW(…)
$signal.trigger()

DIALOG(…)

——

The calling process always times out, with $done false. I’m obviously missing 
something very basic, but I can’t see it. Help!

Jeremy

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Object notation replacement for use of Self in a script — v18

2020-05-01 Thread Kirk Brooks via 4D_Tech
Chris,

On Tue, Apr 28, 2020 at 10:53 PM Chris Belanger via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Generic programming of vars on a form is very complicated when one uses
> object attributes for the data source.
>
> For example, on screen you make a simple text input object named
> “enCompany”. It’s data source is Form.en_Company.Name (  i.e.
> [Company]Name  )
> In ‘classic 4d”, where the data source would be [Company]Name, one can
> code its script:
>
TRIM ( Self )

And TRIM would simply take a POINTER, and you can perform operations on the
> data that the user typed into that field. (Such as trim off leading &
> trailing spaces).
>
So what does Self actually point to? The object on the form the field is
displayed in or the actual field in the database?

The two are not the same thing. In classic 4D that distinction is never
really apparent to us. It didn't need to be and we didn't want to have to
deal with it. It was part of the how we perceived working with 4D: a field
on a form _was_ the data. It's also why 4D forms from ages past are so
overloaded with data processing being done on the form itself instead of
separated into more independent modules. IP and process vars enabled that
trend even more. This is a main reason opening up one of these old
databases in v18 and attempting to change something is so fraught. But I
digress. With modern 4D tools you just don't do things that way anymore.

Working with ORDA I rarely find a pointer a good solution to anything
except managing form objects like buttons. We are saddled with some
unfortunate nomenclature here because a 'form object' has nothing to do
with an object in Form. 'Form objects' are those named widgets on the form.
They _may_ be populated with data from something in Form, or a variable, or
a list box and so on.

A big conceptual difference between classic 4D and modern 4D is the
distinction between a form object and the data it presents is explicit. So
when I set the data source for an input object to be

Form.myEntity_o.Name

where myEntity_o is a reference to an entity in Company the actual data and
the form object are no longer implicitly the same thing like they are in
classic 4D. I have a reference to the entity and I have a form object. They
are two different things.

I can't get a pointer to the form object in this case. Why not?
First, what do I want to do with it? If I want to manage the form object
itself, visibility, enterability, etc., I don't need a pointer, I can just
use the object name.
If I want to do something with the data, as you do, the pointer won't work
because there are no pointers to object references. Why not? I'm sure there
are technical reasons but they don't matter to me because you don't need
it. You don't need it because you have a reference: myEntity_o. If you want
to change the data you do that with the reference - not through whatever
that data happens to be displayed in.

This is a fundamental, conceptual difference between using ORDA and classic
4D.

In classic 4D we have tables, records, fields and pointers to reference
them.
In ORDA we have datastores, dataclasses, entities, properties and we use
references.


In the example of the name field you can still put code in the form object
to react to On Data Change. And you can still pass data to a generic method
to manage it. Two ideas come to mind:
1) method takes an entity

// myMethod1 (entity)

// $1 is  a Company entity - check the name, address, etc. for proper
formatting

2) method is a function

Form.myEntity_o.Name:=myMethod2(Form.myEntity_o.Name)


Is the form you are working with an existing form or one you created from
scratch?
I find it much easier to use the new approaches on new forms. If not by
totally rewriting them then by separating out the new work into a subform.
That lets me design the form using a modern approach without having to do
too much to the old one.

I said this someplace else recently and it applies here: just because 4D
(still) provides some tools for doing things doesn't mean it's a good tool
to use. For instance, would anyone make a new form and use DRAG AND DROP
PROPERTIES? ORDA isn't an evolutionary step in 4D - it's a revolutionary
step. It really is like learning a new language. 18r3 is that way for sure.

I had time to begin updating my old 4D coding ideas starting a couple of
years ago. It wasn't easy and it made me feel old. But I kept at it. And it
became a lot easier and them fun. Now I'm amazed at things I can do simply
by setting up the data structure. Another big difference for me in this.
Taking time to get the structure right is time well spent.

-- 
Kirk Brooks
San Francisco, CA
==
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
*

Re: V18 plugins not showing as Notarized?

2020-05-01 Thread Ronald Rosell via 4D_Tech
Thanks Randy,

In our particular case that problem doesn’t appear arise, perhaps since we’re 
not distributing a built application with unlimited desktop, we’re running 
something in-house on 4D Server.

I did notice that the package contents -> Plugins folder for 4D Server (8.1) 
didn’t have the 4d internetcommands plugin in the distribution, whereas it was 
there for 4D Developer.  (That may have been corrected in 8.2). Simply copying 
4d internetcommands.bundle from one to the other, however, did the trick … 
Catalina seemed happy with that.
__

Ron Rosell
President
StreamLMS



> On May 1, 2020, at 5:02 AM, Randy Jaynes  wrote:
> 
> I’ve found that you also have to be careful when copying your development 
> structure from 1 machine to another.
> 
> When you copy or unzip a version on the Catalina machine, it invalidates the 
> notarization of the plugins and you get the alerts when opening the database 
> that the plugins are damaged.
> 
> They’re not.
> 
> You then have to go to System Preferences > Security & Privacy > General to 
> use the “Blah blah anyway” button. Multiple times if you have several plugins 
> with the issue.
> 
> As a result I have a folder on the desktop of my Catalina testing machine 
> where all the plugins are noticed in case I forget again.
> 
> I found I have to use Miyako’s buildApp database to codesign each 
> plugin.bundle when this happens.
> 
> Randy
> 

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Object notation replacement for use of Self in a script — v18

2020-05-01 Thread Kirk Brooks via 4D_Tech
Jim,

On Fri, May 1, 2020 at 11:53 AM James Crate via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Suppose you have a section on the form with labels/fields for payment
> info. You have a popup with payment type, and fields for credit card, ACH
> (bank name/acct number), check, cash. When you choose a payment type, you
> want to show the labels/fields for that payment type, and hide any other
> payment labels/fields. If you thought far enough ahead to name all your
> payment fields correctly, maybe you can make it work. But if your fields
> aren’t already prefixed properly so you can do this with wildcards, then
> you have a lot more messing around to do.
>

I have not had any great joy attempting to use pop-ups with object
references. Haven't tried in v18 so maybe it's improved. So, yeah - that
probably sucks. For these sorts of things I build a menu on the fly and
call it from a button or click event on the field. I really like being able
to easily set the placeholder text on fields like that. The problem with
pop ups/dropdowns is there is all sorts of implicit data binding that 4D
just handles in classic but isn't (at least wasn't) there for working with
Form and references.
But with respect to changing the names of a few form objects why is that a
deal? The form objects can be named anything - doesn't matter what the
field names are.

Unless you are trying to update an existing form. My experience here is to
put whatever I want to do in ORDA into a separate form and get it working
the way I want. Then put that on the existing form as a subform. If you
make the subform form object an object type (jeesh the nomenclature) it's a
pretty seamless addition.

-- 
Kirk Brooks
San Francisco, CA
==
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Object notation replacement for use of Self in a script — v18

2020-05-01 Thread Ben Kershaw via 4D_Tech
Tim Nevels wrote:

>if you want to use entities or use collections AreaList Pro is out of the 
>picture.

As posted on e-node’s forum two weeks ago: “ALP v11 will definitely support 
entity selections and collections. Mostly it seems to already work in ALP 
11.0a5"

It may not do everything you want in the first version, but don’t worry - only 
babies don’t understand they can’t have everything immediately.

Regards,
Ben Kershaw
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Object notation replacement for use of Self in a script

2020-05-01 Thread Aparajita Fishman via 4D_Tech

>> Another WTF is that you can’t iterate from the end of a collection to the
>> start. You can reorder the collection and then run a For each loop but
>> that’s a complete kludge.

Don’t be so quick to complain; you finally got ‘for each’ 10 years after the 
rest of the world (including Active4D). I don’t know of a single language (and 
I have used at least 6) where ‘for each’ is reversible. Indexed loops haven’t 
gone away and have their uses.
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Object notation replacement for use of Self in a script — v18

2020-05-01 Thread lists via 4D_Tech
Kirk,

I have one word that will do all of what we are after :   "This"

It works in listbox, which is a form object, any reason it can't be extended to 
other form objects?

Again, I don't think anyone on this thread is complaining, we are just trying 
to understand how to use the new functionality to do what we need to.

We need to interact with the users through some entry areas, call it objects, 
fields, variables. Whatever. And sometimes do silly things like verification of 
values, formatting to a certain standard etc.From everything that was 
presented so far, there is no way to utilize the new methodology (call it ORDA, 
dot notation whatever) as a data source of an entry area without using some 
part of classic 4D.  Coming up with all sorts of workarounds is fine, but it is 
still a workaround.

Cheers, will probably see you later today.

Lahav

-Original Message-
From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of Kirk Brooks via 
4D_Tech
Sent: Friday, May 1, 2020 1:21 PM
To: 4D iNug Technical <4d_tech@lists.4d.com>
Cc: Kirk Brooks 
Subject: Re: Object notation replacement for use of Self in a script — v18

Chris,

On Tue, Apr 28, 2020 at 10:53 PM Chris Belanger via 4D_Tech < 
4d_tech@lists.4d.com> wrote:

> Generic programming of vars on a form is very complicated when one 
> uses object attributes for the data source.
>
> For example, on screen you make a simple text input object named 
> “enCompany”. It’s data source is Form.en_Company.Name (  i.e.
> [Company]Name  )
> In ‘classic 4d”, where the data source would be [Company]Name, one can 
> code its script:
>
TRIM ( Self )

And TRIM would simply take a POINTER, and you can perform operations on the
> data that the user typed into that field. (Such as trim off leading & 
> trailing spaces).
>
So what does Self actually point to? The object on the form the field is 
displayed in or the actual field in the database?

The two are not the same thing. In classic 4D that distinction is never really 
apparent to us. It didn't need to be and we didn't want to have to deal with 
it. It was part of the how we perceived working with 4D: a field on a form 
_was_ the data. It's also why 4D forms from ages past are so overloaded with 
data processing being done on the form itself instead of separated into more 
independent modules. IP and process vars enabled that trend even more. This is 
a main reason opening up one of these old databases in v18 and attempting to 
change something is so fraught. But I digress. With modern 4D tools you just 
don't do things that way anymore.

Working with ORDA I rarely find a pointer a good solution to anything except 
managing form objects like buttons. We are saddled with some unfortunate 
nomenclature here because a 'form object' has nothing to do with an object in 
Form. 'Form objects' are those named widgets on the form.
They _may_ be populated with data from something in Form, or a variable, or a 
list box and so on.

A big conceptual difference between classic 4D and modern 4D is the distinction 
between a form object and the data it presents is explicit. So when I set the 
data source for an input object to be

Form.myEntity_o.Name

where myEntity_o is a reference to an entity in Company the actual data and the 
form object are no longer implicitly the same thing like they are in classic 
4D. I have a reference to the entity and I have a form object. They are two 
different things.

I can't get a pointer to the form object in this case. Why not?
First, what do I want to do with it? If I want to manage the form object 
itself, visibility, enterability, etc., I don't need a pointer, I can just use 
the object name.
If I want to do something with the data, as you do, the pointer won't work 
because there are no pointers to object references. Why not? I'm sure there are 
technical reasons but they don't matter to me because you don't need it. You 
don't need it because you have a reference: myEntity_o. If you want to change 
the data you do that with the reference - not through whatever that data 
happens to be displayed in.

This is a fundamental, conceptual difference between using ORDA and classic 4D.

In classic 4D we have tables, records, fields and pointers to reference them.
In ORDA we have datastores, dataclasses, entities, properties and we use 
references.


In the example of the name field you can still put code in the form object to 
react to On Data Change. And you can still pass data to a generic method to 
manage it. Two ideas come to mind:
1) method takes an entity

// myMethod1 (entity)

// $1 is  a Company entity - check the name, address, etc. for proper formatting

2) method is a function

Form.myEntity_o.Name:=myMethod2(Form.myEntity_o.Name)


Is the form you are working with an existing form or one you created from 
scratch?
I find it much easier to use the new approaches on new forms. If not by totally 
rewriting them then by separating out the new work into a subform.
That 

Re: Object notation replacement for use of Self in a script

2020-05-01 Thread Douglas von Roeder via 4D_Tech
Aparajita:

"Don’t be so quick to complain; you finally got ‘for each’ 10 years after
the rest of the world (including Active4D).”
Good point. So…you’re thinking that the feature set is complete?

"I don’t know of a single language (and I have used at least 6) where ‘for
each’ is reversible.”
This could be 4D’s chance to be a trendsetter!

"Indexed loops haven’t gone away and have their uses.”
No doubt. I have to use them often when working with collections. Frankly,
it’s funny that we have such a handy looping construct yet I have write
code to init and update my own index. How about using “++" to increment?

--
Douglas von Roeder
949-910-4084


On Fri, May 1, 2020 at 1:32 PM Aparajita Fishman via 4D_Tech <
4d_tech@lists.4d.com> wrote:

>
> >> Another WTF is that you can’t iterate from the end of a collection to
> the
> >> start. You can reorder the collection and then run a For each loop but
> >> that’s a complete kludge.
>
> Don’t be so quick to complain; you finally got ‘for each’ 10 years after
> the rest of the world (including Active4D). I don’t know of a single
> language (and I have used at least 6) where ‘for each’ is reversible.
> Indexed loops haven’t gone away and have their uses.
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Object notation replacement for use of Self in a script — v18

2020-05-01 Thread Kirk Brooks via 4D_Tech
Lahav,

On Fri, May 1, 2020 at 1:51 PM lists via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> I have one word that will do all of what we are after :   "This"
>
Damn - I wish I'd said that.


> Again, I don't think anyone on this thread is complaining, we are just
> trying to understand how to use the new functionality to do what we need to.
>
I don't either. I probably overthink things like this or project my own
experience on it too much with the focus on the conceptual stuff. But I
read a lot of posts here and on the Forum and the common thread, to me,
seems to be folks attempting to use ORDA like it's an extension of classic.
It was incredibly frustrating for me until I got past thinking about ORDA
from a classic perspective.

Cheers, will probably see you later today.
>
Hope so.

-- 
Kirk Brooks
San Francisco, CA
==
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Object notation replacement for use of Self in a script — v18

2020-05-01 Thread Chris Belanger via 4D_Tech
Hi Kirk,
Thanks for replying.
I think I stated this much earlier in this thread, but the project I am working 
on is ENTIRELY orda / object based. I do not mix ‘classic’ into it; except I 
would say some 4D commands basically still are ‘classic-oriented’ but they are 
working on ‘ORDA-izing’ it. I even wrote my own ‘class definition’ and ‘UI 
Object’ subsystem, where I have a UI to define the classes & instantiate 
objects.
In my whole project, there is not a single pointer, interprocess or process 
variable, or any such ‘vestiges’ of classic 4D. It uses Form, Storage, object 
notation, entity selections — the whole works.
Well, there are a couple pointers (local variables) because 4D still forces one 
to use them sometimes, like OBJECT Get Pointer( ). But in my own code base I do 
not use them. I use strictly object notation.
I also made up for some existing 4D shortcomings, by making some ‘wrapper’ 
routines. For example, I can get all the attributes of some form object in an 
Object.
OBJ_GetObjCharacteristics( Object Name; {what I want} ) —> OBJECT  containing 
all the attributes of that form object, such as .height, .width, .foreground, 
et al.
So I can call:
$obj_LB:=OBJ_GetObjCharacteristics( “LB_Browser” ) and then be able to use:
$obj_LB.left   $obj_LB.foreground   whatever.

I am not trying to imply I want a ’Self’ function for ORDA. Keisuke explained 
there is some differentiation between form object & the data it ‘controls’. The 
difference was never clear in classic 4D, which I think was pretty cool.
I merely am saying that when I wanted to work with the value in the SCRIPT of a 
form field in the ‘old days’ I could simply use:
Do_Something ( Self ).
And I could get at the value by  Self->  and set the value by   Self->:= ….

And I could write a generic routine (such as ‘Pretty_Format’) to handle the 
basic stuff of stripping off extraneous spaces, enforcing captalization, etc.
And it could even do something much more significant.

I would think that in the ‘ORDA / OBJECT’ paradigm, there should be a way to 
get at the ‘variable’ represented by the form object by using
This
Just like one can in many contexts in 4D right now.
In the contexts where ’This’ applies in 4D, it is astonishingly powerful and 
tremendously intuitive to use.

Anyway, back to my initial inquiry:
Imagine being able to put into a 4D Object script:
This:=Pretty_Format(This)

Or perhaps:
PRETTY_FORMAT(This).

There are many places (text entry) where you don’t really care what the person 
put into it, but you need to protect the user from common formatting issues. 

I understand Keisuke’s response that it seems eventually there will be a “This” 
in the context of a form object’s script. I hope so.
In the meantime, it seems to demand a lot of ’spaghetti code’ which I always 
detest using, just to work around the absence of ’This’ in the context of a 
form object’s script.

IN THE ABSENCE of the use of ’Self’, I was hoping there was some other simple 
provision for getting at the data for the form object.
But even OBJECT Get Data Source( ) returns a pointer, which of course is Nil 
for any Form. - based variable [i.e. Form. —  datasource]

I hope you understand my inquiry more clearly now,
Chris

And please do not say that this request is illogical … it is almost as 
fundamental as H2O. 



> On May 1, 2020, at 1:20 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Chris,
> 
> On Tue, Apr 28, 2020 at 10:53 PM Chris Belanger via 4D_Tech <
> 4d_tech@lists.4d.com > wrote:
> 
>> Generic programming of vars on a form is very complicated when one uses
>> object attributes for the data source.
>> 
>> For example, on screen you make a simple text input object named
>> “enCompany”. It’s data source is Form.en_Company.Name (  i.e.
>> [Company]Name  )
>> In ‘classic 4d”, where the data source would be [Company]Name, one can
>> code its script:
>> 
> TRIM ( Self )
> 
> And TRIM would simply take a POINTER, and you can perform operations on the
>> data that the user typed into that field. (Such as trim off leading &
>> trailing spaces).
>> 
> So what does Self actually point to? The object on the form the field is
> displayed in or the actual field in the database?
> 
> The two are not the same thing. In classic 4D that distinction is never
> really apparent to us. It didn't need to be and we didn't want to have to
> deal with it. It was part of the how we perceived working with 4D: a field
> on a form _was_ the data. It's also why 4D forms from ages past are so
> overloaded with data processing being done on the form itself instead of
> separated into more independent modules. IP and process vars enabled that
> trend even more. This is a main reason opening up one of these old
> databases in v18 and attempting to change something is so fraught. But I
> digress. With modern 4D tools you just don't do things that way anymore.
> 
> Working with ORDA I rarely find a pointer a good solution to anythin

Re: Object notation replacement for use of Self in a script — v18

2020-05-01 Thread Chris Belanger via 4D_Tech
Exactly. Lahav really gets it. — CB

> On May 1, 2020, at 2:51 PM, lists via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> Kirk,
> 
> I have one word that will do all of what we are after :   "This"
> 
> It works in listbox, which is a form object, any reason it can't be extended 
> to other form objects?
> 
> Again, I don't think anyone on this thread is complaining, we are just trying 
> to understand how to use the new functionality to do what we need to.
> 
> We need to interact with the users through some entry areas, call it objects, 
> fields, variables. Whatever. And sometimes do silly things like verification 
> of values, formatting to a certain standard etc.From everything that was 
> presented so far, there is no way to utilize the new methodology (call it 
> ORDA, dot notation whatever) as a data source of an entry area without using 
> some part of classic 4D.  Coming up with all sorts of workarounds is fine, 
> but it is still a workaround.
> 
> Cheers, will probably see you later today.
> 
> Lahav
> 
> -Original Message-
> From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of Kirk Brooks via 
> 4D_Tech
> Sent: Friday, May 1, 2020 1:21 PM
> To: 4D iNug Technical <4d_tech@lists.4d.com>
> Cc: Kirk Brooks 
> Subject: Re: Object notation replacement for use of Self in a script — v18
> 
> Chris,
> 
> On Tue, Apr 28, 2020 at 10:53 PM Chris Belanger via 4D_Tech < 
> 4d_tech@lists.4d.com> wrote:
> 
>> Generic programming of vars on a form is very complicated when one 
>> uses object attributes for the data source.
>> 
>> For example, on screen you make a simple text input object named 
>> “enCompany”. It’s data source is Form.en_Company.Name (  i.e.
>> [Company]Name  )
>> In ‘classic 4d”, where the data source would be [Company]Name, one can 
>> code its script:
>> 
> TRIM ( Self )
> 
> And TRIM would simply take a POINTER, and you can perform operations on the
>> data that the user typed into that field. (Such as trim off leading & 
>> trailing spaces).
>> 
> So what does Self actually point to? The object on the form the field is 
> displayed in or the actual field in the database?
> 
> The two are not the same thing. In classic 4D that distinction is never 
> really apparent to us. It didn't need to be and we didn't want to have to 
> deal with it. It was part of the how we perceived working with 4D: a field on 
> a form _was_ the data. It's also why 4D forms from ages past are so 
> overloaded with data processing being done on the form itself instead of 
> separated into more independent modules. IP and process vars enabled that 
> trend even more. This is a main reason opening up one of these old databases 
> in v18 and attempting to change something is so fraught. But I digress. With 
> modern 4D tools you just don't do things that way anymore.
> 
> Working with ORDA I rarely find a pointer a good solution to anything except 
> managing form objects like buttons. We are saddled with some unfortunate 
> nomenclature here because a 'form object' has nothing to do with an object in 
> Form. 'Form objects' are those named widgets on the form.
> They _may_ be populated with data from something in Form, or a variable, or a 
> list box and so on.
> 
> A big conceptual difference between classic 4D and modern 4D is the 
> distinction between a form object and the data it presents is explicit. So 
> when I set the data source for an input object to be
> 
> Form.myEntity_o.Name
> 
> where myEntity_o is a reference to an entity in Company the actual data and 
> the form object are no longer implicitly the same thing like they are in 
> classic 4D. I have a reference to the entity and I have a form object. They 
> are two different things.
> 
> I can't get a pointer to the form object in this case. Why not?
> First, what do I want to do with it? If I want to manage the form object 
> itself, visibility, enterability, etc., I don't need a pointer, I can just 
> use the object name.
> If I want to do something with the data, as you do, the pointer won't work 
> because there are no pointers to object references. Why not? I'm sure there 
> are technical reasons but they don't matter to me because you don't need it. 
> You don't need it because you have a reference: myEntity_o. If you want to 
> change the data you do that with the reference - not through whatever that 
> data happens to be displayed in.
> 
> This is a fundamental, conceptual difference between using ORDA and classic 
> 4D.
> 
> In classic 4D we have tables, records, fields and pointers to reference them.
> In ORDA we have datastores, dataclasses, entities, properties and we use 
> references.
> 
> 
> In the example of the name field you can still put code in the form object to 
> react to On Data Change. And you can still pass data to a generic method to 
> manage it. Two ideas come to mind:
> 1) method takes an entity
> 
> // myMethod1 (entity)
> 
> // $1 is  a Company entity - check the name, address, etc. for proper 
> f

iNUG Messages — Is it time for it to be more than just 'plain text' ???

2020-05-01 Thread Chris Belanger via 4D_Tech
It would be so much easier to conduct our conversations and ask our questions 
if we could include screen shots, or even just use font colours or bold or 
sizes in a message.
Having to send it all as ‘plain text’ seems 1990’s - ish.

Do you think the iNUG would be so much more useful if it would support 
messaging with font attributes (bold, colour, whatever) and images?

It is so hard to explain ‘in text’ something that a snapshot would explain in a 
second. And it seems so easy to misunderstand what a poster is saying / 
discussing when it has to be entirely written out.

Like, for instance, the ambiguity of terms like ‘object’ and the like.

I understand that images increases storage, transmission, etc. But would the 
benefits outweigh the ‘costs’ ?

Anyway, my two cents,

— Chris
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: iNUG Messages — Is it time for it to be more than just 'plain text' ???

2020-05-01 Thread Cannon Smith via 4D_Tech
Hi Chris,

Have you seen the new forums?

https://discuss.4d.com

They should do what you’re after.

--
Cannon Smith
Synergy Farm Solutions Inc.



> On May 1, 2020, at 5:41 PM, Chris Belanger via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Do you think the iNUG would be so much more useful if it would support 
> messaging with font attributes (bold, colour, whatever) and images?

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Object notation replacement for use of Self in a script — v18

2020-05-01 Thread James Crate via 4D_Tech
On May 1, 2020, at 3:44 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> I have not had any great joy attempting to use pop-ups with object
> references. Haven't tried in v18 so maybe it's improved.

In V17, popups work with form object expressions. If you set the expression to 
“Form.payment_type”, then when it displays, it selects the appropriate value in 
the popup, and choosing an item populates Form.payment_type” with the value. If 
you have a static set of options you just enter them in the object properties 
and you’re done. If you need a dynamic list it’s also pretty easy to use New 
list and OBJECT SET LIST BY REFERENCE.  Much nicer than using popups with 
arrays.


> But with respect to changing the names of a few form objects why is that a
> deal? The form objects can be named anything - doesn't matter what the
> field names are.

I know form objects can be named anything. That was entirely my point; if you 
use form object names to reference the value, I.e. 

> Here is an example. I created a form with one in input and the object method 
> below. The form object name is "some.property.path" and the expression is 
> Form.some.property.path.

Then you probably can’t use form object names to help manage groups of form 
objects.

Jim Crate

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Object notation replacement for use of Self in a script — v18

2020-05-01 Thread James Crate via 4D_Tech
On Apr 30, 2020, at 9:36 PM, Douglas von Roeder via 4D_Tech 
<4d_tech@lists.4d.com> wrote:
> 
> Another WTF is that you can’t iterate from the end of a collection to the
> start. You can reorder the collection and then run a For each loop but
> that’s a complete kludge.

For each ($item;$collection.reverse())
  // do some stuff
End for each

This is pretty much the same way you enumerate in reverse order in the other 
languages I use.

Jim Crate

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Distinct Collection

2020-05-01 Thread James Crate via 4D_Tech
On Apr 29, 2020, at 2:21 PM, Paul Dennis via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> I have a collection created from arrays via mysql. This contains duplicated
> elements. I'm trying to do the equivalent of distinct values but the
> collection.distinct command does not do the distinction on a single
> attribute. 
> 
> This is really slow and doesn't seem to work.
> 
> ARRAY TO
> COLLECTION($companycol;$CompanyUUID;"UUID";$alContactMySqlID;"MySQLUserID";$asName;"Name";$asAddress;"AddressLine1";$asCity;"Town";$asPostcode;"PostCode")
> 
> $col:=$companycol.distinct("MySQLItemID")
> 
> For each ($element;$col)
>   
>   $col2:=$companycol.query("MySQLItemID = :1";$element)
This line finds *all* items in $companycol matching the ID, and 

>   $col3.combine($col2)
this line adds *all* those found elements to $col3. So at the end, $col3 should 
be the same as $companycol. What you probably want is:

$col3.push($col2[0])

This will just add the first found element, not all the duplicates that were 
also found by .query(). You shouldn’t have to check whether you found any items 
since you’re querying on IDs you’ve extracted from the collection.

> End for each 

> $col.clear()
> $col2.clear()
> $companycol:=$col3
> $col3.clear()

You shouldn’t need to clear the collections either, unless you are going to use 
them again for something else. As local variables, they’ll be cleared when the 
method ends.

Jim Crate

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Distinct Collection

2020-05-01 Thread James Crate via 4D_Tech
On Apr 29, 2020, at 2:21 PM, Paul Dennis via 4D_Tech <4d_tech@lists.4d.com> 
wrote:
> 
> I have a collection created from arrays via mysql. This contains duplicated
> elements. I'm trying to do the equivalent of distinct values but the
> collection.distinct command does not do the distinction on a single
> attribute. 

I forgot to show what I’d do. Querying every distinct ID is likely to be slow 
if there are many rows. This could be simplified a bit.


ARRAY TO 
COLLECTION($companycol;$CompanyUUID;"UUID";$alContactMySqlID;"MySQLUserID";$asName;"Name";$asAddress;"AddressLine1";$asCity;"Town";$asPostcode;"PostCode”)

// MySQLItemID is not in the ARRAY TO COLLECTION?

// Sort the collection
$companycol:=$companycol.orderBy(“MySQLItemID”)

$uniqueCol:=New collection
$lastID:=-1
For each ($element;$companycol)
 If ($lastID#$element.MySQLItemID)
   $lastID:=$element.MySQLItemID
   $uniqueCol.push($element)
 End if
End for each



Jim Crate

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Object notation replacement for use of Self in a script

2020-05-01 Thread Aparajita Fishman via 4D_Tech
> "Don’t be so quick to complain; you finally got ‘for each’ 10 years after
> the rest of the world (including Active4D).”
> Good point. So…you’re thinking that the feature set is complete?

Absolutely. In fact it is more complete than most implementations, you can 
specify and begin and end index for ordered collections.


> "I don’t know of a single language (and I have used at least 6) where ‘for
> each’ is reversible.”
> This could be 4D’s chance to be a trendsetter!

I don’t think it's worth it. Iterating in reverse is not a common operation.


> it’s funny that we have such a handy looping construct yet I have write
> code to init and update my own index.

If you need an index in a ‘for each’ loop, you should actually be using an 
indexed ‘for’ loop. That’s the point of having ‘for each’ separate from ‘for’: 
90% of the time you don’t need the index and ‘for each’ is more concise, but 
when you need an index a for loop increments it for you.

- Aparajita

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Object notation replacement for use of Self in a script ― v18

2020-05-01 Thread Chip Scheide via 4D_Tech
Lahav,
not 'That', 'This'  :)

Chip
> 
>> I have one word that will do all of what we are after :   "This"
>> 
> Damn - I wish I'd said that.

Hell is other people 
 Jean-Paul Sartre
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: iNUG Messages ― Is it time for it to be more than just 'plain text' ???

2020-05-01 Thread Chip Scheide via 4D_Tech
you need to up your ASCII drawing skills   :)


> 
> It is so hard to explain ‘in text’ something that a snapshot would 
> explain in a second.

Hell is other people 
 Jean-Paul Sartre
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: iNUG Messages ― Is it time for it to be more than just 'plain text' ???

2020-05-01 Thread Chip Scheide via 4D_Tech
I have been to the new forums - much better then the old one.
however -
I really prefer everything coming to me (email) vs having to go get it (forum)

Chip


> Hi Chris,
> 
> Have you seen the new forums?
> 
>   https://discuss.4d.com
> 
> They should do what you’re after.
> 
> --
> Cannon Smith
> Synergy Farm Solutions Inc.
> 
> 
> 
>> On May 1, 2020, at 5:41 PM, Chris Belanger via 4D_Tech 
>> <4d_tech@lists.4d.com> wrote:
>> 
>> Do you think the iNUG would be so much more useful if it would 
>> support messaging with font attributes (bold, colour, whatever) and 
>> images?
> 
> **
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

Hell is other people 
 Jean-Paul Sartre
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: iNUG Messages — Is it time for it to be more than just 'plain text' ???

2020-05-01 Thread Koen Van Hooreweghe via 4D_Tech
Hi Chip,

I haven't tested myself, but afak this feature is available in the new 4D 
forum. It is using Discourse (www.discource.org), which offers mailing list 
support.

HTH
Koen

> Op 2 mei 2020, om 07:38 heeft Chip Scheide via 4D_Tech <4d_tech@lists.4d.com> 
> het volgende geschreven:
> 
> I really prefer everything coming to me (email) vs having to go get it (forum)




Compass bvba
Koen Van Hooreweghe
Kloosterstraat 65
9910 Aalter
Belgium
tel +32 495 511.653

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

RE: Object notation replacement for use of Self in a script — v18

2020-05-01 Thread lists via 4D_Tech
I've created a feature request on the new forum.  Voting is open.

Lahav

-Original Message-
From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of Kirk Brooks via 
4D_Tech
Sent: Friday, May 1, 2020 3:13 PM
To: 4D iNug Technical <4d_tech@lists.4d.com>
Cc: Kirk Brooks 
Subject: Re: Object notation replacement for use of Self in a script — v18

Lahav,

On Fri, May 1, 2020 at 1:51 PM lists via 4D_Tech <4d_tech@lists.4d.com>
wrote:

> I have one word that will do all of what we are after :   "This"
>
Damn - I wish I'd said that.


> Again, I don't think anyone on this thread is complaining, we are just 
> trying to understand how to use the new functionality to do what we need to.
>
I don't either. I probably overthink things like this or project my own 
experience on it too much with the focus on the conceptual stuff. But I read a 
lot of posts here and on the Forum and the common thread, to me, seems to be 
folks attempting to use ORDA like it's an extension of classic.
It was incredibly frustrating for me until I got past thinking about ORDA from 
a classic perspective.

Cheers, will probably see you later today.
>
Hope so.

--
Kirk Brooks
San Francisco, CA
==
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**
**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**