FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour valores de variables en ITEMS en ComboBox perdidas
Posts: 65
Joined: Fri Oct 21, 2005 08:07 PM
valores de variables en ITEMS en ComboBox perdidas
Posted: Thu Sep 27, 2007 06:22 PM

Hola a todos!

Algo raro esta sucede y no se que es...
Tengo un programa que ya funcionaba perfectamente y ahora me manda error....

Al seleccionar una opcion de un combo en lugar de tomar el valor de la variable toma el contenido del combo. ej. tengo que la variable nSexo y puede tener solo los valores 1 o 2 pero se queda con el contenido del combo que puede ser Hombre o Mujer... y uso muchos comobos y ahora todos hacen lo mismo...

codigo:

nSexo:=1

REDEFINE COMBOBOX oSexo VAR nSexo ID 119 OF oFld:aDialogs[ 1 ] ITEMS tSexo

aqui pregunto si nSexo=1 pero ahora nSexo tiene 'Mujer'....

error:

Error description: Error BASE/1071 Argument error: =
Args:
[ 1] = C Mujer
[ 2] = N 1

estar raro... y no doy :(

Laurel

xh 0.99.71 /FWH7.01/BORLAND/WORKSHOP

Laurel
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
valores de variables en ITEMS en ComboBox perdidas
Posted: Thu Sep 27, 2007 08:36 PM
Comprueba que este sea el código del método Change:
METHOD Change() CLASS TComboBox

   local cItem := GetWindowText( ::hWnd ) // Current Value
   local nAt

   nAt = ::SendMsg( CB_GETCURSEL ) + 1

   if nAt == ::nAt .and. ! Empty( Eval( ::bSetGet ) )
      return nil
   endif

   ::nAt := nAt

   if ::nAt != 0 .and. ::nAt <= Len( ::aItems )
      if ValType( Eval( ::bSetGet ) ) == "N"
         Eval( ::bSetGet, ::nAt )
      else
         Eval( ::bSetGet, ::aItems[ ::nAt ] )
      endif
   endif

   if ::oGet != nil                        // Always not nil for dropdown
      ::oGet:VarPut( Eval( ::bSetGet ) )   // udate variable before calling bChange
      ::oGet:Refresh()
   endif

   if ::bChange != nil
      Eval( ::bChange, Self, cItem )
   endif

return nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 65
Joined: Fri Oct 21, 2005 08:07 PM
valores de variables en ITEMS en ComboBox perdidas
Posted: Thu Sep 27, 2007 09:29 PM
Hola de nuevo!

Ya revise y si esta exactamente igual....
¿que más reviso?

Laurel
Antonio Linares wrote:Comprueba que este sea el código del método Change:
METHOD Change() CLASS TComboBox

   local cItem := GetWindowText( ::hWnd ) // Current Value
   local nAt

   nAt = ::SendMsg( CB_GETCURSEL ) + 1

   if nAt == ::nAt .and. ! Empty( Eval( ::bSetGet ) )
      return nil
   endif

   ::nAt := nAt

   if ::nAt != 0 .and. ::nAt <= Len( ::aItems )
      if ValType( Eval( ::bSetGet ) ) == "N"
         Eval( ::bSetGet, ::nAt )
      else
         Eval( ::bSetGet, ::aItems[ ::nAt ] )
      endif
   endif

   if ::oGet != nil                        // Always not nil for dropdown
      ::oGet:VarPut( Eval( ::bSetGet ) )   // udate variable before calling bChange
      ::oGet:Refresh()
   endif

   if ::bChange != nil
      Eval( ::bChange, Self, cItem )
   endif

return nil
Laurel

Continue the discussion