Narinder, I just pasted your example into a new db in 17.2 (Mac) and it worked as expected.
I'd suggest dragging the $object var into the debugger pane. Though it worked for me typing in the variable as well. On Fri, Aug 2, 2019 at 9:41 AM Narinder Chandi via 4D_Tech < 4d_tech@lists.4d.com> wrote: > So, I'm in the final phase of a v15 to v17.2 upgrade and > eliminating/replacing all the remaining _o_ prefixed obsolete 4D commands. > I came across some Method Editor behaviour that I totally didn't expect... > btw, this is my very first foray into using C_OBJECT and 4D commands that > return objects! > > Let me illustrate with the following very simple example: > > C_OBJECT($object) > > $object:=Path to object(Get 4D folder) > > Now, when I type $object into the Method Editor, I expected the > auto-completion to show me available object properties such as > parentFolder, name and extension but it didn't. I then modified the code to: > > $object:=New object > $object:=Path to object(Get 4D folder) > > But that didn't yield anything more - I had assumed in the first example > that the 4D command would implicitly initialise the object internally. So, > I have a couple questions a this point: > * for 4D commands that return an object is object initialisation implicit > or must "New object" always be called first? > * is it the case that there is actually no auto-completion for 4D Commands > that return objects? That would be a real disappointment :(( > > Note that I also tested the above in a completely new 4D v17 database just > in case there was something up with a converted database. I also checked > that the auto-complete settings in Preferences were setup correctly - they > are identical in both the converted v17 and new v17 databases. > > I also tested this example: > > C_OBJECT($object1) > C_OBJECT($object2) > > $object1:=New object > $object1:=Path to object(Get 4D folder) > > $object2:=New object > $object2.foo:="foo" > $object2.bar:="bar" > > In this case I get auto-completion of "object1.foo" as well as > "object2.foo" which is really not what I would expect at all! It seems to > me that the Method Editor is wholly indiscriminate about what the > auto-completion options are! > > What gives? Tell me I made a basic mistake somewhere?! > > Regards, > > Narinder Chandi, > ToolBox Systems Ltd. > -- > > > ********************************************************************** > 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 > ********************************************************************** -- Kirk Brooks San Francisco, CA ======================= What can be said, can be said clearly, and what you can’t say, you should shut up about *Wittgenstein and the Computer * ********************************************************************** 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 **********************************************************************