FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Validacion en Get no regresa valor ( Solved )
Posts: 592
Joined: Tue Mar 14, 2006 11:34 PM
Validacion en Get no regresa valor ( Solved )
Posted: Fri Aug 13, 2010 05:55 PM
Antonio/Daniel,

Tengo el siguiente Get :
Code (fw): Select all Collapse
redefine get oVtaXCst var aVtaDts[ 4] id 111 of oModPOSPgs:adialogs[1] ;
    valid VrfXCli2Vta() ;
    picture "999999" ;
    when lVtaDtsF ;
    action oFldrCptSrc:setoption( iif( oFldrCptSrc:nOption == 1, 3, 1 ) ) ;
    bitmap "opt2sel.bmp" ;
    update
oVtaXCst:bKeyDown := {|nKey| iif( nKey == VK_F2, oFldrCptSrc:setoption(2), ) }

Y esta es la funcion que valida :
Code (fw): Select all Collapse
static function VrfXCli2Vta()
local lVal2Ret := .t., cQryStr, aDsctsGrntd

if aVtaDts[ 4] == 0
    if aVtaDts[1] == 2 //.or. aVtaDts[1] == 5
        ShwPosRBOptSld(1,4)
        return(.t.)
    else
        oFldrCptSrc:SetOption(3)
        lbCstsFrc:PostMsg( WM_LBUTTONDOWN )
        return(.t.)
    endif
endif

// Let's Get Customer's Record Data
GDtsXCstSld( 1, aVtaDts[ 4] )

if len( aCstSldDts ) == 0
    DckMBox( 1,"NUMERO DE CLIENTE NO EXISTE EN CATALOGO",,,, )
    aVtaDts[ 4] := oApp:DfltCstmrId                                                            <= Necesario para poder salir del loop
    oModPOSPgs:adialogs[1]:update()
    lVal2Ret := .f.
    return( lVal2Ret )
endif

if aVtaDts[1] == 5
    if aCstSldDts['pvta'] == 0
        DckMBox( 1, "CLIENTE SELECCIONADO NO APLICA A PREVENTAS.",,,, )
        aVtaDts[ 4] := 0                                                                                 <= Necesario para poder salir del loop
        oModPOSPgs:adialogs[1]:update()
        return(.f.)
    endif
endif
..
..
return( lVal2Ret )

El detalle que tengo, es que cuando no se encuentra el ID o no aplica a X operacion, el Get ya no recibe el focus despues que la validacion regresa falso, y entra en un loop, que es lo hago mal o me falta poner.

Saludos
FWH 10.6 + xHarbour + Borland 582
Posts: 592
Joined: Tue Mar 14, 2006 11:34 PM
Re: Validacion en Get no regresa valor
Posted: Fri Aug 13, 2010 06:17 PM

Antonio/Daniel,

Never mind :wink:

El que me causa el asunto es cuando mando el mensaje al principio, lo movi unas lineas abajo, y listo, ya no entra en el loop.

Sorry por el resbalon :roll:

Saludos

FWH 10.6 + xHarbour + Borland 582

Continue the discussion