FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Clase get
Posts: 2
Joined: Mon Aug 28, 2006 08:39 PM
Clase get
Posted: Tue Aug 29, 2006 09:41 PM

Hola amigos, soy nuevo en el foro y aqui va mi primera consulta.

Estoy elaborando un Clase que me permita manipular cualquier base de datos. (añadir, editar y eliminar registros)

Tengo las siguientes lineas de codigo:

CLASS TBrwDbf
....
Method browse()
method BuscaKey()
.....

ENDCLASS

Method Browse() class TBrwDbf
........

redefine get ::oGetCod VAR ::xCodigo ID ::oId_Find[1] of ::oPags:aDialogs[1] picture ::cPcod ;
on change (::buscakey())
....
return (NIL)

Method BuscaKey() class TBrwDbf
.....

return (NIL)

Y cuando ejecuto el programa sale el siguiente error:

Application

Path and name: E:\SysPrg\Bin\SISPER.exe (32 bits)
Size: 1,522,176 bytes
Time from start: 0 hours 0 mins 25 secs
Error occurred at: 29/08/2006, 16:05:13
Error description: Error BASE/1004 Message not found: TGET:BUSCAKEY

Esta asumiendo que el metodo buscakey() pertenece a la clase TGET, despues de tanto probar hice los siguiente cambios

  1. oTbrw:=self

redefine get ::oGetCod VAR ::xCodigo ID ::oId_Find[1] of ::oPags:aDialogs[1] picture ::cPcod ;
on change (buscakey(self,oTbrw))

2.

Static Function Buscakey(oGet,Tbrw)
.......

Y con estos cambios el programa funciona correctamente ya que en BuscaKey necesito la Data de oGet y de Tbrw.

PREGUNTA: Hay alguna manera de poder utilizar el metodo y no una funcion. Utilizo FW2.5 Harbour 45 y BCC55.

Saludos

Manuel Nieves
Piura-Perú

Posts: 189
Joined: Wed Apr 05, 2006 09:48 PM
Clase get
Posted: Tue Aug 29, 2006 09:49 PM

Manuel

local oThis:=self

redefine get ::oGetCod VAR ::xCodigo ID ::oId_Find[1] of ::oPags:aDialogs[1] picture ::cPcod ;
on change (oThis:buscakey())

Posts: 2
Joined: Mon Aug 28, 2006 08:39 PM
Clase get
Posted: Wed Aug 30, 2006 08:48 PM

Muchas gracias Frafive.

Continue the discussion