I think there is a bit of clearing up required.
I don't think you are asking the correct question and/or
leaving out some pertinent details vis-a-vis your problem.
Are you saying you want to create control method calls via the arrays?
If so, there are a number of ways to accomplish this and
normally they are driven with temporary or permanent
cursors, but arrays will work just as well. And as might
be expected; if what I ask is accurate; you need to
generate the appropriate code to access the controls
'on the fly'.
Bottom line is - you need to know the names of the controls
on the form(s) in order to manipulate them and as implied
in the above this can be determined at run-time without
knowing in advance the control names. This is the case
regardless of whether they are hard- coded, driven by a
table, or driven by an array.
A couple of questions:
Is there a line in the program that invokes a form?
i.e. Do form formxyx
(where formxyz is an argument to the do form command)
-Or-
Is the form being created programmatically?
i.e. Something like the following:
define class formxyz as form
* a bunch of code here
enddefine
As stated, you'll need to provide some additional info.
You can determine the controls on the form(s) at
run-time with something like the following code, but I
think we are still unclear as to what your actual problem
is.
Also, you can modify the following to just return the
controls on the form under investigation.
Darrell
* This will create a series of arrays which contain
* the control names of the controls on all active
* forms. Note: This will not list the controls in
* container classes. There are more effiecient
* ways of accomplishing this, but this should suffice
* for simple cases
LOCAL ARRAY laForms[1]
LOCAL loForm, lcMac, i, j
FOR i = 1 TO _SCREEN.FORMCOUNT
loForm = _SCREEN.FORMS(i)
WITH loForm
DIME laForms[ i ]
laForms[ i ] = loForm.NAME
lcMac = "local array la"+laForms[ i ]+"["+STR(loForm.controlcount)+"]"
&lcMac
FOR j = 1 TO loForm.CONTROLCOUNT
lcMac = "la" + loForm.NAME + "[" +STR(j) +"] = loForm.controls("+STR(j)+ "

.name"
&lcMac
NEXT
ENDWITH
NEXT
susp
'We all must do the hard bits so when we get bit we know where to bite'
