Re: Collections Issue

2019-11-14 Thread Christian Sakowski via 4D_Tech
> How does one iterate backwards through a collection? I realize that I can > reverse the collection and iterate forward through it but there’s > no contraindication to iterating backward. Yes, it’s currently not implemented. As you said, collections have a method „reverse()“. -- Grüß

Re: Collections Issue

2019-11-14 Thread Christian Sakowski via 4D_Tech
> Collections all have a “.length”, read only function. > > For($i;$Col.length-1;0;-1) > $Col[$i]… > End for > > HTH! For Collections and Objects a for-each loop is recommended because it’s easy to read and powerful. -- Grüße/Regards, [heubach-media] | Christian Sak

RE: Collections Issue

2019-11-14 Thread David Ringsmuth via 4D_Tech
Doug, Collections all have a “.length”, read only function. For($i;$Col.length-1;0;-1) $Col[$i]… End for HTH! David Ringsmuth From: Douglas von Roeder via 4D_Tech Sent: Thursday, November 14, 2019 4:01 PM To: 4D iNug Technical Cc: Douglas von Roeder Subject: Collections Issue

Collections Issue

2019-11-14 Thread Douglas von Roeder via 4D_Tech
*C_COLLECTION*($coll_C) $coll_C:=*New collection*("Curly";"Moe";"Larry") *C_TEXT*($name_T) *For each* ($name_T;$coll_C;0;2) *ALERT*($name_T) *End for each* results in alerts for “Curly”, “Moe”, and “Larry". *For each* ($name_T;$coll_C;0;2) *ALERT*($name_T) *End for each* result

Re: Concatenating collections in v17R5

2019-11-04 Thread Jeremy Roussak via 4D_Tech
05-4621805.en.html > > Keith - CDI > >> On Nov 4, 2019, at 5:26 PM, Jeremy Roussak via 4D_Tech >> <4d_tech@lists.4d.com> wrote: >> >> I’m probably missing something obvious here, but if I have two collections >> and I want to add all the elements of one t

Re: Concatenating collections in v17R5

2019-11-04 Thread kculotta via 4D_Tech
collection.combine( ) does that. https://doc.4d.com/4Dv17/4D/17.3/collectioncombine.305-4621805.en.html Keith - CDI > On Nov 4, 2019, at 5:26 PM, Jeremy Roussak via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > I’m probably missing something obvious here, but if I have two co

Concatenating collections in v17R5

2019-11-04 Thread Jeremy Roussak via 4D_Tech
I’m probably missing something obvious here, but if I have two collections and I want to add all the elements of one to the end of the other, is there a simple way? So if c1 is [1,2,3] and c2 is [4,5,6], the result is [1,2,3,4,5,6]. Jeremy

Re: ORDA/Collections

2019-10-30 Thread Cannon Smith via 4D_Tech
Hi Justin, Have you taken a look at the extract function on collections? I think it would do what you want. -- Cannon.Smith Synergy Farm Solutions Inc. Aetna, AB Canada > On Oct 30, 2019, at 2:45 PM, Justin Will via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > $oRecs

Re: ORDA/Collections

2019-10-30 Thread Keisuke Miyako via 4D_Tech
"For each" loop is a good place to start. once you've familiarised yourself with collections and objects, you might want to look into collection methods such as map() for this kind of work. 2019/10/31 9:11、Justin Will mailto:jw...@willwerks.com>>のメール: I couldn't see

RE: ORDA/Collections

2019-10-30 Thread Justin Will via 4D_Tech
I couldn't seem to get Selection To JSON with a template to do what I wanted to. I ended up writing this and it fits the bill. For each ($oRec;$oRecs) $oComplex:=New object $oComplex.key:=$oRec.ID $oComplex.label:=$oRec.Name $oComplex.open:=True ARRAY OBJ

Re: ORDA/Collections

2019-10-30 Thread Keisuke Miyako via 4D_Tech
rather than using ORDA, you could use classic QUERY and call Selection to JSON with a template. https://doc.4d.com/4Dv15/4D/15.6/Selection-to-JSON.301-3817892.en.html the feature allows you rename and reorder your selection of fields however way you like. > 2019/10/31 5:45、Justin Will via 4D_Te

Re: ORDA/Collections

2019-10-30 Thread Kirk Brooks via 4D_Tech
d entities a sub loop of the parent. It will be more robust than including the relations in your parent entity map. On Wed, Oct 30, 2019 at 1:45 PM Justin Will via 4D_Tech < 4d_tech@lists.4d.com> wrote: > I need a json object output in a particular format and 4D's new datastore >

ORDA/Collections

2019-10-30 Thread Justin Will via 4D_Tech
I need a json object output in a particular format and 4D's new datastore and collections do this out of the box in 3 lines of code for me. It's almost magical. $oRecs:=ds.Complex.query("Domain_ID = :1";_Domain_ID) $coll:=$oRecs.toCollection("ID, Name, Facil

Re: Shared objects and collections

2019-09-16 Thread Keisuke Miyako via 4D_Tech
you can grow a collection implicitly using bracket notation. quote: If this element index is beyond the last existing element of the collection, the collection is automatically resized and all new intermediary elements get the null value https://doc.4d.com/4Dv17/4D/17.3/Using-object-notation.30

Re: Shared objects and collections

2019-09-14 Thread Kirk Brooks via 4D_Tech
Hi Jim, I haven't worked with Storage very much because frankly it's a pain and it's slow. I get why it's a pain and has so much overhead. Every single object has to have its own lock/unlock ('locker') mechanism and it works between preemptive processes. So cool for that - no small thing. For me it

Re: Shared objects and collections

2019-09-13 Thread Jim Crate via 4D_Tech
On Sep 9, 2019, at 9:55 PM, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> wrote: > >> So it looks like you can’t .push() a shared object onto a shared collection. > > not quite. > > a shared object is either single (solo) or multiple (once belonged to a group) > if an object joins a group,

Re: Shared objects and collections

2019-09-09 Thread Keisuke Miyako via 4D_Tech
> So it looks like you can’t .push() a shared object onto a shared collection. not quite. a shared object is either single (solo) or multiple (once belonged to a group) if an object joins a group, it is free to leave it, but it can't join another group. i.e. once you divorce your spouse, you c

Re: Shared objects and collections

2019-09-09 Thread Jim Crate via 4D_Tech
So what doesn’t work is: $sharedObj:=New Shared Collection OB_CopyToSharedObject ($catalogObj;$sharedObj) Use (Storage.MySharedCollection) Storage.MySharedCollection.push($sharedObj) End use What does work is: Storage.MySharedCollection.push(New shared object) Use (Storage.MySharedCol

Shared objects and collections

2019-09-09 Thread Jim Crate via 4D_Tech
I’m retrieving some info from an API that I’d like to cache, and I’m using v17, so I thought Storage might be a nice alternative to a process or interprocess variable. The first obstacle is that I can’t add an object from the API response to a shared collection. I found a KB article with a coupl

Re: Collections and Entity Selections Cheat Sheets

2019-05-07 Thread Cannon Smith via 4D_Tech
I made a small update to both cheat sheets, adding the syntax for the new "For each” command. I seem to get it mixed up a lot. :-) Update is here if anyone wants it: -- Cannon.Smith Synergy Farm Solutions Inc. Aetna, AB Canada *

Re: Collections and Entity Selections Cheat Sheets

2019-05-01 Thread Tilman Haerdle via 4D_Tech
istergericht: Amtsgericht Münster · HRB: 5624 · Steuer Nr.: 337/5903/0421 · UstID: DE 204607841 Vectorworks interiorcad - profacto Am 30.04.2019 um 22:48 schrieb Cannon Smith via 4D_Tech <4d_tech@lists.4d.com<mailto:4d_tech@lists.4d.com>>: I’ve been using collections and entity selection

Collections and Entity Selections Cheat Sheets

2019-04-30 Thread Cannon Smith via 4D_Tech
I’ve been using collections and entity selections more lately and notice I spend a lot of time in the docs trying to remember what function does what. Some of them aren’t named very intuitively (at least to me). And I keep forgetting which ones return a deep or shallow copy or use a query

AW: 4D Write PRO: editing a table / collections

2018-07-12 Thread Achim Peschke via 4D_Tech
Auftrag von Two Way Communications via 4D_Tech Gesendet: Donnerstag, 12. Juli 2018 12:44 An: 4D iNug Technical <4d_tech@lists.4d.com> Cc: Two Way Communications Betreff: Re: 4D Write PRO: editing a table / collections Achim, have you tried this yourself? I think it is not possible in 4D Wri

AW: 4D Write PRO: editing a table / collections

2018-07-12 Thread Achim Peschke via 4D_Tech
Communications via 4D_Tech Gesendet: Donnerstag, 12. Juli 2018 12:44 An: 4D iNug Technical <4d_tech@lists.4d.com> Cc: Two Way Communications Betreff: Re: 4D Write PRO: editing a table / collections Achim, have you tried this yourself? I think it is not possible in 4D Write PRO v17 to se

Re: 4D Write PRO: editing a table / collections

2018-07-12 Thread Two Way Communications via 4D_Tech
Achim, have you tried this yourself? I think it is not possible in 4D Write PRO v17 to select 1 or more cells in a table and then be able to get the cells reference by code. Just follow this scenario: - the user creates a table in 4D Write PRO (by clicking a button containing the code WP Inse

AW: 4D Write PRO: editing a table / collections

2018-07-11 Thread Achim Peschke via 4D_Tech
Re: 4D Write PRO: editing a table / collections So, what if the user has created a table (through a method), and now want to select a cell in that table and change it’s background color, or it’s width? How can we do that? Rudy Mortier Two Way Communications bvba > On 11 Jul 2018, at 17:05

Re: 4D Write PRO: editing a table / collections

2018-07-11 Thread Keisuke Miyako via 4D_Tech
a table reference can be obtained from WP Create table range http://doc.4d.com/4Dv17/4D/17/WP-Create-table-range.301-3703205.en.html WP Get elements http://doc.4d.com/4Dv17/4D/17/WP-Get-elements.301-3703212.en.html or WP Get element by ID http://doc.4d.com/4Dv17/4D/17/WP-Get-element-by-ID.301-3

Re: 4D Write PRO: editing a table / collections

2018-07-11 Thread JOHN BAUGHMAN via 4D_Tech
On Jul 10, 2018, at 10:41 PM, Two Way Communications via 4D_Tech <4d_tech@lists.4d.com> wrote: > > You’re right, John. > > When I re-open the document, the table has another reference, and WP SELECT > doesn’t work anymore… > > Is there any other way to get the object reference for a table in a

Re: 4D Write PRO: editing a table / collections

2018-07-11 Thread Two Way Communications via 4D_Tech
new text and set parameters 3 and 4 accordingly. >> >> Achim >> >> >> >> >> -Ursprüngliche Nachricht- >> Von: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] Im Auftrag von Two Way >> Communications via 4D_Tech >> Gesendet: Mittwoch,

AW: 4D Write PRO: editing a table / collections

2018-07-11 Thread Achim Peschke via 4D_Tech
<4d_tech@lists.4d.com> Cc: Two Way Communications Betreff: Re: 4D Write PRO: editing a table / collections Thanks Achim. But what if the cell is not selected, and I want to fill the cells by programming? Rudy Mortier Two Way Communications bvba > On 11 Jul 2018, at 17:00, Achim Pe

Re: 4D Write PRO: editing a table / collections

2018-07-11 Thread Two Way Communications via 4D_Tech
t- > Von: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] Im Auftrag von Two Way > Communications via 4D_Tech > Gesendet: Mittwoch, 11. Juli 2018 16:37 > An: 4D iNug Technical <4d_tech@lists.4d.com> > Cc: Two Way Communications > Betreff: Re: 4D Write PRO: editing a t

AW: 4D Write PRO: editing a table / collections

2018-07-11 Thread Achim Peschke via 4D_Tech
: 4D_Tech [mailto:4d_tech-boun...@lists.4d.com] Im Auftrag von Two Way Communications via 4D_Tech Gesendet: Mittwoch, 11. Juli 2018 16:37 An: 4D iNug Technical <4d_tech@lists.4d.com> Cc: Two Way Communications Betreff: Re: 4D Write PRO: editing a table / collections Thanks Achim! Can I also

Re: 4D Write PRO: editing a table / collections

2018-07-11 Thread Two Way Communications via 4D_Tech
mailto:4d_tech-boun...@lists.4d.com] Im Auftrag von Two Way > Communications via 4D_Tech > Gesendet: Mittwoch, 11. Juli 2018 12:21 > An: 4D iNug Technical <4d_tech@lists.4d.com> > Cc: Two Way Communications > Betreff: Re: 4D Write PRO: editing a table / collections > >

AW: 4D Write PRO: editing a table / collections

2018-07-11 Thread Achim Peschke via 4D_Tech
te PRO: editing a table / collections In v17, we can now get the element id’s, and also select the table objects in a document, so that is definitely an improvement. But, in case there is more than 1 table in the document, I fail to get a reference for the table where the cursor is in… has anyone f

Re: 4D Write PRO: editing a table / collections

2018-07-11 Thread Two Way Communications via 4D_Tech
In v17, we can now get the element id’s, and also select the table objects in a document, so that is definitely an improvement. But, in case there is more than 1 table in the document, I fail to get a reference for the table where the cursor is in… has anyone figured out how to do that? How c

Re: 4D Write PRO: editing a table / collections

2018-07-11 Thread Two Way Communications via 4D_Tech
You’re right, John. When I re-open the document, the table has another reference, and WP SELECT doesn’t work anymore… Is there any other way to get the object reference for a table in a 4D Write PRO document? WP Get selection doesn’t seem to work for table objects: $WPRange:=WP Get selection

Re: 4D Write PRO: editing a table / collections

2018-07-10 Thread Randy Jaynes via 4D_Tech
Another thing we’re struggling with is that we’re building 4D WP documents using code and make tables so that the resulting area can be easily turned into an HTML email. Unfortunately, that makes the Write area awkward for a user to modify. It’s not easy to manipulate the tables (delete/add col

Re: 4D Write PRO: editing a table / collections

2018-07-10 Thread JOHN BAUGHMAN via 4D_Tech
Try putting the collection in a c_object and store the c_object in an c_object field, or put the collection directly into the c_object field I am assuming that $tableObj is the object reference to the table. If tables are anything like images, your plan might not work. Each time a document is

4D Write PRO: editing a table / collections

2018-07-10 Thread Two Way Communications via 4D_Tech
I love the concept of tables in 4D Write Pro. You can only add or change them by code, which is fine by me for the moment. But what to do if a table has been created, and, in the 4D Write Pro document, you would want to add a column, or a row? Or change the width, the borders etc? Apparently th

Re: Collections

2018-03-22 Thread Peter Bozek via 4D_Tech
On Thu, Mar 22, 2018 at 1:16 AM, John DeSoi via 4D_Tech < 4d_tech@lists.4d.com> wrote: > 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 col

Re: Collections

2018-03-22 Thread Keisuke Miyako via 4D_Tech
http://doc.4d.com/4Dv16R4/4D/16-R4/New-collection.301-3342875.en.html > Optionally, you can prefill the new collection by passing one or several > value(s) as parameter(s). > Otherwise, you can add or modify elements subsequently through object > notation assignment. For example: > > myCol[10]:

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

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 exa

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 element

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,

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

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. I

Re: COllections

2018-03-20 Thread Peter Bozek via 4D_Tech
n of object and array. Like array, collection has indexed elements, so if A is collection, you can use A[$i] to access element of collection. Collection, like an object, can be passed to or returned as return parameter of method. There are differences - collections elements are numbered from 0 to l

COllections

2018-03-20 Thread Chip Scheide via 4D_Tech
a record can store any native type of data supported by 4D, and a blob (also available as a record field) can store other types of data such as an array. It seems to me (at this point), that a collection is just a record, perhaps it is more flexible, being definable on the fly, but still a rec

Re: Collections

2018-03-16 Thread Arnaud de Montard via 4D_Tech
> Le 16 mars 2018 à 14:11, Epperlein, Lutz (agendo) via 4D_Tech > <4d_tech@lists.4d.com> a écrit : > > For another reason using collections see this feature request: > http://forums.4d.com/Post/DE/19953344/1/19953345#19954007 see also: <http://forums.4d.com/Pos

AW: Collections

2018-03-16 Thread Epperlein, Lutz (agendo) via 4D_Tech
For another reason using collections see this feature request: http://forums.4d.com/Post/DE/19953344/1/19953345#19954007 Regards Lutz Epperlein Von: 4D_Tech [4d_tech-boun...@lists.4d.com] im Auftrag von Jim Dorrance via 4D_Tech [4d_tech@lists.4d.com

Re: Collections

2018-03-16 Thread Jim Dorrance via 4D_Tech
examples given in the blurb, but I have yet to read > anything that would give me an idea as to why I would want to use a > Collection instead of an Object. > > It seems as though Collections are objects that don’t need a name > parameter to identify the content; but if I have to na

Re: Collections

2018-03-16 Thread Jeff Grann via 4D_Tech
new Collection object available in > upcoming versions. > I’ve read the examples given in the blurb, but I have yet to read anything > that would give me an idea as to why I would want to use a Collection instead > of an Object. > It seems as though Collections are objects that don’t

Re: Collections

2018-03-16 Thread Olivier Deschanels via 4D_Tech
Hello, Objects and Collections are really different. A collection is not an object. During the post-class of the next 4D Summit, for my side in French, or for the JPR side in English, we have the same slide with this sentence in red, bold, 80 points Regards, Olivier > Le 16 m

Re: Collections

2018-03-16 Thread Arnaud de Montard via 4D_Tech
anything > that would give me an idea as to why I would want to use a Collection instead > of an Object. > It seems as though Collections are objects that don’t need a name parameter > to identify the content; but if I have to name a Collection, what’s the > difference between t

Collections

2018-03-15 Thread Keith Goebel via 4D_Tech
Collections are objects that don’t need a name parameter to identify the content; but if I have to name a Collection, what’s the difference between that and an Object item? There must be a very good reason for them, and I am sure I’m missing the point, but what is it?... Cheers, Keith

zero based collections

2017-11-10 Thread John Baughman via 4D_Tech
Now that we are diving head first into c_objects and whatever more that brings to 4D, we must join the rest of the programming world and work with zero based collections such as C_COLLECTION. I work in many other languages so do not have any problem handling zero based collections, but am

Re: Collections in v16R4

2017-07-20 Thread Patrick Emanuel via 4D_Tech
Hi guys, discussions about SDI is very interesting, but the title of this thread is about Collections. May a new thread will be a better place for SDI? ;-) - Patrick EMANUEL Administrator www.association-qualisoft.eu (Soft1002

Re: Collections in v16R4

2017-07-19 Thread Kirk Brooks via 4D_Tech
Yea! Does SDI provide the same flexibility we have on Macs when working with multiple monitors? It's a real pain getting multiple monitors configured to "see" the MDI on more than one at a time. On Wed, Jul 19, 2017 at 2:03 AM, Keisuke Miyako via 4D_Tech < 4d_tech@lists.4d.com> wrote: > you can

Re: Collections in v16R4

2017-07-19 Thread Keisuke Miyako via 4D_Tech
you can open multiple windows using SDI, each with its own menu bar. but many developers who requested SDI support seem to have a single window app in mind. SDI is only available for engined applications. since SDI is not (yet) available in the design environment. for now, you can't quickly "swit

Re: Collections in v16R4

2017-07-19 Thread Paul Dennis via 4D_Tech
I may sound like a Luddite but I like MDI much neater to be able to minimise a whole app in one click or is that possible with SDI ? -- View this message in context: http://4d.1045681.n5.nabble.com/Collections-in-v16R4-tp5753225p5753229.html Sent from the 4D Tech mailing list archive at

Re: Collections in v16R4

2017-07-18 Thread Scott Staley via 4D_Tech
I saw that in the 4D Blog this morning. http://blog.4d.com/new-type-of-variable-collections/ I've not yet come to grips with objects. This seems like something I can get my hands around. I also saw the new SDI mode for windows. My first reaction was... eehhh, its a windows only thing an

Collections in v16R4

2017-07-18 Thread Lee Hinde via 4D_Tech
This is fascinating: http://blog.4d.com/new-type-of-variable-collections/ 1. "Arrays" of random data types. 2. Elements are accessed with [] not {}. E.g MyCollection[8] 3. The first element starts at zero. 4. They have an associated method - length. MyCollection.l