Paul,
Just as a digression, why would you want to use plain array as opposed to a
property of a custom object as one such property could actually be the
array? 

I find that ysing the custom object method really does allow a greater
degree of flexibility as named parameteres can actually be used as opposed
to parameters which are referenced by way of their array dimension.
Certainly changing the order/dimension of an array can involve you with a
great deal of recoding which is never a good thing.

I have retrofitted custom objects now to all my older forms which previously
used arrays and I'm glad of the ease in which I can now add/change parameter
names at will with minimum coding effort.

I must admit though that I've never used collections as parameters due to
the fact that I've never really looked into them in any detail I guess, but
they would seem to be useful in the same way as custom objects.

Just interested in your reasoning here.

Dave Crozier
 The secret to staying young is to live honestly, eat slowly, and to lie
about your age 

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Paul Newton
Sent: 01 November 2006 10:13
To: ProFox
Subject: Returning one (or more) values from a form, including arrnys -
non-OOP

Hi all

This is in reaction (response is perhaps not quite the right term) to
solving the problem of returning an array from a form without the use of
custom objects.  It should work from anywhere (including calling the form
from the command window).  Reading previous threads (which have often
digressed and talked about OO approaches when a non-OO solution was being
sought), did not clarify the issue for me and it does not appear to be as
simple as whether the array is passed by reference or not.  So here is what
*works*.  It also demonstrates how to return more than one value from a
form.

In command window (or anywhere else)

DIME myArray(1)   && myArray (see below) MUST be an array if you want an 
array returned
MyVar = "" && Can be any data type you like

DO FORM frmMyForm WITH "myArray","MyVar"   && second parameter is optional

frmMyForm.Init   && frmMyForm has properties cParam1 and cParam2

PARAMETERS tcArrayName, tcParam2

THIS.cParam1 = tcArrayName
THIS.cParam2 = tcParam2

frmMyForm.Unload

*- The next line is where it is important that the value passed as a
parameter ("myArray") represents an existing array
ACOPY(THIS.aFiles,(THIS.cParam1))   && Example only - Unload method 
could create a local array and ACOPY that instead

*- In the next line it is *not* critical that the value stored to the
variable is of the same type as stored in the original variable STORE "This
is a test" TO (THIS.cParam2)
*- STORE 9 TO (THIS.cParam2)
*- STORE DATE() TO (THIS.cParam2)

RETURN


HTH somebody in the future

Comments welcome





[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** 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.

Reply via email to