Re: JSON Tools Was: Re: C-objects and memory use

2017-08-17 Thread Rick Hazey via 4D_Tech
First, let me say I wasn’t knocking 4D but answering the question Kirk Brooks asked: "At the risk of appearing really dense what are the specific things you can do with NTK that you can't do with native 4D?”. My answer is that JSON isn’t fully supported and I gave an example, so I’m not sure wh

Re: JSON Tools Was: Re: C-objects and memory use

2017-08-09 Thread Cannon Smith via 4D_Tech
I can! :-) -- Cannon.Smith Synergy Farm Solutions Inc. Hill Spring, AB Canada 403-626-3236 > On Aug 9, 2017, at 1:34 PM, David Adams via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > Sorry, I don't have a Forum link to the right request, bu

Re: JSON Tools Was: Re: C-objects and memory use

2017-08-09 Thread David Adams via 4D_Tech
> So many times in the past, and even still today, 4D will add a now property to > a form object that can only be set by using the Property List in the Design > environment. So no programatic way to “set” or “get” the new property. Glaring > example of this are new listbox properties. Then after so

Re: JSON Tools Was: Re: C-objects and memory use

2017-08-09 Thread Tim Nevels via 4D_Tech
On Aug 9, 2017, at 2:00 PM,David Adams wrote: > Thanks for saying this so clearly. This is the reality that is behind my > feature request(s) for a set of native tools to deal with arbitrary JSON > input/output. For now, I've got NTK but it is a feature set that any modern > tool should have out o

Re: JSON Tools Was: Re: C-objects and memory use

2017-08-08 Thread David Adams via 4D_Tech
On Tue, Aug 8, 2017 at 5:14 PM, Keisuke Miyako via 4D_Tech < 4d_tech@lists.4d.com> wrote: > it seems this view just keeps coming up... > > I am sorry if the documentation or marketing material or presentation or > some other form of communication gave the wrong impression, but Object and > Array

Re: JSON Tools Was: Re: C-objects and memory use

2017-08-08 Thread Keisuke Miyako via 4D_Tech
it seems this view just keeps coming up... I think it is important to understand that 4D didn't look at JSON and implement it as Object and Array Object, doing a really bad job at it, as it were, no, it happened the other way round... Object and Array Object were implemented first, and then JSO

Re: JSON Tools Was: Re: C-objects and memory use

2017-08-08 Thread Kirk Brooks via 4D_Tech
Rick, You have to use the JSON PARSE ARRAY command. http://doc.4d.com/4Dv15/4D/15.4/JSON-PARSE-ARRAY.301-3274446.en.html I wrote a wrapper for JSON strings to look at the first char and then use the appropriate method. This is one place where NTK is more convenient since it makes that adjustment

Re: JSON Tools Was: Re: C-objects and memory use

2017-08-08 Thread Rick Hazey via 4D_Tech
It’s been a long time since I’ve used 4D and JSON but as I recall one problem was the inability to parse JSON where the top level is an array instead of an object. IOW, if your JSON looked like this: [ 1, 2, 3 ] 4D couldn’t parse it. A pretty big deviation from the standard. On the other hand,

Re: JSON Tools Was: Re: C-objects and memory use

2017-08-02 Thread David Adams via 4D_Tech
On Wed, Aug 2, 2017 at 10:51 AM, Jody Bevan via 4D_Tech < 4d_tech@lists.4d.com> wrote: > David: > > Of your four options I choose #1. ;-) > I think that we all do ;-) Short of 4D improving the language & compiler, I think the least-worst option is rolling your own code scanner. Such an effort w

Re: JSON Tools Was: Re: C-objects and memory use

2017-08-02 Thread Jody Bevan via 4D_Tech
David: Of your four options I choose #1. ;-) Jody Bevan ARGUS Productions Inc. Developer Argus Productions Inc. > On Aug 2, 2017, at 11:34 AM, David Adams via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > > Without compile-time verification o

Re: JSON Tools Was: Re: C-objects and memory use

2017-08-02 Thread David Adams via 4D_Tech
All of the new features look great and will be most welcome. I'm on R3 now so R4 should hopefully be an easy transition. For people on 16.1, the new features won't appear until 17.0. Dots will definitely make it easier to work with known element names, so that's great. I haven't looked at JSON Va

Re: JSON Tools Was: Re: C-objects and memory use

2017-08-02 Thread Tom Swenson via 4D_Tech
FWIW, it sounds like the object notation in v16r4 is going to alleviate much of the pain in dealing with JSON objects.. JSON Validate, Collections and a NULL command! http://blog.4d.com/en-whats-new-in-4d-v16-r4/ ** 4D Inte

Re: C-objects and memory use

2017-07-26 Thread David Adams via 4D_Tech
> You've got a point about mixed arrays. 4D doesn't deal with them well. I > couldn't get 4D to let me change longs[2] to an object, for instance, > without loosing the longint values. Yeah, that's taking me back...you can get 4D to coerce anything into text, unless it's an object...in which case

Re: JSON Tools Was: Re: C-objects and memory use

2017-07-26 Thread David Adams via 4D_Tech
On Wed, Jul 26, 2017 at 12:13 PM, Kirk Brooks via 4D_Tech < 4d_tech@lists.4d.com> wrote: > David, > On Wed, Jul 26, 2017 at 10:14 AM, David Adams via 4D_Tech < > 4d_tech@lists.4d.com> wrote: > > Can you give me an example of the kind of situation you're talking about?​ > Incredibly jet-lagged a

Re: C-objects and memory use

2017-07-26 Thread Kirk Brooks via 4D_Tech
David, First off I hadn't seen this when I posted on the other thread so thanks for giving me something specific. On Wed, Jul 26, 2017 at 10:24 AM, David Adams via 4D_Tech < 4d_tech@lists.4d.com> wrote: > Anyway, to your question. Check out JSON libraries in any other language > you like, you'll

Re: C-objects and memory use

2017-07-26 Thread Keith Culotta via 4D_Tech
Sorry, forgot to say v16R3 is required to use NEW OBJECT in the example. Keith - CDI > On Jul 26, 2017, at 3:07 PM, Keith Culotta via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > That's what I see here. Same with passing the object to a new process. So, > not ref-counting, or ref-counting jus

Re: C-objects and memory use

2017-07-26 Thread Keith Culotta via 4D_Tech
That's what I see here. Same with passing the object to a new process. So, not ref-counting, or ref-counting just within a process? The behavior of passing an object to a method called from a form button is slightly different from calling the method's commands directly in the button. It's

Re: JSON Tools Was: Re: C-objects and memory use

2017-07-26 Thread Kirk Brooks via 4D_Tech
David, On Wed, Jul 26, 2017 at 10:14 AM, David Adams via 4D_Tech < 4d_tech@lists.4d.com> wrote: > Hey, I'm fine that 4D does whatever it wants in C_OBJECTs however they want > to. Their program, their rules. What I was responding to was Kirk's point > about JSON per se. If you want to use JSON as

Re: C-objects and memory use

2017-07-26 Thread David Adams via 4D_Tech
On Wed, Jul 26, 2017 at 10:43 AM, Jody Bevan via 4D_Tech < 4d_tech@lists.4d.com> wrote: > I think 4D does put effort into documentation. The manuals are there for each new release (that is a great start). > The BLOGs are great pieces to get introduced to a new feature. I am amazed at the graphics

Re: C-objects and memory use

2017-07-26 Thread Jody Bevan via 4D_Tech
David: You could very well be right. I don’t get to see behind the curtain to have even a hint. It is the same with all aspects of a company. Jonoke became ISO 9001 certified, and we became better each year in communication with our users. Because the person at the top thought these things wer

Re: C-objects and memory use

2017-07-26 Thread David Adams via 4D_Tech
Hey Jody, I think to get the level of docs that we need, or that other tools have, you would need some dedicated tech evangelist/writers on staff and a commitment from management to make it a priority. Back when I was working on my materials for the World Tour (Southern edition), I sent an email t

Re: C-objects and memory use

2017-07-26 Thread David Adams via 4D_Tech
Jeff's question about "why with C_OBJECT but not with BLOBs and pictures" got me thinking a bit. Yeah, fair point. I can see in a language with no pointer-like features why you would work things the way C_OBJECT works. Personally, I like the explicit pointer syntax and find it helpful to be reminde

Re: C-objects and memory use

2017-07-26 Thread David Adams via 4D_Tech
> What can you only do with NTK you can not do with 4D c-objects? ...tired right now...about 16 hours on planes. Whoever said "sleeping like a baby" clearly hadn't met any babies. Anyway, to your question. Check out JSON libraries in any other language you like, you'll see what I'm saying. You can

Re: JSON Tools Was: Re: C-objects and memory use

2017-07-26 Thread David Adams via 4D_Tech
Hey, I'm fine that 4D does whatever it wants in C_OBJECTs however they want to. Their program, their rules. What I was responding to was Kirk's point about JSON per se. If you want to use JSON as an interchange format, we don't have a complete set of tools natively in the 4D language. JSON is norma

Re: C-objects and memory use

2017-07-26 Thread Jody Bevan via 4D_Tech
I understand the documentation issue - I just posted yesterday about a hole in the documentation. Having done a lot of documentation (still doing it), and being the person in charge of all operations I can understand that things fall between the cracks. What would be nice though is that there is

Re: JSON Tools Was: Re: C-objects and memory use

2017-07-26 Thread Peter Bozek via 4D_Tech
On Wed, Jul 26, 2017 at 12:09 PM, Benedict, Tom via 4D_Tech < 4d_tech@lists.4d.com> wrote: > David Adams dpad...@gmail.com writes: > > >Well, 4D's tools for manipulating JSON are sub-standard, if your goal is > to parse/produce JSON freely. In this respect, the XML tools

JSON Tools Was: Re: C-objects and memory use

2017-07-26 Thread Benedict, Tom via 4D_Tech
David Adams dpad...@gmail.com writes: >Well, 4D's tools for manipulating JSON are sub-standard, if your goal is to >parse/produce JSON freely. In this respect, the XML tools (external libraries >built into 4D) are far more standard and comprehensive. Along these lines,

Re: C-objects and memory use

2017-07-25 Thread John DeSoi via 4D_Tech
> On Jul 25, 2017, at 6:02 PM, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > So why not BLOBs? Why not pictures, or text variables? Why does C_OBJECT > flaunt the limited scoping abilities we have in 4D? The only reason I can > think of is because an object can contain reference

Re: C-objects and memory use

2017-07-25 Thread Kirk Brooks via 4D_Tech
On Tue, Jul 25, 2017 at 4:54 PM, David Adams via 4D_Tech < 4d_tech@lists.4d.com> wrote: > Hmmm. Well, 4D's tools for manipulating JSON are sub-standard, if your goal > is to parse/produce JSON freely. In this respect, the XML tools (external > libraries built into 4D) are far more standard and com

Re: C-objects and memory use

2017-07-25 Thread David Adams via 4D_Tech
Kirk, Hmmm. Well, 4D's tools for manipulating JSON are sub-standard, if your goal is to parse/produce JSON freely. In this respect, the XML tools (external libraries built into 4D) are far more standard and comprehensive. The 4D-specific features of C_OBJECT (like pointer resolution and so on) ar

Re: C-objects and memory use

2017-07-25 Thread Kirk Brooks via 4D_Tech
On Tue, Jul 25, 2017 at 4:02 PM, Jeffrey Kain via 4D_Tech < 4d_tech@lists.4d.com> wrote: > So why not BLOBs? Why not pictures, or text variables? Why does C_OBJECT > flaunt the limited scoping abilities we have in 4D? ​ I think it has to do with the c-object being brought about ​from figuring out

Re: C-objects and memory use

2017-07-25 Thread David Adams via 4D_Tech
On Wed, Jul 26, 2017 at 9:02 AM, Jeffrey Kain via 4D_Tech < 4d_tech@lists.4d.com> wrote: > So why not BLOBs? Why not pictures, or text variables? Why does C_OBJECT > flaunt the limited scoping abilities we have in 4D? The only reason I can > think of is because an object can contain references to

Re: C-objects and memory use

2017-07-25 Thread Jeffrey Kain via 4D_Tech
So why not BLOBs? Why not pictures, or text variables? Why does C_OBJECT flaunt the limited scoping abilities we have in 4D? The only reason I can think of is because an object can contain references to other other objects, and it would get really hard to explain what to do with all the parent o

Re: C-objects and memory use

2017-07-25 Thread David Adams via 4D_Tech
One way to think about C_OBJECT is as an "alias." There's a master/single copy somewhere and all other references are nothing but aliases/references. Except when they're not. The OB Copy command is a way of explicitly cloning an existing object so that now you have two distinct copies. Is that pot

Re: C-objects and memory use

2017-07-25 Thread Tom DeMeo via 4D_Tech
FWIW - This does sound like the way javascript objects work. Tom DeMeo ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/op

Re: C-objects and memory use

2017-07-25 Thread Peter Bozek via 4D_Tech
On Tue, Jul 25, 2017 at 9:49 PM, Keith Culotta via 4D_Tech < 4d_tech@lists.4d.com> wrote: > It was mentioned at the introduction of CALL WORKER that not needing > global variables was somehow in the mix. Is C_Object the thing that > enables this? In other words, have a WORKER with a $myGlobals o

Re: C-objects and memory use

2017-07-25 Thread Jody Bevan via 4D_Tech
I would like that objects created in a specific way could be accessed by worker methods. We store so many settings it is somewhat of a pain to not be able to use them like we do everywhere else. I have not tried this ‘feature’ and until it is a documented feature I likely will not try it. From a

Re: C-objects and memory use

2017-07-25 Thread Jeffrey Kain via 4D_Tech
I think I would prefer that C_OBJECTs behave like all other variables. If you pass a C_OBJECT directly, you'll get a copy, or you can make a pointer of it to pass by reference. Maybe nested objects make that impractical. -- Jeffrey Kain jeffrey.k...@gmail.com > On Jul 25, 2017, at 3:32 PM, Kirk

Re: C-objects and memory use

2017-07-25 Thread Jeffrey Kain via 4D_Tech
I never tried crossing the process boundary... -- Jeffrey Kain jeffrey.k...@gmail.com > On Jul 25, 2017, at 3:32 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > Have you tested that changes made in Process B are reflected in > [Table]objectField? **

Re: C-objects and memory use

2017-07-25 Thread Keith Culotta via 4D_Tech
It was mentioned at the introduction of CALL WORKER that not needing global variables was somehow in the mix. Is C_Object the thing that enables this? In other words, have a WORKER with a $myGlobals object. As long as the WORKER is alive, that object is available to all methods. Keith - CDI

Re: C-objects and memory use

2017-07-25 Thread Kirk Brooks via 4D_Tech
Jeff, On Tue, Jul 25, 2017 at 8:53 AM, Jeffrey Kain via 4D_Tech < 4d_tech@lists.4d.com> wrote: > You can start in, say, method A with a line like > > $obj:=[Table]objectField > > ... and pass $obj through any number of methods as a local variable, or a > pointer, or a process object variable. An

Re: C-objects and memory use

2017-07-25 Thread Jody Bevan via 4D_Tech
> On Jul 25, 2017, at 9:53 AM, Jeffrey Kain via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > But I guess the alternative is managing your objects yourself which most > people wouldn't like. Except for some of us oldtimers that are anal. Jody Bevan ARGUS Productions Inc. Developer Argus

Re: C-objects and memory use

2017-07-25 Thread Jeffrey Kain via 4D_Tech
This is correct, and unfortunate. Different people from 4D have even called it a bug, but this is how it is. You can start in, say, method A with a line like $obj:=[Table]objectField ... and pass $obj through any number of methods as a local variable, or a pointer, or a process object variab

Re: C-objects and memory use

2017-07-25 Thread Kirk Brooks via 4D_Tech
Hi Peter, Great reply. You helped my understanding of the way ref-counting functions with respect to c-objects a lot. The concept of the memory heap has only mattered to me peripherally and so ref-counting was a similarly hazy idea. The result of mainly dealing in 4GL languages. Anyway now I get th

Re: C-objects and memory use

2017-07-24 Thread Peter Bozek via 4D_Tech
On Tue, Jul 25, 2017 at 1:41 AM, Kirk Brooks via 4D_Tech < 4d_tech@lists.4d.com> wrote: > I want to make sure my understanding about how c-objects are handled in 4D > memory. Mainly because it seems this understanding is cobbled together from > a number of different sources few of which I can easi

Re: C-objects and memory use

2017-07-24 Thread David Adams via 4D_Tech
Kirk, This is the sort of question that would most likely take someone from 4D Engineering to answer. They don't participate on this list, so I guess that you can try the Forums or open a Tech Support case (?). Please post back here if you get any reliable information as not all of us follow the

C-objects and memory use

2017-07-24 Thread Kirk Brooks via 4D_Tech
I want to make sure my understanding about how c-objects are handled in 4D memory. Mainly because it seems this understanding is cobbled together from a number of different sources few of which I can easily find again. So... 1) c-objects are created within the 3 4D scopes: IP, process or local. 2