Re: Collection.orderBy()
I **KNOW** I am going to hate this when I start using collections etc. B vs b ARGH! :) On Fri, 27 Apr 2018 21:39:46 +, Julio Carneiro via 4D_Tech wrote: > > The collection member function is ‘orderBy’, capital B. That’s why you get > a runtime error, because ‘orderby’ does not exist. --- Gas is for washing parts Alcohol is for drinkin' Nitromethane is for racing ** 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: Collection.orderBy()
Thanks Jeff and Julio. Funny, I thought I’d double-checked case, but apparently not well enough! As soon as I changed it from “orderby” to “orderBy” it started working. BTW, I finally turned on object notation in my database and have started using object notation as well as collections directly inside my code. So so nice! Easy to read and use and I’m finding I use a lot less local variables as well. I can’t wait until they get the AST working so the method editor can do checking and better type-ahead as I go! -- Cannon.Smith Synergy Farm Solutions Inc. Hill Spring, AB Canada 403-626-3236 > On Apr 27, 2018, at 3:39 PM, Julio Carneiro via 4D_Tech > <4d_tech@lists.4d.com> wrote: > > If the statement in your code reads exactly as you posted then the error is > in v16r6 syntax checker :-) > > The collection member function is ‘orderBy’, capital B. That’s why you get > a runtime error, because ‘orderby’ does not exist. > > At this point 4D does not manage class typing properly, so compiler does > not know that your object property is a Collection and thus cannot validate > if ‘orderby’ is a valid member function. Hopefully that will be fixed soon. ** 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: Collection.orderBy()
Cannon, If the statement in your code reads exactly as you posted then the error is in v16r6 syntax checker :-) The collection member function is ‘orderBy’, capital B. That’s why you get a runtime error, because ‘orderby’ does not exist. At this point 4D does not manage class typing properly, so compiler does not know that your object property is a Collection and thus cannot validate if ‘orderby’ is a valid member function. Hopefully that will be fixed soon. HTH Julio On Fri, Apr 27, 2018 at 6:26 PM Cannon Smith via 4D_Tech < 4d_tech@lists.4d.com> wrote: > Hi Jeff, > > Yeah, the ending quote must have been converted by my mail app. It’s a > proper quote in code. > > I _think_ the asc should be inside the double quotes. But I’m just going > by the examples found at: > > > http://doc.4d.com/4Dv16R6/4D/16-R6/collectionorderBy.301-3690504.en.html. > > I don’t really know where else to try putting it??? > > -- > Cannon.Smith > Synergy Farm Solutions Inc. > Hill Spring, AB Canada > 403-626-3236 > > > > > > On Apr 27, 2018, at 3:20 PM, Jeffrey Kain via 4D_Tech < > 4d_tech@lists.4d.com> wrote: > > > > Well, you have a curly quote in that line of code - maybe that's just a > mail artifact? > > > > Should the asc be inside the double quotes? > > > > ** > 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 > ** ** 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: Collection.orderBy()
Yep - you're right. I was thinking of the other syntax that uses a constant. Does the debugger give you any clues if you trace it? -- Jeffrey Kain jeffrey.k...@gmail.com > On Apr 27, 2018, at 5:26 PM, Cannon Smith via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > Yeah, the ending quote must have been converted by my mail app. It’s a proper > quote in code. > > I _think_ the asc should be inside the double quotes. But I’m just going by > the examples found at: > > > http://doc.4d.com/4Dv16R6/4D/16-R6/collectionorderBy.301-3690504.en.html. > > I don’t really know where else to try putting it??? ** 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: Collection.orderBy()
Hi Jeff, Yeah, the ending quote must have been converted by my mail app. It’s a proper quote in code. I _think_ the asc should be inside the double quotes. But I’m just going by the examples found at: http://doc.4d.com/4Dv16R6/4D/16-R6/collectionorderBy.301-3690504.en.html. I don’t really know where else to try putting it??? -- Cannon.Smith Synergy Farm Solutions Inc. Hill Spring, AB Canada 403-626-3236 > On Apr 27, 2018, at 3:20 PM, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > Well, you have a curly quote in that line of code - maybe that's just a mail > artifact? > > Should the asc be inside the double quotes? > ** 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: Collection.orderBy()
Well, you have a curly quote in that line of code - maybe that's just a mail artifact? Should the asc be inside the double quotes? -- Jeffrey Kain jeffrey.k...@gmail.com > On Apr 27, 2018, at 5:10 PM, Cannon Smith via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > Has anyone else gotten orderBy to work on collections in v16r6? Can you see > anything obvious I’m doing wrong? ** 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 **
Collection.orderBy()
I’m having trouble with the collection.orderBy() command working. Not sure if it is me or a bug. I’m using 4D v16r6, 64-bit, on macOS with this line of code: $cSortedFrames:=$oPage.frames.orderby("position.zIndex asc”) In the method editor everything colors correctly, including “orderBy” which turns green and is italicized. $cSortedFrames has been declared as a collection and $oPage.frames is also a collection of objects, each one of which has a numeric value at “position.zIndex”. The code also passed a syntax check. But when I actually run the code, I get an error: -10729 Unknown member function. It displays the line of code with the “(“ after orderBy shown in red. Has anyone else gotten orderBy to work on collections in v16r6? Can you see anything obvious I’m doing wrong? Thanks. -- Cannon.Smith Synergy Farm Solutions Inc. Hill Spring, AB Canada 403-626-3236 ** 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 **