Page 1 of 1

Iterate through a FORM's controls programmatically

Posted: Thu Mar 10, 2022 8:05 pm
by Red2
Hello All,

Question:
How can I programmatically iterate through a running FORM's controls?

I need to pick out those controls whose TYPE is "RADIOGROUP".
Unfortunately I cannot manage to find these.

(Google Spanish)
Pregunta:
¿Cómo puedo iterar programáticamente a través de los controles de un FORM's en ejecución?

Necesito seleccionar aquellos controles cuyo TYPE sea "RADIOGROUP".
Desafortunadamente no puedo lograr encontrar estos.

Thank you,
Red2

Re: Iterate through a FORM's controls programmatically

Posted: Thu Mar 10, 2022 8:31 pm
by andyglezl
Maybe ...

Code: Select all

#xtranslate _aCtrolNames       	=> _HMG_SYSDATA\[2\]
#xtranslate _aCtrolType        	=> _HMG_SYSDATA\[1\]

FUNCTION MAIN()


FOR i1 = 1 TO HMG_LEN( _aCtrolNames )
	IF _aCtrolType[ i1 ] == "RADIOGROUP"
		..........
	ENDIF
NEXT

Re: Iterate through a FORM's controls programmatically

Posted: Thu Mar 10, 2022 9:29 pm
by Red2
Hello andyglezl,

¡Gracias por su pronta respuesta!
Sí, su ejemplo de código funciona bien para mi tarea.
Realmente aprecio su generosa ayuda!

English
Thank you for your prompt reply!
Yes, your code example works well for my task.
I really appreciate your generous help!

Gracias de nuevo,
Red2