In PHP you can't. If you extract something with Field(n) it appears the whole record goes to the other unidynarray. You still have to use Field(a)->Field(v)->... to get to a specific something even after the assignment. THAT is my biggest beef with this, but fortunately the explode solution works; otherwise I wouldn't even consider recommending PHP with UO.
On Fri, Jul 31, 2009 at 1:09 PM, Jeff Powell <[email protected]> wrote: > Kevin, > > You can extract to another unidynarray and then work through the values > locally. > > > > > Kevin King wrote: > >> Question to those who have used the UOJ connector... Is "extract" as >> stupid >> in Java as it is in PHP? With PHP you can't use this to extract an >> attribute to a local variable and then loop through the mv's like you >> would >> in BASIC. Every freakin' routine that wants to get a multivalue has to >> use >> Field(n) to get the attribute number first, then Field(m) for the value, >> and >> that's a RPITA. >> >> I've taken to parsing delimiters and using explode() in PHP to break >> things >> up by delimiter and convert the entire dynamic array to a first class PHP >> array; otherwise everything just gets too long and ugly. Does UOJ have >> this >> kind of thing as well? >> >> On Fri, Jul 31, 2009 at 12:06 PM, John Hester <[email protected]> wrote: >> >> >> >>> -----Original Message----- >>>> From: [email protected] >>>> [mailto:[email protected]] On Behalf Of >>>> Brutzman, Bill >>>> Sent: Thursday, July 30, 2009 2:59 PM >>>> To: U2 Users List >>>> Subject: Re: [U2] PHP vs Java >>>> >>>> >>>> Thanks to Kevin and Ross for responding. >>>> >>>> I was surprised to learn that Java does not have built-in >>>> functionality >>>> to support dynamic arrays although a little method can be written to >>>> handle it. >>>> >>>> The battle inside my head continues... >>>> >>>> --B >>>> >>>> >>> The UOJ UniDynArray object and methods will let you pass dynamic arrays >>> between Java applications and UniBASIC programs as a subroutine >>> argument, but you can also use them independently of any U2 subroutine >>> calls. We use them extensively. They have essentially the same >>> functionality in Java as in UniBASIC. From the UOJ manual: >>> >>> The following table describes the UniDynArray methods. >>> Primary Methods >>> count ( ) >>> dcount ( ) >>> delete ( ) >>> extract ( ) >>> insert ( ) >>> length ( ) >>> remove ( ) >>> replace ( ) >>> toString ( ) >>> >>> Just include the UOJ asjava.zip library in your application. >>> >>> -John >>> _______________________________________________ >>> U2-Users mailing list >>> [email protected] >>> http://listserver.u2ug.org/mailman/listinfo/u2-users >>> >>> >>> >> >> >> >> >> > _______________________________________________ > U2-Users mailing list > [email protected] > http://listserver.u2ug.org/mailman/listinfo/u2-users > -- -Kevin http://www.PrecisOnline.com _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users
