Re: [U2] U2 Dynamic Object API
I extracted a little bit of my code to create a JSON object. This code works on Universe and Unidata. Unidata you will need to switch includes. SUBROUTINE UDOSub(PARAM1,PARAM2,RETURN.ID) * PARAM1 - Field Names separated by field marks * PARAM2 - Data separated by field marks * x8UD $INCLUDE INCLUDE UDO.H; * x8UD $INCLUDE UNIVERSE.INCLUDE UDO.H ; * x8UV rtn = UDOCreate(UDO_OBJECT,udoObj) ; * Create handle IF rtn # 0 THEN RETURN.ID = "~Unable to create UDO object ":rtn ; RETURN MAX.FM = DCOUNT(PARAM1,@FM) FOR X = 1 TO MAX.FM NAME = PARAM1 VALUE = PARAM2 rtn = UDOSetProperty(udoObj, NAME, VALUE); * Load Object IF rtn # 0 THEN RETURN.ID = "~Unable to setProperty ":rtn:" on ":NAME ; RETURN NEXT X rtn = UDOWrite(udoObj, UDOFORMAT_JSON, json); * Write to variable json IF rtn # 0 THEN RETURN.ID = "~Unable to write UDO ":rtn ; RETURN rtn = UDOFree(udoObj) ; * Release memory IF rtn # 0 THEN RETURN.ID = "~Unable to free UDO ":rtn ; RETURN json = CONVERT(CHAR(9):CHAR(10),"",json); * Remove tabs and carriage returns RETURN.ID = "[":json:"]"; * Make it an array END Regards, Doug www.u2logic.com/applications.html ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] U2 Dynamic Object API
Good feedback - Thanks Doug. -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Doug Averch Sent: Tuesday, 29 May 2012 3:10 AM To: U2 Users List Subject: Re: [U2] U2 Dynamic Object API I've been using JSON for many years now. I've written UniBasic code to build JSON in many of our Web applications and our middle-ware. I have written parser in UniBasic that can read JSON arrays and give you results. I was looking very excitedly to not having to maintain my code UniBasic code and have a function that can read and write JSON. I went to U2 University this year. I was at the session that discussed UDO. I had read the documentation several times and was unable to make heads or tails out using this technology. Dan, who taught the session in Denver, had several examples that got me going. However, his examples were very simplistic and did apply to the real world so I still had a lot of work to do. After spending more hours than I care to mention, I have working code. I've time tested my code against the UDO function on Unidata 7.3 and Universe 11.1.9. I found Rocket U2 code is just a touch faster than mine. This did not surprise me in that they could build it into the run engine. The hardest part of UDO is realizing when you write it yourself you can mix objects and arrays without being explicit. Not so with UDO. UDO allows you to mix and match objects and arrays but you must set them up as separate handles. Hopefully that helps, Doug www.u2logic.com/applications.html ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users -- Message protected by DealerGuard: e-mail anti-virus, anti-spam and content filtering. http://www.pentanasolutions.com Click here to report this message as spam: https://login.mailguard.com.au/report/1EPoBdKhQv/4iB9HsdAEDtUq5AZF2iqon/0.204 This email and any attachments to it are confidential. You must not use, disclose or act on the email if you are not the intended recipient. Liability limited by a scheme approved under Professional Standards Legislation. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] U2 Dynamic Object API
All I have seen so far is in the UniData 7.3 new features PDF (see the tinyurl in my original post for a link to the PDF). I'd like to see some worked (and working!) examples at some point. -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Symeon Breen Sent: Tuesday, 29 May 2012 12:33 AM To: 'U2 Users List' Subject: Re: [U2] U2 Dynamic Object API I won't be there - where can I get more information on U2 Dynamic Objects. -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wally Terhune Sent: 28 May 2012 13:51 To: U2 Users List Subject: Re: [U2] U2 Dynamic Object API There is a U2 University session on this - coming up June 26-8 at Carden Park, Cheshire: U2 Dynamic Objects - Hello JSON! Do you want to call a RESTful Web service and quickly deal with the data it brings back? Come learn how to use the new U2 Basic functionality to easily handle web services data in JSON (JavaScript Object Notation) format. Come learn about the interesting features in the new U2 Dynamic Objects (UDO) API in Basic and see how easy it is to consume web services. Wally Terhune Technical Support Architect Rocket Software 4600 South Ulster Street, Suite 1100 **Denver, CO 80237 **USA t: +1 720 475 8055 **e: wterh...@rocketsoftware.com **w: rocketsoftware.com/u2 -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Gregor Scott Sent: Sunday, May 27, 2012 11:41 PM To: U2 Users List Subject: [U2] U2 Dynamic Object API I was just working my way through the patchlist.txt for UV11.1.9, where I encountered an unexpected gem: U2 Dynamic Object API. To quote the full entry in the doc: UNV-5606 Beginning at UniVerse 11.1.9, the U2 Dynamic Object API is introduced as an emerging technology. U2 Dynamic Object API provides an object structure in UniVerse. It is based on JSON (JavaScript Object Notation), a lightweight text-based data interchange format. The details of the API are in Chapter 1 of the UniData 7.3 New Features manual (http://tinyurl.com/6q6hov8). Has anyone worked with this API yet and have any feedback/insights they care to share? Gregor This email and any attachments to it are confidential. You must not use, disclose or act on the email if you are not the intended recipient. Liability limited by a scheme approved under Professional Standards Legislation. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1424 / Virus Database: 2425/5026 - Release Date: 05/27/12 ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users -- Message protected by DealerGuard: e-mail anti-virus, anti-spam and content filtering. http://www.pentanasolutions.com Click here to report this message as spam: https://login.mailguard.com.au/report/1EPlOkoPKJ/5HCE7WfRkGsqA5bUriZYod/0 ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] U2 Dynamic Object API
Ok - so that kinda sounds good, I think ;) . I know where you are coming from, I too have also written heaps of stuff to generate and parse json, tho tbh I would normally do such logic (or certainly the parsing) in a middle tier like a .net webservice layer, and pass back to databasic. Generating json in databasic is very easy, parsing it is the more complex bit. Then again I only realy create json data if I have some javascript that is going to use it, no great point otherwise, except it is more compact than xml, and more complex than csv. -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Doug Averch Sent: 28 May 2012 18:10 To: U2 Users List Subject: Re: [U2] U2 Dynamic Object API I've been using JSON for many years now. I've written UniBasic code to build JSON in many of our Web applications and our middle-ware. I have written parser in UniBasic that can read JSON arrays and give you results. I was looking very excitedly to not having to maintain my code UniBasic code and have a function that can read and write JSON. I went to U2 University this year. I was at the session that discussed UDO. I had read the documentation several times and was unable to make heads or tails out using this technology. Dan, who taught the session in Denver, had several examples that got me going. However, his examples were very simplistic and did apply to the real world so I still had a lot of work to do. After spending more hours than I care to mention, I have working code. I've time tested my code against the UDO function on Unidata 7.3 and Universe 11.1.9. I found Rocket U2 code is just a touch faster than mine. This did not surprise me in that they could build it into the run engine. The hardest part of UDO is realizing when you write it yourself you can mix objects and arrays without being explicit. Not so with UDO. UDO allows you to mix and match objects and arrays but you must set them up as separate handles. Hopefully that helps, Doug www.u2logic.com/applications.html ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1424 / Virus Database: 2425/5026 - Release Date: 05/27/12 ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] Delphi and UniObjects
Hi. By the way, does anyone know an easy way to distinguish if the uniobject session has been opened from Delphi or from VisualBasic? We will like to allow Delphi connection from our App, but avoid connection from VisualBasic. Regards -- Augusto 2012/5/23 Brian Leach > Yes, works fine. I use it for some of my products including mvDeveloper. > > Brian > > -Original Message- > From: u2-users-boun...@listserver.u2ug.org > [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of > charles_shaf...@ntn-bower.com > Sent: 22 May 2012 22:00 > To: U2 Users List > Subject: Re: [U2] U2 accounting software question > > Does anyone know if uniobjects can be used with Delphi? > > Charles Shaffer > Senior Analyst > NTN-Bower Corporation > ___ > U2-Users mailing list > U2-Users@listserver.u2ug.org > http://listserver.u2ug.org/mailman/listinfo/u2-users > > > ___ > U2-Users mailing list > U2-Users@listserver.u2ug.org > http://listserver.u2ug.org/mailman/listinfo/u2-users > ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] U2 Dynamic Object API
I've been using JSON for many years now. I've written UniBasic code to build JSON in many of our Web applications and our middle-ware. I have written parser in UniBasic that can read JSON arrays and give you results. I was looking very excitedly to not having to maintain my code UniBasic code and have a function that can read and write JSON. I went to U2 University this year. I was at the session that discussed UDO. I had read the documentation several times and was unable to make heads or tails out using this technology. Dan, who taught the session in Denver, had several examples that got me going. However, his examples were very simplistic and did apply to the real world so I still had a lot of work to do. After spending more hours than I care to mention, I have working code. I've time tested my code against the UDO function on Unidata 7.3 and Universe 11.1.9. I found Rocket U2 code is just a touch faster than mine. This did not surprise me in that they could build it into the run engine. The hardest part of UDO is realizing when you write it yourself you can mix objects and arrays without being explicit. Not so with UDO. UDO allows you to mix and match objects and arrays but you must set them up as separate handles. Hopefully that helps, Doug www.u2logic.com/applications.html ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] U2 Dynamic Object API
I won't be there - where can I get more information on U2 Dynamic Objects. -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Wally Terhune Sent: 28 May 2012 13:51 To: U2 Users List Subject: Re: [U2] U2 Dynamic Object API There is a U2 University session on this - coming up June 26-8 at Carden Park, Cheshire: U2 Dynamic Objects - Hello JSON! Do you want to call a RESTful Web service and quickly deal with the data it brings back? Come learn how to use the new U2 Basic functionality to easily handle web services data in JSON (JavaScript Object Notation) format. Come learn about the interesting features in the new U2 Dynamic Objects (UDO) API in Basic and see how easy it is to consume web services. Wally Terhune Technical Support Architect Rocket Software 4600 South Ulster Street, Suite 1100 **Denver, CO 80237 **USA t: +1 720 475 8055 **e: wterh...@rocketsoftware.com **w: rocketsoftware.com/u2 -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Gregor Scott Sent: Sunday, May 27, 2012 11:41 PM To: U2 Users List Subject: [U2] U2 Dynamic Object API I was just working my way through the patchlist.txt for UV11.1.9, where I encountered an unexpected gem: U2 Dynamic Object API. To quote the full entry in the doc: UNV-5606 Beginning at UniVerse 11.1.9, the U2 Dynamic Object API is introduced as an emerging technology. U2 Dynamic Object API provides an object structure in UniVerse. It is based on JSON (JavaScript Object Notation), a lightweight text-based data interchange format. The details of the API are in Chapter 1 of the UniData 7.3 New Features manual (http://tinyurl.com/6q6hov8). Has anyone worked with this API yet and have any feedback/insights they care to share? Gregor This email and any attachments to it are confidential. You must not use, disclose or act on the email if you are not the intended recipient. Liability limited by a scheme approved under Professional Standards Legislation. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1424 / Virus Database: 2425/5026 - Release Date: 05/27/12 ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] U2 Dynamic Object API
There is a U2 University session on this - coming up June 26-8 at Carden Park, Cheshire: U2 Dynamic Objects - Hello JSON! Do you want to call a RESTful Web service and quickly deal with the data it brings back? Come learn how to use the new U2 Basic functionality to easily handle web services data in JSON (JavaScript Object Notation) format. Come learn about the interesting features in the new U2 Dynamic Objects (UDO) API in Basic and see how easy it is to consume web services. Wally Terhune Technical Support Architect Rocket Software 4600 South Ulster Street, Suite 1100 **Denver, CO 80237 **USA t: +1 720 475 8055 **e: wterh...@rocketsoftware.com **w: rocketsoftware.com/u2 -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Gregor Scott Sent: Sunday, May 27, 2012 11:41 PM To: U2 Users List Subject: [U2] U2 Dynamic Object API I was just working my way through the patchlist.txt for UV11.1.9, where I encountered an unexpected gem: U2 Dynamic Object API. To quote the full entry in the doc: UNV-5606 Beginning at UniVerse 11.1.9, the U2 Dynamic Object API is introduced as an emerging technology. U2 Dynamic Object API provides an object structure in UniVerse. It is based on JSON (JavaScript Object Notation), a lightweight text-based data interchange format. The details of the API are in Chapter 1 of the UniData 7.3 New Features manual (http://tinyurl.com/6q6hov8). Has anyone worked with this API yet and have any feedback/insights they care to share? Gregor This email and any attachments to it are confidential. You must not use, disclose or act on the email if you are not the intended recipient. Liability limited by a scheme approved under Professional Standards Legislation. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users
Re: [U2] U2 Dynamic Object API
I've been asking for JSON support for some time, this looks like a start but it would have been better to integrate it properly into the UniBasic language than hiding it behind a set of functions like the XDOM, Socket API etc: in this case that just makes it opaque, verbose and hides the structure. Still, if the underlying support is there it could be a job for a pre-compiler. Brian -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Symeon Breen Sent: 28 May 2012 10:49 To: 'U2 Users List' Subject: Re: [U2] U2 Dynamic Object API It sounds great but I have not seen anything further on it. Would be good to get some more info... -Original Message- From: u2-users-boun...@listserver.u2ug.org [mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Gregor Scott Sent: 28 May 2012 06:41 To: U2 Users List Subject: [U2] U2 Dynamic Object API I was just working my way through the patchlist.txt for UV11.1.9, where I encountered an unexpected gem: U2 Dynamic Object API. To quote the full entry in the doc: UNV-5606 Beginning at UniVerse 11.1.9, the U2 Dynamic Object API is introduced as an emerging technology. U2 Dynamic Object API provides an object structure in UniVerse. It is based on JSON (JavaScript Object Notation), a lightweight text-based data interchange format. The details of the API are in Chapter 1 of the UniData 7.3 New Features manual (http://tinyurl.com/6q6hov8). Has anyone worked with this API yet and have any feedback/insights they care to share? Gregor This email and any attachments to it are confidential. You must not use, disclose or act on the email if you are not the intended recipient. Liability limited by a scheme approved under Professional Standards Legislation. ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users - No virus found in this message. Checked by AVG - www.avg.com Version: 10.0.1424 / Virus Database: 2425/5025 - Release Date: 05/27/12 ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users ___ U2-Users mailing list U2-Users@listserver.u2ug.org http://listserver.u2ug.org/mailman/listinfo/u2-users