Evento OnClick en un control label, (array)

HMG en Español

Moderator: Rathinagiri

Post Reply
jparada
Posts: 430
Joined: Fri Jan 23, 2009 5:18 pm

Evento OnClick en un control label, (array)

Post by jparada »

Hola,

Sigo tratando de hacer "algo", con el tema de las validaciones, el siguiente código me genera un error de:
Error de Rango: Acceso al array, pero es en la línea de ONCLICK donde está el problema, lo muestro como estoy tratando de hacer.

Code: Select all

FOR i:=1 TO LEN( aWarnings )
     ValCtrl := GetProperty( "frmAddArticulo", aWarnings[i], "VALUE" )
    IF EMPTY( ValCtrl ) 
	cCtrl2 := "lblDesc" + ALLTRIM(STR(i))
				
	nRowFrm += 20
	DEFINE LABEL &cCtrl2 
		ROW	nRowFrm 
		COL	100
		WIDTH 350
		HEIGHT 20
		VALUE ( aCampos[i] +  " de artículo, no debe quedar vacío" )
		ONCLICK  { DoMethod( "frmAddArticulo", aWarnings[i], "SETFOCUS" ), frmWarning.RELEASE }
	END LABEL			
    ENDIF
NEXT
Agradezco si alguien me puede dar un tip como cambiar la línea del error, por alguna que funcione bien y que haga la función, ó mejor aún alguien más experimentado que me comente por favor, si es posible hacer esto que necesito.

Gracias

Saludos
jparada
Posts: 430
Joined: Fri Jan 23, 2009 5:18 pm

Re: Evento OnClick en un control label, (array)

Post by jparada »

Ahhhh, después de casi un día de prueba y error, he conseguido la funcionalidad que yo quiero, no como lo estaba planteando en mi ejemplo, sino con otro "truco".

Saludos
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: Evento OnClick en un control label, (array)

Post by Rathinagiri »

Oh! Nice. :)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
dtoledo
Posts: 5
Joined: Thu Jul 22, 2010 2:07 am
Location: Santiago de Chile

Re: Evento OnClick en un control label, (array)

Post by dtoledo »

Hola:

Me alegro que hayas encontrado una solucion.
En todo caso pude notar que tu problema fue olvidar las 'barras' al definir tu codeblock
Tu tienes:

ONCLICK { DoMethod( "frmAddArticulo", aWarnings, "SETFOCUS" ), frmWarning.RELEASE }

y creo que deberia ser:

ONCLICK { || DoMethod( "frmAddArticulo", aWarnings, "SETFOCUS" ),frmWarning.RELEASE }


Saludos desde Chile
DAGO
jparada
Posts: 430
Joined: Fri Jan 23, 2009 5:18 pm

Re: Evento OnClick en un control label, (array)

Post by jparada »

Hola Dago,

La verdad eso de las barras no lo había notado, pero al parecer es completamente indiferente, mi "problemita", fué otro.

Saludos
Post Reply