FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Dudas con Harbour en cl谩usula VALID (SOLUCIONADO)
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Dudas con Harbour en cl谩usula VALID (SOLUCIONADO)
Posted: Sun Feb 08, 2015 05:57 PM
Antonio:

Con el siguiente c贸digo, con un GET y una funci贸n de Validaci贸n del GET.
Code (fw): Select all Collapse
聽 聽 聽 聽 聽 聽 REDEFINE GET aGets[02] VAR nPer ID 102 OF oDlg UPDATE;
聽 聽 聽 聽 聽 聽 聽 聽 BITMAP "Bus16";
聽 聽 聽 聽 聽 聽 聽 聽 ACTION nPer := BrwPer(oDlg);
聽 聽 聽 聽 聽 聽 聽 聽 VALID ValPer(oDlg,oBrw,aGets,aSays);
聽 聽 聽 聽 聽 聽 聽 聽 PICTURE "99";
聽 聽 聽 聽 聽 聽 聽 聽 MESSAGE "Periodo de n贸mina"

STATIC FUNCTION ValPer(oDlg,oBrw,aGets,aSays)
聽 聽 MsgInfo("Devolviendo (.F.)")
RETURN(.F.)


Se queda en un loop entre el GET y la funci贸n ValPer mostrando el Mensaje
"Devolviendo (.F.)", pero si la funci贸n ValPer regresa (.T.) no se queda en el loop.

Si no entiendo mal cuando la funci贸n de validaci贸n (ValPer) regresa (.T.) debe permitir salir
del GET y eso funciona bien, pero cuando la validaci贸n regresa (.F.) no sale del get y eso es
correcto pero se queda en un loop entre el GET y la funci贸n ValPer mostrando siempre el
mensaje "Devolviendo (.F.)", y debo cancelar el proceso con el administrador de tareas.

Uso FWH1312, Harbour y BCC582.

Alguna pista que no he tomado en cuenta?

Saludos
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Dudas con Harbour en cl谩usula VALID
Posted: Mon Feb 09, 2015 04:34 PM

Arriba

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: Dudas con Harbour en cl谩usula VALID
Posted: Mon Feb 09, 2015 04:51 PM

Cuantos GETs hay en el dialogo? Tien la clausula CANCEL en BUTTON?

Saludos.

Jo茫o Santos - S茫o Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 2064
Joined: Fri Jan 06, 2006 09:28 PM
Re: Dudas con Harbour en cl谩usula VALID
Posted: Mon Feb 09, 2015 04:57 PM

Intenta asi VALID IIF( !ValPer(oDlg,oBrw,aGets,aSays), (alert("es falso"), .f.), (alert("es verdadero"), .t.) ), haber si te da el mismo problema, no deberia quedarse en el loop, saludos... :shock:

Dios no est谩 muerto...



Gracias a mi Dios ante todo!
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
Re: Dudas con Harbour en cl谩usula VALID
Posted: Mon Feb 09, 2015 05:19 PM
Karinha:

Gracias por tu respuesta!

Es un Dialog dentro de un Window (MdiChild) con solo dos Gets y un xBrowse, no hay buttons.

Saludos

Jos茅 Luis:

Tambi茅n gracias por tu respuesta, el problema sigue a煤n con tu sugerencia.

Saludos

Amigos:

Gracias a sus aportaciones he encontrado al culpable del loop.

Code (fw): Select all Collapse
聽 聽 DEFINE FONT oFont NAME "MS Sans Serif" SIZE 0,-10
聽 聽 DEFINE FONT oFont1 NAME "Arial" SIZE 0,-18
聽 聽 DEFINE ICON oIcono RESOURCE "AppLogo"
聽 聽 DEFINE WINDOW oWnd MDICHILD OF oWindow FROM 0,0 TO 10,10;
聽 聽 聽 聽 TITLE "Caracter铆sticas de la n贸mina" ICON oIcono

//聽 聽 聽 oWnd:bGotFocus 聽= { || oBrw:SetFocus() } Esta l铆nea es la culpable, coment谩ndola adi贸s loop, la maldita "ceguera de taller"

聽 聽 聽 聽 DEFINE DIALOG oDlg RESOURCE "BrwCar" OF oWnd FONT oFont ICON oIcono

聽 聽 聽 聽 聽 聽 REDEFINE COMBOBOX aGets[01] VAR nTip ID 101 OF oDlg UPDATE;
聽 聽 聽 聽 聽 聽 聽 聽 PICTURE "@9K";
聽 聽 聽 聽 聽 聽 聽 聽 PROMPTS acTip;
聽 聽 聽 聽 聽 聽 聽 聽 ON CHANGE LimCar(oDlg,oBrw,aGets,aSays);
聽 聽 聽 聽 聽 聽 聽 聽 MESSAGE "Elija el tipo de n贸mina"

聽 聽 聽 聽 聽 聽 REDEFINE GET aGets[02] VAR nPer ID 102 OF oDlg UPDATE;
聽 聽 聽 聽 聽 聽 聽 聽 BITMAP "Bus16";
聽 聽 聽 聽 聽 聽 聽 聽 ACTION nPer := BrwPer(oDlg);
聽 聽 聽 聽 聽 聽 聽 聽 VALID ValPer(oDlg,oBrw,aGets,aSays);
聽 聽 聽 聽 聽 聽 聽 聽 PICTURE "99";
聽 聽 聽 聽 聽 聽 聽 聽 MESSAGE "Periodo de n贸mina"


聽 聽 聽 聽 聽 聽 REDEFINE SAY aSays[01] VAR cFechas ID 103 OF oDlg FONT oFont1 UPDATE

聽 聽 聽 聽 聽 聽 oBrw:=TxBrowse():New(oDlg)

聽 聽 聽 聽 聽 聽 oBrw:nMarqueeStyle聽 聽 聽 聽 聽 := MARQSTYLE_HIGHLROW聽 聽聽 聽 // Con cursor de todo el rengl贸n
聽 聽 聽 聽 聽 聽 oBrw:nColDividerStyle聽 聽聽 聽 := LINESTYLE_LIGHTGRAY
聽 聽 聽 聽 聽 聽 oBrw:nRowDividerStyle聽 聽聽 聽 := LINESTYLE_LIGHTGRAY
聽 聽 聽 聽 聽 聽 oBrw:lColDividerComplete聽 聽 := (.F.)聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 // (.T.) Matiene siempre llena la pantalla
聽 聽 聽 聽 聽 聽 oBrw:nHeaderHeight聽 聽 聽 聽 聽 := 25聽 聽聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 // Altura de los encabezados
聽 聽 聽 聽 聽 聽 oBrw:nRowHeight聽聽 聽 聽 聽 聽 聽 := 22聽 聽聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 // Altura del rengl贸n
聽 聽 聽 聽 聽 聽 oBrw:nHeaderLines聽 聽聽 聽 聽 聽 聽 聽 := 1聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 // N煤mero de l铆neas de encabezados
聽 聽 聽 聽 聽 聽 oBrw:nDataLines聽聽 聽 聽 聽 聽 聽 := 1聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 // N煤mero de l铆neas de detalle
聽 聽 聽 聽 聽 聽 oBrw:nFooterHeight聽 聽 聽 聽 聽 := 20聽 聽聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 // Altura del footer
聽 聽 聽 聽 聽 聽 oBrw:nFooterLines聽 聽聽 聽 聽 聽 聽 聽 := 1聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 // N煤mero de l铆neas en el footer
聽 聽 聽 聽 聽 聽 oBrw:lFastEdit聽 聽 聽 聽 聽 聽 聽 聽 聽 := (.T.)聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 // Edici贸n por celdas
聽 聽 聽 聽 聽 聽 oBrw:lFooter聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 := (.T.)聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 // S铆 queremos l铆nea de footer
聽 聽 聽 聽 聽 聽 oBrw:lHScroll聽 聽聽 聽 聽 聽 聽 聽 聽 聽 := (.F.)聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 // Quitamos el scroll horizontal

聽 聽 聽 聽 聽 聽aCol[ 1]聽聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 := oBrw:AddCol()
聽 聽 聽 聽 聽 聽 aCol[ 1]:bStrData 聽聽聽 聽 聽 聽 := { || IF(oRsCar:BOF() .AND. oRsCar:EOF(),SPACE(1),TRANSFORM(oRsCar:Fields("CAR_CON"):Value,"@Z 999"))}
聽 聽 聽 聽 聽 聽 aCol[ 1]:cHeader 聽聽 聽 聽 聽 聽 := "Concepto"
聽 聽 聽 聽 聽 聽 aCol[ 1]:nHeadStrAlign聽 聽 聽 := AL_RIGHT
聽 聽 聽 聽 聽 聽 aCol[ 1]:nDataStrAlign聽 聽 聽 := AL_RIGHT
聽 聽 聽 聽 聽 聽 aCol[ 1]:nWidth聽聽 聽 聽 聽 聽 聽 := 55

聽 聽 聽 聽 聽 聽aCol[ 2]聽聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 := oBrw:AddCol()
聽 聽 聽 聽 聽 聽 aCol[ 2]:bStrData 聽聽聽 聽 聽 聽 := { || IF(oRsCar:BOF() .AND. oRsCar:EOF(),SPACE(1),oRsCar:Fields("CON_DES"):Value)}
聽 聽 聽 聽 聽 聽 aCol[ 2]:cHeader 聽聽 聽 聽 聽 聽 := "Descripci贸n"
聽 聽 聽 聽 聽 聽 aCol[ 2]:nHeadStrAlign聽 聽 聽 := AL_LEFT
聽 聽 聽 聽 聽 聽 aCol[ 2]:nDataStrAlign聽 聽 聽 := AL_LEFT
聽 聽 聽 聽 聽 聽 aCol[ 2]:nWidth聽聽 聽 聽 聽 聽 聽 := 295

聽 聽 聽 聽 聽 聽aCol[ 3]聽聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 := oBrw:AddCol()
聽 聽 聽 聽 聽 聽 aCol[ 3]:bStrData 聽聽聽 聽 聽 聽 := { || IF(oRsCar:BOF() .AND. oRsCar:EOF(),SPACE(1),TRANSFORM(oRsCar:Fields("CAR_UNI"):Value,"@Z 99.99"))}
聽 聽 聽 聽 聽 聽 aCol[ 3]:cHeader 聽聽 聽 聽 聽 聽 := "Unidds"
聽 聽 聽 聽 聽 聽 aCol[ 3]:nHeadStrAlign聽 聽 聽 := AL_RIGHT
聽 聽 聽 聽 聽 聽 aCol[ 3]:nDataStrAlign聽 聽 聽 := AL_RIGHT
聽 聽 聽 聽 聽 聽 aCol[ 3]:nWidth聽聽 聽 聽 聽 聽 聽 := 45

聽 聽 聽 聽 聽 聽aCol[ 4]聽聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 := oBrw:AddCol()
聽 聽 聽 聽 聽 聽 aCol[ 4]:bStrData 聽聽聽 聽 聽 聽 := { || IF(oRsCar:BOF() .AND. oRsCar:EOF(),SPACE(1),IIF(oRsCar:Fields("CAR_POD"):Value == 1,"P","D"))}
聽 聽 聽 聽 聽 聽 aCol[ 4]:cHeader 聽聽 聽 聽 聽 聽 := "P/D"
聽 聽 聽 聽 聽 聽 aCol[ 4]:nHeadStrAlign聽 聽 聽 := AL_LEFT
聽 聽 聽 聽 聽 聽 aCol[ 4]:nDataStrAlign聽 聽 聽 := AL_CENTER
聽 聽 聽 聽 聽 聽 aCol[ 4]:nWidth聽聽 聽 聽 聽 聽 聽 := 40

聽 聽 聽 聽 聽 聽 oBrw:blDblClick 聽 聽 聽 聽 聽聽 聽:= { | nRow, nCol, nKey | Editar(oBrw)}
聽 聽 聽 聽 聽 聽 oBrw:bKeyDown 聽 聽 聽 聽 聽 聽聽 聽:= { | nKey, nFlags | IIF(nKey == VK_RETURN,Editar(oBrw),)}

聽 聽 聽 聽 聽 聽oBrw:l2007聽 聽聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 := (.F.)

聽 聽 聽 聽 聽 聽 oBrw:nStretchCol 聽 聽聽 聽 聽 聽 聽 聽 := STRETCHCOL_LAST

聽 聽 聽 聽 聽 聽 oBrw:bClrHeader聽:= { || {CLR_WHITE,CLR_BLACK} }
聽 聽 聽 聽 聽 聽 oBrw:bClrFooter聽:= { || {CLR_WHITE,CLR_BLACK} }
聽 聽 聽 聽 聽 聽 oBrw:nRecSelColor聽 聽:= oApp:nRowParClr聽 聽 聽 聽 聽 聽 聽 聽 聽 // Triangulo de selecci贸n
聽 聽 聽 聽 聽 聽 oBrw:bClrSel聽 聽 聽 聽 := {|| IF( oRsCar:AbsolutePosition % oApp:nRowsInt == 0 ,{ CLR_BLACK, oApp:nRowParClr },{ CLR_BLACK, oApp:nRowNonClr }) }
聽 聽 聽 聽 聽 聽 oBrw:bClrSelFocus聽 聽:= { || {oApp:nFClrFocus,oApp:nBClrFocus} }

聽 聽 聽 聽 聽 聽 oBrw:bGoTop 聽 聽:= { || IF( ! oRsCar:BOF() .AND. ! oRsCar:EOF(), oRsCar:MoveFirst(), ) }
聽 聽 聽 聽 聽 聽 oBrw:bGoBottom := { || IF( ! oRsCar:BOF() .AND. ! oRsCar:EOF(), oRsCar:MoveLast(), ) }
聽 聽 聽 聽 聽 聽 oBrw:bBof 聽 聽 聽:= { || oRsCar:BOF() }
聽 聽 聽 聽 聽 聽 oBrw:bEof 聽 聽 聽:= { || oRsCar:EOF() }
聽 聽 聽 聽 聽 聽 oBrw:bBookMark := { | uBm | IF( oRsCar:BOF() .AND. oRsCar:EOF(), 0, IF( uBm == NIL, oRsCar:BookMark, oRsCar:BookMark := uBm ) ) }
聽 聽 聽 聽 聽 聽 oBrw:bKeyNo 聽 聽:= { | n | IF( oRsCar:BOF() .AND. oRsCar:EOF(), 0, IF( n == NIL, oRsCar:AbsolutePosition, oRsCar:AbsolutePosition := n ) ) }
聽 聽 聽 聽 聽 聽 oBrw:bKeyCount聽 := {|| oRsCar:RecordCount() }

聽 聽 聽 聽 聽 聽 oBrw:SetAdo(oRsCar)
聽 聽 聽 聽 聽 聽 oBrw:bClrStd聽 聽 := {|| IF( oRsCar:AbsolutePosition % oApp:nRowsInt == 0 ,{ CLR_BLACK, oApp:nRowParClr },{ CLR_BLACK, oApp:nRowNonClr }) }
聽 聽 聽 聽 聽 聽 oBrw:nRecSelColor聽 聽:= oApp:nRowParClr

聽 聽 聽 聽 聽 聽 oBrw:CreateFromResource(200)

聽 聽 聽 聽 ACTIVATE DIALOG oDlg NOWAIT ON INIT oDlg:MOVE(0,0) VALID ! GetASyncKey(VK_ESCAPE)
聽 聽 ACTIVATE WINDOW oWnd ON RESIZE ( IF( oWnd<>NIL, oWnd:SETSIZE(oDlg:nWidth,oDlg:nHeight+29), ));
聽 聽 聽 聽 ON INIT LaBarra(oWnd,oDlg,oBrw) VALID Cierra()


Muchas gracias por su apoyo
SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero

Continue the discussion