Clase get

Post Reply
Manuel Nieves
Posts: 2
Joined: Mon Aug 28, 2006 8:39 pm

Clase get

Post by Manuel Nieves »

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 _ 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ú
Frafive
Posts: 189
Joined: Wed Apr 05, 2006 9:48 pm

Post by Frafive »

Manuel

local oThis:=self


redefine get ::oGetCod VAR ::xCodigo ID ::oId_Find[1] of ::oPags:aDialogs[1] picture ::cPcod ;
on change (oThis:buscakey())
Manuel Nieves
Posts: 2
Joined: Mon Aug 28, 2006 8:39 pm

Post by Manuel Nieves »

Muchas gracias Frafive.
Post Reply