FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Problema con tdolphin mas reciente
Posts: 1789
Joined: Tue Oct 11, 2005 05:01 PM
Problema con tdolphin mas reciente
Posted: Fri Jan 17, 2014 09:57 PM
Daniel

con los 煤ltimos cambios en thdolphin
sucede que en una consulta con columnas tipo l贸gicas o de fecha, cuando no contienen datos, se convierten en tipo caracter vaci贸.
revisando el c贸digo y comparando he realizado los siguientes cambios:

Code (fw): Select all Collapse
METHOD VerifyValue( nIdx, cField ) CLASS TDolphinQry

聽 聽LOCAL cType, uValue
聽 聽LOCAL nPad

聽 聽cType := ::aStructure[ nIdx ][ MYSQL_FS_CLIP_TYPE ] //, ::aStructure[ nIdx ][ MYSQL_FS_TYPE ]

聽 聽SWITCH cType
聽 聽 聽 CASE "L"
聽 聽 聽 聽 聽IF cField == NIL //.OR. Empty(cField) <------------------------ ACA SE COMENTA ANTES DEl .OR.
聽 聽 聽 聽 聽 聽 uValue := If( IS_NOT_NULL( ::aStructure[ nIdx ][ MYSQL_FS_FLAGS ] ), .F., cField )
聽 聽 聽 聽 聽ELSE
聽 聽 聽 聽 聽 聽 uValue := If( ValType( cField ) == "L", cField, !( Val( cField ) == 0 ) )
聽 聽 聽 聽 聽ENDIF
聽 聽 聽 聽 聽EXIT

聽 聽 聽 CASE "N"

聽 聽 聽 聽 聽IF cField == NIL //.OR. Empty(cField) <------------------------ ACA SE COMENTA ANTES DEl .OR.
聽 聽 聽 聽 聽 聽 uValue = If( IS_NOT_NULL( ::aStructure[ nIdx ][ MYSQL_FS_FLAGS ] ), 0, cField )
聽 聽 聽 聽 聽ELSE
聽 聽 聽 聽 聽 聽 uValue = If( ValType( cField ) == "N", cField, Val( cField ) )
聽 聽 聽 聽 聽ENDIF
聽 聽 聽 聽 聽EXIT

聽 聽 聽 CASE "D"
聽 聽 聽 聽 聽IF Empty( cField ) //.OR. Empty(cField) <------------------------ ACA SE COMENTA ANTES DEl .OR.
聽 聽 聽 聽 聽 聽 uValue = If( IS_NOT_NULL( ::aStructure[ nIdx ][ MYSQL_FS_FLAGS ] ), 聽CToD( "" ), cField )
聽 聽 聽 聽 聽ELSE
聽 聽 聽 聽 聽 聽 uValue := If( ValType( cField ) == "D", cField, SqlDate2Clip( cField ) )
聽 聽 聽 聽 聽ENDIF
聽 聽 聽 聽 聽EXIT
聽 聽 聽 CASE "M"
聽 聽 聽 聽 聽// we can not use PadR in 聽memo field
聽 聽 聽 聽 聽IF ( cField == NIL .OR. Empty(cField) )
聽 聽 聽 聽 聽 聽 uValue := ""
聽 聽 聽 聽 聽ELSE
聽 聽 聽 聽 聽 聽 uValue := cField
聽 聽 聽 聽 聽ENDIF
聽 聽 聽 聽 聽EXIT
聽 聽 聽 CASE "T"
聽 聽 聽 CASE "C"
聽 聽 聽 聽 聽IF D_SetPadRight()
聽 聽 聽 聽 聽 聽 nPad = Min( If( ::aStructure[ nIdx ][ MYSQL_FS_MAXLEN ] > ::aStructure[ nIdx ][ MYSQL_FS_LENGTH ],;
聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 ::aStructure[ nIdx ][ MYSQL_FS_MAXLEN ], ::aStructure[ nIdx ][ MYSQL_FS_LENGTH] ), MAX_BLOCKSIZE )
聽 聽 聽 聽 聽ELSE
聽 聽 聽 聽 聽 聽 nPad = 0
聽 聽 聽 聽 聽ENDIF
聽 聽 聽 聽 聽IF ( cField == NIL .OR. Empty(cField) )
聽 聽 聽 聽 聽 聽 uValue = If( IS_NOT_NULL( ::aStructure[ nIdx ][ MYSQL_FS_FLAGS ] ), PadR(nPad), cField )
聽 聽 聽 聽 聽ELSE
聽 聽 聽 聽 聽 聽 uValue := PadR( cField, Max( Len( cField ), nPad ) )
聽 聽 聽 聽 聽ENDIF

聽 聽 聽 聽 聽EXIT
#ifdef __XHARBOUR__
聽 聽 聽 DEFAULT
#else
聽 聽 聽 OTHERWISE
#endif
聽 // 聽 聽 聽 uValue = cField
聽 聽 聽 ENDSWITCH

RETURN uValue


otra cosa, has visto este post
http://forums.fivetechsupport.com/viewtopic.php?f=6&t=27901&p=155778&hilit=carlos+vargas#p155778
Salu2

Carlos Vargas

Desde Managua, Nicaragua (CA)
Posts: 1789
Joined: Tue Oct 11, 2005 05:01 PM
Re: Problema con tdolphin mas reciente
Posted: Fri Jan 17, 2014 10:29 PM
Daniel

Otras cosa que note haciendo una funci贸n propia de b煤squeda es: en la ordenaci贸n de un query con un xbrowse
establece que dando click en una columna se ordena ascendentemente, si nuevamente damos click en esa misma columna se ordena descendente
en oQuery:cOrder se almacena el nombbre de la columna ordenada actualmente.

por ejemplo:

Code (fw): Select all Collapse
?oQuery:cOrder 聽// mostraria "NOMBRE" si la columna del query se llama NOMBRE y esta ordenada ascendentemente

y
Code (fw): Select all Collapse
?oQuery:cOrder 聽// mostraria "NOMBRE DESC" si la columna del query se llama NOMBRE y esta ordenada descendentemente


yo en mi funcion propia me he visto obligado a eliminar la parte " DESC" para que no me diera error.
no se si por ahi van los problemas con el methodo Seek propio de tdolphin cuando cambias entre columnas ordenadas, esto esta reportado en un post anterior, lo ubicare para indicarlo aca.

en este momento no pude hacer pruebas pero tu que tienes mas control sobre la clase sabr谩s si es relevante esto.

salu2
carlos vargas
Salu2

Carlos Vargas

Desde Managua, Nicaragua (CA)
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Problema con tdolphin mas reciente
Posted: Sat Jan 18, 2014 12:42 PM

Carlos

Gracias, ahpra me encuentro fuera de mi pais atendiendo unos asuntos de trabajo, a la brevedad reviso lo que me comentas

Posts: 1789
Joined: Tue Oct 11, 2005 05:01 PM
Re: Problema con tdolphin mas reciente
Posted: Mon Mar 24, 2014 01:05 AM
Daniel, podria corregir asi este codigo, cuando los valores logicos y fechason vacios, los cambia a tipo caracter en el query
asi funciona bien.

Code (fw): Select all Collapse
METHOD VerifyValue( nIdx, cField ) CLASS TDolphinQry

   LOCAL cType, uValue
   LOCAL nPad

   cType := ::aStructure[ nIdx ][ MYSQL_FS_CLIP_TYPE ] //, ::aStructure[ nIdx ][ MYSQL_FS_TYPE ]

   SWITCH cType
      CASE "L"
         IF cField == NIL //.OR. Empty(cField) <------------------------ ACA SE COMENTA ANTES DEl .OR.
            uValue := If( IS_NOT_NULL( ::aStructure[ nIdx ][ MYSQL_FS_FLAGS ] ), .F., cField )
         ELSE
            uValue := If( ValType( cField ) == "L", cField, !( Val( cField ) == 0 ) )
         ENDIF
         EXIT

      CASE "N"
         IF cField == NIL //.OR. Empty(cField) <------------------------ ACA SE COMENTA ANTES DEl .OR.
            uValue := If( IS_NOT_NULL( ::aStructure[ nIdx ][ MYSQL_FS_FLAGS ] ), 0, cField )
         ELSE
            uValue := If( ValType( cField ) == "N", cField, Val( cField ) )
         ENDIF
         EXIT

      CASE "D"
         IF cField == NIL  //.OR. Empty(cField) <------------------------ ACA SE COMENTA ANTES DEl .OR. y se pone al inicio IF cField == NIL
            uValue := If( IS_NOT_NULL( ::aStructure[ nIdx ][ MYSQL_FS_FLAGS ] ),  CToD( "" ), cField )
         ELSE
            uValue := If( ValType( cField ) == "D", cField, SqlDate2Clip( cField ) )
         ENDIF
         EXIT
      CASE "M"
         // we can not use PadR in  memo field
         IF ( cField == NIL .OR. Empty(cField) )
            uValue := ""
         ELSE
            uValue := cField
         ENDIF
         EXIT
      CASE "T"
      CASE "C"
         IF D_SetPadRight()
            nPad = Min( If( ::aStructure[ nIdx ][ MYSQL_FS_MAXLEN ] > ::aStructure[ nIdx ][ MYSQL_FS_LENGTH ],;
                      ::aStructure[ nIdx ][ MYSQL_FS_MAXLEN ], ::aStructure[ nIdx ][ MYSQL_FS_LENGTH] ), MAX_BLOCKSIZE )
         ELSE
            nPad := 0
         ENDIF
         IF ( cField == NIL .OR. Empty(cField) )
            uValue := If( IS_NOT_NULL( ::aStructure[ nIdx ][ MYSQL_FS_FLAGS ] ), PadR(nPad), cField )
         ELSE
            uValue := PadR( cField, Max( Len( cField ), nPad ) )
         ENDIF
         EXIT

#ifdef __XHARBOUR__
      DEFAULT
#else
      OTHERWISE
#endif
  //       uValue = cField
      ENDSWITCH

RETURN uValue
Salu2

Carlos Vargas

Desde Managua, Nicaragua (CA)
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: Problema con tdolphin mas reciente
Posted: Fri Mar 28, 2014 01:44 AM

Carlos

estoy pendiente por hacelo

Posts: 1789
Joined: Tue Oct 11, 2005 05:01 PM
Re: Problema con tdolphin mas reciente
Posted: Fri Mar 28, 2014 02:44 AM

ok, daniel, gracias.

Salu2

Carlos Vargas

Desde Managua, Nicaragua (CA)

Continue the discussion