Re: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-31 Thread Kirk Brooks via 4D_Tech
Er - "I wasn't aware the error handler would get tripped by line 14" is what I meant to type. On Tue, Oct 31, 2017 at 5:09 PM, Kirk Brooks wrote: > I wan't aware that the error handler would get tripped by that though. > -- Kirk Brooks San Francisco, CA

Re: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-31 Thread Tim Nevels via 4D_Tech
On Oct 31, 2017, at 2:00 PM, Koen Van Hooreweghe wrote: > I’ve been bitten by this a while ago. There is a difference in behavior > interpreted and compiled. Eg following piece of code: > > 1 C_OBJECT($obj) > 2 C_TEXT($text) > 3 C_LONGINT($long) > 4 > 5 OB SET($obj;"property";"value”) > 6 > 7

Re: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-31 Thread Koen Van Hooreweghe via 4D_Tech
Hi Tim, I’ve been bitten by this a while ago. There is a difference in behavior interpreted and compiled. Eg following piece of code: 1 C_OBJECT($obj) 2 C_TEXT($text) 3 C_LONGINT($long) 4 5 OB SET($obj;"property";"value”) 6 7 $text:=OB Get($obj;"nonexistent") 8 $text:=OB

Re: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-30 Thread Kirk Brooks via 4D_Tech
Hey Tim, Good point. I thought it might be an issue between 32 and 64 but I think I was just conflating the effect when dealing with other data types. ie. C_LONGINT($i) C_OBJECT($obj) $t:=OB Get($obj;"key") // no error $i:=OB Get($obj;"key") // ** error $i:=OB Get($obj;"key";Is longint) //

Re: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-30 Thread Tim Nevels via 4D_Tech
On Oct 30, 2017, at 2:00 PM, Kirk Brooks wrote: > I've taken to always specifying the type when I use OB GET except in cases > like copying a key from one object to another. I like that OB GET doesn't > throw an error when it's typed and the key doesn't exist. Hi Kirk, I did not know that if

Re: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-30 Thread Koen Van Hooreweghe via 4D_Tech
Hi Kirk, Thanks for the info. I also think this is not a huge task to get the changed data back into 4D, but or the time being I don’t need this feature. So I haven’t tried it yet. Kind regards, Koen > Op 30 okt. 2017, om 16:50 heeft Kirk Brooks via 4D_Tech > <4d_tech@lists.4d.com> het

Re: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-30 Thread Kirk Brooks via 4D_Tech
Miyako, I've taken to always specifying the type when I use OB GET except in cases like copying a key from one object to another. I like that OB GET doesn't throw an error when it's typed and the key doesn't exist. It would be interesting to hear about how they are able to parse mixed type json

Re: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-30 Thread Kirk Brooks via 4D_Tech
Koen, I like that one. I wouldn't think it would be very difficult to get the data back into 4D. You could 'push' it with js using the 4D callback approach Tim Penner writes about here: http://kb.4d.com/assetid=77177. I've really found that useful. On Mon, Oct 30, 2017 at 7:46 AM, Koen Van

Re: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-30 Thread Kirk Brooks via 4D_Tech
Hi Ortwin, Nicely done. In this case I want to be able to view and edit the json easily. This is a developer tool I'm building but the solution is really all hierarchical list based. The key for me is being able to edit the json value without messing with the key. This is where I discovered the

Re: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-30 Thread Koen Van Hooreweghe via 4D_Tech
Hi Kirk, Same idea as Jeff. But I'm using jsoneditor (https://github.com/josdejong/jsoneditor ) in a web area to display objects. Its an editor, but I have only used it to display an objects content. Haven’t tried to get the modified data back to 4D.

Re: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-30 Thread Ortwin Zillgen via 4D_Tech
some reading Regards O r t w i n Z i l l g e n - member of developer-network

Re: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-29 Thread Kirk Brooks via 4D_Tech
To follow up a little bit - After working with the above code I'm starting to really like it. First a correction, where it says " $subList:=New list" change it to " $subList:=0". As soon as the next line is executed $sublist gets assigned a new list anyway and this is a memory leak. The other

Re: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-29 Thread Keisuke Miyako via 4D_Tech
I think that's because the assignment operator is typically over-ridden by a toString() method or something similar in template or class based languages. anyway, 4D is a strongly typed language, so the use of the 3rd argument "Is text" does not remove the need to declare the left operand. if

Re: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-29 Thread Kirk Brooks via 4D_Tech
Hi folks, Here's a native 4D solution. This is something I just roughed out so consider it a starting point for your own work. I noticed, and take advantage of, a couple of interesting aspects of how 4D handles c-objects. 1) OB GET($obj;"some key"; Is text) will almost always return the

Re: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-29 Thread Jeffrey Kain via 4D_Tech
I thought it was clever too. That’s why we like hiring the young’ns... 1. Create a form named JSON_Viewer that has: - a system web area with On Load enabled - a button labeled “Save as JSON” with On Clicked enabled 2. Create two project methods: - JSON_Display - JSON_Display_Initialize

Re: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-29 Thread Kirk Brooks via 4D_Tech
Jeff, Nice idea. I'd appreciate a look. On Sun, Oct 29, 2017 at 2:37 PM, Jeffrey Kain via 4D_Tech < 4d_tech@lists.4d.com> wrote: > We built one using a couple of JavaScript files and a CSS file that opens > in a web area. Read-only of course, but interactive and > collapsible/expandable. > > Let

Re: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-29 Thread David Adams via 4D_Tech
Jeff, Now that's a smart idea. I'm interested. ** 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/options/4d_tech Unsub:

Re: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-29 Thread Jeffrey Kain via 4D_Tech
We built one using a couple of JavaScript files and a CSS file that opens in a web area. Read-only of course, but interactive and collapsible/expandable. Let me know if you’re interested and I’ll post it here. > On Oct 29, 2017, at 5:26 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> >

Re: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-29 Thread Kirk Brooks via 4D_Tech
Jeff, Just display a c-obj in a hierarchical list. I want to mimic the way the debugger shows c-objects. On Sun, Oct 29, 2017 at 11:03 AM, Jeffrey Kain via 4D_Tech < 4d_tech@lists.4d.com> wrote: > What are you trying to do? > > > On Oct 29, 2017, at 1:38 PM, Kirk Brooks via 4D_Tech < >

Re: Method to put a c-obj (or JSON) into a hierarchical list

2017-10-29 Thread Jeffrey Kain via 4D_Tech
What are you trying to do? > On Oct 29, 2017, at 1:38 PM, Kirk Brooks via 4D_Tech <4d_tech@lists.4d.com> > wrote: > > I thought I had such a method but it seems I don't. Before I re-invent this > particular wheel does anyone have this already and are willing to share?

Method to put a c-obj (or JSON) into a hierarchical list

2017-10-29 Thread Kirk Brooks via 4D_Tech
I thought I had such a method but it seems I don't. Before I re-invent this particular wheel does anyone have this already and are willing to share? Thanks -- Kirk Brooks San Francisco, CA === *The only thing necessary for the triumph of evil is for good men to do nothing.*