Tengo el problema siguiente problema:
Code: Select all
/*
--------------------------------------------------------------------------
Visualiza el detalle de ticket a Usar
--------------------------------------------------------------------------
*/
Function VerJugada()
Local aArray := {}
LOCAL nCur := 1
LOCAL oWnd, oBrw
aArray := {{ "01","100","25", "1" }, { "02","200","50", "2" }, { "03","300","75", "3" } }
//::oMySql:MsQuery( "SELECT numeros, vendido, ( vendido * precio ) AS Total, recno FROM doc_tempo WHERE terminal = '" + de:cTerminal + "' AND fecha >= CURDATE()" )
DEFINE WINDOW oWnd TITLE "Ver Jugada"
@ 0, 0 LISTBOX oBrw FIELDS;
IF( EMPTY( aArray ), "", Qpt( aArray[ nCur, 1 ] ) ),;
IF( EMPTY( aArray ), "", aArray[ nCur, 2 ] ),;
IF( EMPTY( aArray ), "", aArray[ nCur, 3 ] ),;
IF( EMPTY( aArray ), "", cQpt( aArray[ nCur, 1 ] ) );
HEADERS "Números", "Cantidad", "Valor","**" ;
SIZE 240, 220
oBrw:bLogicLen := { || Len( aArray ) }
oBrw:bGoTop := { || nCur := 1 }
oBrw:bGoBottom := { || nCur := Len( aArray ) }
oBrw:bSkip := { | nSkip | Skipper( aArray, @nCur, nSkip ) }
oBrw:cAlias := "ARRAY"
@ 12.5, 06 BUTTON "Delete" SIZE 80, 30 ACTION KillSecuencia( @aArray, @nCur, @oBrw )
@ 12.5, 21 BUTTON "Imprimir" SIZE 80, 30 ACTION oWnd:End()
ACTIVATE WINDOW oWnd ON CLICK MsgInfo( "Click!" )
STATIC FUNCTION SKIPPER( aArray, nCur, nSkip )
LOCAL nOld := nCur
nCur += nSkip
IF nCur > LEN( aArray ); nCur = LEN( aArray ); ENDIF
IF nCur < 1; nCur = 1; ENDIF
RETURN( nCur - nOld )
Static Function KillSecuencia( aArray, nCur, oBrw )
Local lOk := .F.
// If oMysql:MsCommand( "delete from doc_tempo where recno = " + aArray[ nCur, 4 ] )
aArray := aDel( aArray, nCur )
aArray := aSort( aArray, (Len(aArray ) -1))
oBrw:SetArray( aArray )
oBrw:bLogicLen := { || Len( aArray ) }
oBrw:bGoBottom := { || nCur := Len( aArray ) }
oBrw:GoBottom()
oBrw:Refresh()
// EndIf
Return( lOk )