Re: Collections

2018-03-21 Thread John DeSoi via 4D_Tech
Tim,

I was not convinced that proves it. Internally, it could just keep track of the 
largest value and return null for any values in between that are not assigned.

But I thought of a test that likely proves you are right:

C_COLLECTION($test)
$test:=New Collection
$test[MAXLONG-5]:=5

You'll be waiting for a while...

John DeSoi, Ph.D.



> On Mar 21, 2018, at 7:41 PM, Timothy Penner  wrote:
> 
> Actually, it does create 247 empty elements (null to be exact).
> 
> Try it and look in the debugger.

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
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: Collections

2018-03-21 Thread Timothy Penner via 4D_Tech
> $collection := New collection()
> $collection[247] := "fred"
>
> I doubt that it creates 247 (indexes 0-246) empty elements in the collection. 
> Would love to hear confirmation or denial from some one at 4D that knows the 
> internals.

Actually, it does create 247 empty elements (null to be exact).

Try it and look in the debugger.

-Tim




**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
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: Collections

2018-03-21 Thread John DeSoi via 4D_Tech
In the 4D case and in the cases below (plus PHP), I suspect a collection is 
really just an "object" (hash table) with numeric keys instead of string keys. 
For example, if I write

$collection := New collection()
$collection[247] := "fred"

I doubt that it creates 247 (indexes 0-246) empty elements in the collection. 
Would love to hear confirmation or denial from some one at 4D that knows the 
internals.

John DeSoi, Ph.D.
 


> On Mar 21, 2018, at 4:19 PM, Lee Hinde via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Please. You mean like an array in almost any other language:
> 
> python:
> x = ["fred", 2, {"test":4}]
> 
> javascript:
> var x = ["fred", 2, {"test":4}];

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
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: Collections

2018-03-21 Thread Robert McKeever via 4D_Tech
Anybody here remember Pick Basic? A record had many fields, each field could 
have many values, and any value could have many sub values.

Like working with a cube where you can reference any point in the cube, and may 
be of any type.

When used properly, the structure was marvelous. When abused, well, how about 
30 minute delay in loading a record. Seen both.

> On Mar 21, 2018, at 2:19 PM, Lee Hinde via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> Please. You mean like an array in almost any other language:
> 
> python:
> x = ["fred", 2, {"test":4}]
> 
> javascript:
> var x = ["fred", 2, {"test":4}];
> 
> 
>> On Mar 21, 2018, at 1:00 PM, Tom Swenson via 4D_Tech <4d_tech@lists.4d.com> 
>> wrote:
>> 
>> OK, like PHP arrays 
>> 
>> On 3/16/18, 8:23 AM, "4D_Tech on behalf of Jeff Grann via 4D_Tech" 
>> <4d_tech-boun...@lists.4d.com  on 
>> behalf of 4d_tech@lists.4d.com > wrote:
>> 
>>   Haven’t worked with them yet, but my understanding is that a collection is 
>> an ordered list of values of possibly varying types.  In 4D arrays, all of 
>> the values must be the same type.  In a 4D collection, you can use mixed 
>> types as the elements.
>> 
>>   Example:
>> 
>>   $MyCollection[0]:=“Hello”
>>   $MyCollection[1]:=5
>>   $MyCollection[2]:=$AnObject
>>   $MyCollection[3]:=$AnArray
>>   $MyCollection[4]:=True
>> 
>>   --
>>   Jeff Grann
>>   SuccessWare, Inc.
>> **
>> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

_
Bob McKeever  http://www.mswl.com 
McKeever's Software Wizardry
Port Coquitlam, B.C.
bobmckee...@mac.com




**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
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: Collections

2018-03-21 Thread Lee Hinde via 4D_Tech
Please. You mean like an array in almost any other language:

python:
x = ["fred", 2, {"test":4}]

javascript:
var x = ["fred", 2, {"test":4}];


> On Mar 21, 2018, at 1:00 PM, Tom Swenson via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> OK, like PHP arrays 
> 
> On 3/16/18, 8:23 AM, "4D_Tech on behalf of Jeff Grann via 4D_Tech" 
> <4d_tech-boun...@lists.4d.com  on behalf 
> of 4d_tech@lists.4d.com > wrote:
> 
>Haven’t worked with them yet, but my understanding is that a collection is 
> an ordered list of values of possibly varying types.  In 4D arrays, all of 
> the values must be the same type.  In a 4D collection, you can use mixed 
> types as the elements.
> 
>Example:
> 
>$MyCollection[0]:=“Hello”
>$MyCollection[1]:=5
>$MyCollection[2]:=$AnObject
>$MyCollection[3]:=$AnArray
>$MyCollection[4]:=True
> 
>--
>Jeff Grann
>SuccessWare, Inc.
> **
> 

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
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: Where can I find 4D Internet Commands (for v16)?

2018-03-21 Thread John DeSoi via 4D_Tech
In the full version download I see both 4D Internet Commands and 4D Pack in the 
Plugins folder.

Also, 4D Internet Commands seems to be installed by default in the 4D 
application. So you don't really have to install it at all if you want to use 
the version that matches the 4D version you have. On the Mac, this is located in

4D.app/Contents/Plugins/4DInternetCommands.bundle

John DeSoi, Ph.D.



> On Mar 21, 2018, at 3:00 PM, Bob Miller via 4D_Tech <4d_tech@lists.4d.com> 
> wrote:
> 
> I feel a bit silly, but I've just killed an hour looking for the v16 
> version of "4D Internet Commands".The v16 Conversion manual specifies 
> there are differences between v15 and v16, so I presume there is a v16 
> version out there, but I don't see it on the FTP site (mostly old stuff at 
> ftp://ftp.4d.com/ - and ftp://ftp.4d.com/PRODUCTS/Current/ contains v14.x 
> stuff), nor is it listed at http://www.4d.com/products/4dv16.html
> 
> Search on the site didn't find anything newer than v
> 
> forums.4d.fr has always confused me, but I couldn't find it there, either.
> 
> Is there a new 4D Pack for v16, or have all the 4D Pack commands now been 
> built in?

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
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: Where can I find 4D Internet Commands (for v16)?

2018-03-21 Thread Timothy Penner via 4D_Tech
Hi Bob,

After you install v16.x the 4DIC plugin should be in the installation folder.

For v16.3 check the following locations:

On Windows 32 bit, C:\Program Files (x86)\4D\4D v16.3\Plugins\
On Windows 64 bit, C:\Program Files\4D\4D v16.3\Plugins\
On Mac 32 bit, /Applications/4D v16.3/32-bit version/Plugins
On Mac 64 bit, /Applications/4D v16.3/Plugins

-Tim



**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
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: Where can I find 4D Internet Commands (for v16)?

2018-03-21 Thread Jim Dorrance via 4D_Tech
Hi Bob,

Sorry, I don't know.

Jim

On Wed, Mar 21, 2018 at 9:00 PM, Bob Miller via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Hi Jim,
>
> I feel a bit silly, but I've just killed an hour looking for the v16
> version of "4D Internet Commands".The v16 Conversion manual specifies
> there are differences between v15 and v16, so I presume there is a v16
> version out there, but I don't see it on the FTP site (mostly old stuff at
> ftp://ftp.4d.com/ - and ftp://ftp.4d.com/PRODUCTS/Current/ contains v14.x
> stuff), nor is it listed at http://www.4d.com/products/4dv16.html
>
> Search on the site didn't find anything newer than v
>
> forums.4d.fr has always confused me, but I couldn't find it there, either.
>
> Is there a new 4D Pack for v16, or have all the 4D Pack commands now been
> built in?
>
> thanks -
>
>
> Bob Miller
> Chomerics, a division of Parker Hannifin Corporation
>
>
> ll
> "PLEASE NOTE: The preceding information may be confidential or privileged.
> It only should be used or disseminated for the purpose of conducting
> business with Parker. If you are not an intended recipient, please notify
> the sender by replying to this message and then delete the information from
> your system. Thank you for your cooperation."
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **




-- 
Jim Dorrance
jim.dorra...@gmail.com
4...@dorrance.eu
www.4d.dorrance.eu

PS: If you know of anyone that needs an experienced 4D programmer to add
energy and experience to their team, please let me know. I have
experience in many areas. Reasonable rates. Remote or Paris only.
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
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: Collections

2018-03-21 Thread Tom Swenson via 4D_Tech
OK, like PHP arrays 

On 3/16/18, 8:23 AM, "4D_Tech on behalf of Jeff Grann via 4D_Tech" 
<4d_tech-boun...@lists.4d.com on behalf of 4d_tech@lists.4d.com> wrote:

Haven’t worked with them yet, but my understanding is that a collection is 
an ordered list of values of possibly varying types.  In 4D arrays, all of the 
values must be the same type.  In a 4D collection, you can use mixed types as 
the elements.

Example:

$MyCollection[0]:=“Hello”
$MyCollection[1]:=5
$MyCollection[2]:=$AnObject
$MyCollection[3]:=$AnArray
$MyCollection[4]:=True

--
Jeff Grann
SuccessWare, Inc.
**

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

Where can I find 4D Internet Commands (for v16)?

2018-03-21 Thread Bob Miller via 4D_Tech
Hi Jim,

I feel a bit silly, but I've just killed an hour looking for the v16 
version of "4D Internet Commands".The v16 Conversion manual specifies 
there are differences between v15 and v16, so I presume there is a v16 
version out there, but I don't see it on the FTP site (mostly old stuff at 
ftp://ftp.4d.com/ - and ftp://ftp.4d.com/PRODUCTS/Current/ contains v14.x 
stuff), nor is it listed at http://www.4d.com/products/4dv16.html

Search on the site didn't find anything newer than v

forums.4d.fr has always confused me, but I couldn't find it there, either.

Is there a new 4D Pack for v16, or have all the 4D Pack commands now been 
built in?

thanks -


Bob Miller
Chomerics, a division of Parker Hannifin Corporation


ll
"PLEASE NOTE: The preceding information may be confidential or privileged. It 
only should be used or disseminated for the purpose of conducting business with 
Parker. If you are not an intended recipient, please notify the sender by 
replying to this message and then delete the information from your system. 
Thank you for your cooperation."
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
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: overlapping subforms

2018-03-21 Thread Kirk Brooks via 4D_Tech
Hey Piotr,


On Wed, Mar 21, 2018 at 2:50 AM, Piotr Chabot Stadhouders via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> > another approach that results in the same UI.
> I have converted the parent form, with 23 programmatically build listboxes
> on it that are show/hidden, into a parent form with 7 subforms with static
> listboxes (columns created in design mode)
> This all advised by others in another thread you can read on the iNUG
> about programmatically creating listboxes and performance
> I must say this exercise indeed resulted in a big performance gain
>
​I recall that thread. yeah, building all those listboxes as you were was -
heroic.​

> The version you are using also may matter
> I use 4D v16 R6 on Windows and OSX
>
​Being on the bleeding edge like this can be problematic. And there are
differences between 32 bit and 64  bit that crop up in unexpected places.

This is a complex form. Do you need to be on R6? Could you be on v16.3 just
for the sake of stability? ​


> > What does "save the form" mean? Saving the parent form or the subform?
> In design mode, when putting the subform on the form in front of the other
> subforms  (I don't use OBJECT DUPLICATE) and close the parent form and
> reopen it (or even when I save the parent form) the subform I put in front
> goes to the back again. I am not able to keep it in front.

​It might well be a bug. ​


> As I replied on another post maybe this could be because there is a
> webarea on it?
>
As far as I know the rendering of the webarea is differs from the rendering
> of the other objects on a form
> It often happens that the webarea (and other plugins as well) are rendered
> earlier than other objects, resulting in ugly white parts on the screen
> while for example executing an object method
>
​Maybe but I doubt it. The web area is more or less like any other object
on the form at that level. I don't think there is anything about it that's
going to 'bleed out' as it were and contaminate the other objects.

Y
​ou touch on a good point about the order that your objects load. Remember
it goes like this:

Objects on subforms
Subform form method  (but the On load event only fires once - when the
parent form loads the first time)
objects on parent form
parent form method


​If you do alot, or all, of the ​form configuration in the On load form
event of the Parent Form you must remember that you are doing so AFTER
everything else has already run.

I'm not saying not to do that config there. I do it in almost all my forms.
It's just you have to set up the form to accommodate it. It's not hard. I
use EXECUTE IN SUBFORM from here to configure my subforms, for example. I
also deselect the On load event on all the subform objects (the ones on the
parent form) just to keep control.

Also, if you have an input form that allows you to navigate through some
records (next, previous, etc) and you have a subform on it the subform form
method will only fire the first time the parent form loads. It DOES NOT
fire each time you change records like the parent form does. This can be
very confusing.

My final conclusions so far:
> - There is some kind of bug in 4D because even when I set a subform object
> to the front it disappears to the back again when saving the parent form
>
​maybe​


> - Because of difference between rendering of webareas (and other plugins)
> and other objects there are some redraw problems when setting objects to
> visible/invisible when webareas are involved
>
​It may not be an issue with _what_ the objects render but the _sequence_
they render in. ​If you expect these subforms to load in a particular order
or they depend on data in another subform this will be really challenging
unless you centralize this setup work.

-- 
Kirk Brooks
San Francisco, CA
===

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

Write Pro setting print options

2018-03-21 Thread Pat Bensky via 4D_Tech
I use

SET PRINT OPTION(Paper option;"A4")

to set the page size to A4.

But this doesn't seem to work.
If I view the document that was created, go to
Document->Page size

No page size is selected.
I choose A4 and the page size changes accordingly.

BTW if I go again to Document->Page size, it still doesn't show which page
size is selected.

Likewise, SET PRINT OPTION(Orientation option;2) doesn't seem to have any
effect.

Am I doing this the wrong way?

PB

*
CatBase - Top Dog in Data Publishing
tel: +44 (0) 207 118 7889
w: http://www.catbase.com
skype: pat.bensky
*
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
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: overlapping subforms

2018-03-21 Thread Piotr Chabot Stadhouders via 4D_Tech
Hi Kirk,

Thanks for diving into my subform problem


> another approach that results in the same UI.
I have converted the parent form, with 23 programmatically build listboxes on 
it that are show/hidden, into a parent form with 7 subforms with static 
listboxes (columns created in design mode)
This all advised by others in another thread you can read on the iNUG about 
programmatically creating listboxes and performance
I must say this exercise indeed resulted in a big performance gain

> The version you are using also may matter
I use 4D v16 R6 on Windows and OSX

> What does "save the form" mean? Saving the parent form or the subform?
In design mode, when putting the subform on the form in front of the other 
subforms  (I don't use OBJECT DUPLICATE) and close the parent form and reopen 
it (or even when I save the parent form) the subform I put in front goes to the 
back again. I am not able to keep it in front. All these subforms are on page 1.

> If it is on the parent form you really shouldn't have a problem.
So, all subforms are on page 1 of the parent form, and the problematic subform 
is shown by an action in the parent form
As I replied on another post maybe this could be because there is a webarea on 
it?
As far as I know the rendering of the webarea is differs from the rendering of 
the other objects on a form
It often happens that the webarea (and other plugins as well) are rendered 
earlier than other objects, resulting in ugly white parts on the screen while 
for example executing an object method

My final conclusions so far:
- There is some kind of bug in 4D because even when I set a subform object to 
the front it disappears to the back again when saving the parent form
- Because of difference between rendering of webareas (and other plugins) and 
other objects there are some redraw problems when setting objects to 
visible/invisible when webareas are involved

Gr,

Piotr




> -Oorspronkelijk bericht-
> Van: Kirk Brooks 
> Verzonden: dinsdag 20 maart 2018 15:57
> Aan: 4D iNug Technical <4d_tech@lists.4d.com>
> Onderwerp: Re: overlapping subforms
> 
> Piotr,
> This sounds like a creative use of subforms. But it also sounds pretty 
> complex.
> So the first thought I offer is to look at what you are trying to do and be 
> sure
> using subforms in actually the best solution. It may be but there may also be
> another approach that results in the same UI.
> 
> For example, you could use OBJECT SET SUBFORM
>  3576522.en.html> to and simply change the displayed subform as required
> instead of managing multiple subform objects.
> 
> The version you are using also may matter. But to answer the question you
> asked:
> 
> On Mon, Mar 19, 2018 at 1:40 AM, Piotr Chabot Stadhouders via 4D_Tech <
> 4d_tech@lists.4d.com> wrote:
> 
> > I have a form with a couple of subforms on it Now I want to add
> > another subform, that is on top of 3 others, and becomes visible when
> > pressing a button
> >
> 
> ​First I'm assuming all 3 of these subforms are on the parent form and not
> nested (a subform on a subform) AND on the same form page. Also, are the
> subform objects, the variables that contain the subforms, process variables or
> form variables?
> 
> If the subform you are trying to display is on page 0 it would create this 
> issue.
> Either put all the subforms on page 0 or put a subform on each page for this
> purpose. Remember you can use ​ ​Are you using OBJECT DUPLICATE
> 
> to add subforms? If so remember to ​specify the "boundTo" object. This param
> lets you manage the z order of the objects. If you don't use it the new 
> object is
> at the top of the stack. This could account for the issue.
> 
> The other possibility is the context. When you say "press a button" where is 
> that
> button? This is important.
> 
> If it is on the parent form you really shouldn't have a problem.
> 
> If it's on a subform you may be opening the popup subform within the subform
> with the button because the button on the subform runs in the context of the
> subform - not the parent form. This can be quite confusing.
> 
> Remember that the form events on a subform run BEFORE the parent form. So
> an On clicked event from a button on a subform runs:
> 1) in the subform button
> 
> 2) the subform form method
> 
> 3) the subform container (which is the 'subform object' on the parent form)
> 
> 4) the parent form method
> 
> 
> You can see it as a kind of popup viewer
> >
> ​The subform pops up - is it displaying fields from a record (which record) or
> something like a list, variables etc?​
> 
> 
> 
> > Because the subform must show in front of the others, in design mode I
> > put the subform container to the front However, when I save the form
> > the subform container disappears to the back agai ​n
> >
> ​What does "save the form" mean? Saving the parent