grabar y leer un array multi dimensional

grabar y leer un array multi dimensional

Postby devtuxtla » Mon Nov 11, 2013 6:29 pm

Hola Fivewinners.

Requiero guardar y leer en un campo memo, un arreglo multi dimensional, YA intente guardarlo con aSave y leerlo con aRead, pero me envia el siguiente error:

Time from start: 0 hours 1 mins 39 secs
Error occurred at: 11/11/2013, 12:24:18
Error description: Error BASE/1131 Bound error: array dimension
Args:
[ 1] = N -4799

Stack Calls
===========
Called from: => ARRAY( 0 )
Called from: .\source\classes\WINDOW.PRG => AREAD( 1816 )
Called from: C:\Actividades\prg\actividadxml08.prg => AV_GENERA_R08( 874 )


Estoy utilizando Fw1308 y xHarbour 1.123

Alguien conoce el truco ?

Saludos
Visite Chiapas, el paraiso de México.
devtuxtla
 
Posts: 392
Joined: Tue Jul 29, 2008 1:55 pm

Re: grabar y leer un array multi dimensional

Postby carlos vargas » Mon Nov 11, 2013 7:30 pm

FW_ValToExp
Code: Select all  Expand view

//      IF lNuevo
//         IF FLUJ->( DBAppendRec() )
//            FLUJ->PROCESADO := FALSE
//            FLUJ->NUM_CIUD  := nNumCiud
//            FLUJ->NUM_RUTA  := nNumRuta
//            FLUJ->FECHA     := dFecha
//            FLUJ->TOTAL     := aTotales[ K_TOTAL           ]
//            FLUJ->EFECTIVOS := aTotales[ K_TOTAL_COLUMNA   ]
//            FLUJ->DOLARES   := aTotales[ K_TOTAL_DOLARES   ]
//            FLUJ->DEPOSITOS := aTotales[ K_TOTAL_DEPOSITOS ]
//            FLUJ->GASTOS    := aTotales[ K_TOTAL_GASTOS    ]
//            FLUJ->DIFERIDOS := aTotales[ K_TOTAL_DIFERIDOS ]
//            FLUJ->NOTA      := cNota
//            FLUJ->DETALLE   := FW_ValToExp( { aDetalleC, aDetalleD, aDepositos, aGastos, aTotales } )
//            lGrabado := TRUE
//         ENDIF
//      ELSE
 


Code: Select all  Expand view

      TRY
         oQryTmp  := oServer:Query2( "SELECT * FROM vCATFLUJ_E WHERE MY_RECNO=%1 LIMIT 1", { nMy_RecNo } )
         nNumRuta    := oQryTmp:NUM_RUTA
         cNomRuta    := oQryTmp:RUTA
         nNumCobr    := oQryTmp:NUM_COBR
         cNomCobr    := oQryTmp:COBRADOR
         cNota       := oQryTmp:NOTA
         aDetalle    := StringToArray( oQryTmp:DETALLE )
         oQryTmp:END()
      CATCH oError
         ShowError( oError, { oQryTmp } )
         RETURN
      END
 

Code: Select all  Expand view


FUNCTION StringToArray( cString )
   LOCAL aArray := {}
   LOCAL oError := NIL

   IF !Empty( cString )
      cString := AllTrim( cString )
      TRY
         IF Left( cString, 1 ) == "{" .and. Right( cString, 1 ) == "}"
            aArray := &( cString )
            IF !HB_IsArray( aArray )
               aArray := {}
            ENDIF
         ENDIF
      CATCH oError
         aArray := {}
      END
   ENDIF

RETURN aArray
 
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
User avatar
carlos vargas
 
Posts: 1683
Joined: Tue Oct 11, 2005 5:01 pm
Location: Nicaragua


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 85 guests

cron