The way I pass stuff around between forms/objects is a bit convoluted but works fine. I do this:
1. Create a local cursor populated with the data I want to pass. 2. From that cursor, create a XML string using CURSORTOXML(), (lcXML) 3. The calling object issues DO FORM myform WITH lcXML. 4. The recipient form's Init() converts the XML back into a cursor using XMLTOCURSOR(). 5. You can then do anything else you want with the cursor. The advantage of doing it this way is that it works with COM, (strings are about the only thing that will cross COM boundaries). Not maybe the cleverest way to do it, but it works. Laurie. On 24 November 2015 at 15:16, Fernando D. Bozzo <[email protected]> wrote: > Hi Dave: > > You can always pass the array to a form's method and this method can pass > the array to any internal object. > Only the final target need to acopy() it. > > Form1.passarray(@arr) > *** > Procedure passarray(taArray) > Thisform.internalObject.passarray(@taArray) > *** > Procedure internalObject.passarray(@arr) > Dimension... > Acopy... > El 24/11/2015 2:48 p. m., "Dave Crozier" <[email protected]> escribió: > > > Peter, > > That is exactly how I have done it woth forms Peter. However this is > > passing it into a visually designed object class that sits on the form > > itself. For some reason when the object you are passing in to is a form > > then it all works but if it is another "object" i.e not a form then it > > doesn't > > > > Dave > > > > > > -----Original Message----- > > From: ProFox [mailto:[email protected]] On Behalf Of Peter > Cushing > > Sent: 24 November 2015 13:45 > > To: [email protected] > > Subject: Re: Array passing Suggestions... > > > > Hi Dave, > > > > I have a form call frmpoship and call with > > > > DO FORM frmpoship WITH laDates, ... > > > > in the form INIT is: > > PARAMETERS aShipdates,.... > > > > DIMENSION thisform.aShip[8,9] > > DIMENSION thisform.aShip2[8,9] > > ACOPY(aShipdates,thisform.aShip) > > * make second copy to see if anything has changed > > ACOPY(aShipdates,thisform.aShip2) > > > > The array size is fixed but the acopy should size it anyway. > > aShip is already set up in the form under form/edit property/method, so I > > don't need to add it. It might be this bit that is tripping you up. > > When you have your class open click on class edit property/method and it > > should be at the end of the list, like myarray[1,0] > > > > Presume you just use this.aShip[8,9] etc instead of thisform Also at the > > end (closing the modal form) I just hide the form and check the values of > > the array before releasing it. > > > > Peter > > > > > > On 24/11/2015 13:33, Dave Crozier wrote: > > > Peter, > > > That is fine but it is getting the external array to be recognised > > within the class that is the problem. Once I can do that then the aCopy() > > will work fine. > > > > > > You have said that in one of your forms you pass an array. What do you > > pass it to, I want to pass it to a visually developed class where I can > > then copy it to an array owned by the class and manipulate it > accordingly. > > > > > > I am just going around in circles here at the moment and beginning to > > think that I have missed something really basic. > > > > > > Dave > > > > > > -----Original Message----- > > > From: ProFox [mailto:[email protected]] On Behalf Of Peter > > > Cushing > > > Sent: 24 November 2015 13:29 > > > To: [email protected] > > > Subject: Re: Array passing Suggestions... > > > > > > Dave, > > > > > > When working in a class don't you use this.aArray ? > > > Just checked one of my forms and I pass an array and then use ACOPY > like > > Tracy suggested. > > > I would also set up the array in the class before it is run so you > don't > > have to addproperty etc. > > > > > > HTH > > > > > > > > > Peter Cushing > > > IT Department > > > WHISPERING SMITH > > > > > > > > > On 24/11/2015 13:25, Dave Crozier wrote: > > >> Tracy, > > >> Not of help as you can't Acopy() inside the object because: > > >> 1. if you want to aCopy the Thisform.aArray it doesn't recognise the > > Thisform part of the statement. > > >> > > >> 2. If you do the aCopy before you do the assign to the Object Property > > then you are in the same situation as when you started because the copied > > array gets sent in as only the first element once again and cannot be > > passed in with the @ sign as the destination is a property and not a UDF. > > >> > > >> Racking my brains here to think out a solution or even a work around!! > > >> > > >> I use objects to pass parameters into a udf() or Screen etc. many > times > > but this is the first time I have wanted to pass an array. > > >> > > >> I am now examining using a collection as opposed to an array but to be > > honest I don't really want to go that way, but if all else fails... > > >> > > >> Dave > > >> > > >> > > >> -----Original Message----- > > >> From: ProFox [mailto:[email protected]] On Behalf Of Tracy > > >> Pearson > > >> Sent: 24 November 2015 13:12 > > >> To: ProFox Email List <[email protected]> > > >> Subject: Re: Array passing Suggestions... > > >> > > >> ACopy() comes to mind. > > >> > > >> On November 24, 2015 7:44:54 AM EST, Dave Crozier < > [email protected]> > > wrote: > > >>> I have a class that needs to be sent an array from the calling > program. > > >>> What I want to do is ideally pass the array in as a property and use > > >>> the property _"Assign" method to process the array internally. I > > >>> have tried passing the > > >>> > > >>> Thisform.AddProperty("aArray[2,2]", null) > > >>> > > >>> Thisform.aArray[1,1]= "Item 1" > > >>> Thisform.aArray[1,1]= "Item 1,2" > > >>> ... > > >>> > > >>> > > >>> Class.Property=Thisform.aArray > > >>> > > >>> > > >>> The above coding only results in the first element being passed .... > > >>> as in what is done to a UDF and I have tried passing it with an @ > > >>> sign (as you would with a UDF) at the front but this gives a syntax > > >>> error so no go there. I have also tried calling the Property_Assign > > >>> method direct but using the array with a leading @ sign but the > > >>> mainline doesn't have visibility of the _Assign method so no go > there. > > >>> > > >>> Short of setting up a new Receive_Array() method on the object and > > >>> passing in the array with an @ sign I can't seem to come up with an > > >>> alternative solution and I haven't tested out that you can even do > > >>> this as of yet. > > >>> > > >>> Any ideas guys? > > >>> > > >>> Dave > > >> -- > > >> Sent from my Android device with K-9 Mail. Please excuse my brevity. > > >> [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/camvtr9c2jxosam3viknufabxx72_1_4cz2cubte4tddd3k8...@mail.gmail.com ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

