Article ID: 139159
Article Last Modified on 2/11/2000
* Builder code to change name of selected text boxes
* to underlying control
x =""
nObjects = 0
*The ASELOBJ() function creates an array referencing the selected
*controls. It also returns the number of selected controls
*Hence, nObjects is the number of selected controls
*aSelobjects is the name of the array created by ASELOBJ()
nObjects = ASELOBJ(aSelobjects)
*The FOR loop cycles through the array of selected controls
IF nObjects > 0
FOR nCnt = 1 TO nObjects
*store the name of the table and field to a variable x
x = ASELOBJECTS(nCnt).ControlSource
*The ATC() function locates the decimal separating the
*table name and field name.
*The SUBSTR() function then extracts the field name
*and resets the control's name to that of the field
ASELOBJECTS(nCnt).Name = SUBSTR(x,ATC('.',x)+1)
NEXT
ENDIF
table.fieldYou could modify the code to rename the controls differently.
Additional query words: VFoxWin wizard
Keywords: kbcode KB139159