Information générale
Catégorie:
Programmation Orientée Object
a="THISFORM.xText"+alltrim(transform(xCount))
&a..value=xCount
should works
Franco
>Hi all.
>I have a form with 47 fields
>I have a loop that performs some calculations 47 times and need to display the results in every one of the fields sequentially.
>Is there some way to substitute the "THISFORM.ObjectName" with a variable that increases +1 in each pass?
>My text fields are named Text1 through Text47.
>So I tried something like this (abreviated here):
>
>xCount=1
>DO WHILE xCount<48
>xText="Text"+(alltrim(str(xcount)))
>THISFORM.xText.value=xCount
>xCount=xCount+1
>ENDDO
>
>I got (obviously) an error message when reaching the THISFORM line about not finding the xText element.
>
>Is there a possible way around this or will I have to repeat the code for each one of the fields?
>TIA for your time
>
>Ulises
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement