FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour ON CHANGE help
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
ON CHANGE help
Posted: Sun Dec 03, 2006 12:42 AM
Hi Everybody,

I am having a problem using the "ON CHANGE" clause of a get.

I want the program to run a function as the user enters data so I tried:

      REDEFINE GET oGetLast VAR cLastName ID 101 OF oSearch  ON CHANGE UpDateSearch() UPDATE


For some reason nothing appears in the get and if I do a MsgInfo( cLastName) it shows that no value was stored to cLastName.

If I change the ON CHANGE to a VALID (and leave the field) my function works fine but I want to check as the user types.

Any Ideas?

Thanks

Jeff
Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
ON CHANGE help
Posted: Sun Dec 03, 2006 03:06 AM

Jeff:

Perhaps you need an incremental search ?

Regards, Armando

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
ON CHANGE help
Posted: Sun Dec 03, 2006 03:22 AM

Yes ... this is what I am trying to do with a few fields.

Can you point me in the right direction?

Jeff

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
ON CHANGE help
Posted: Sun Dec 03, 2006 04:20 AM

Jeff:

I use this one procedure

PROCEDURE Busca(cAlias,cKey,oBrw)
LOCAL nSeekRec := RECNO()
IF GETASYNCKEY(VK_BACK)
cKey := SUBSTR(cKey,1,LEN(cKey)-1)
ENDIF
IF ! (cAlias)->(DBSEEK(cKey,(.T.)))
GO nSeekRec
ENDIF
oBrw:REFRESH()
oBrw:oVScroll:SETPOS(RECNO())
RETURN

And this is the way to call to the procedure

REDEFINE GET aGets[1] VAR cBusca ID 101 OF oDlg UPDATE;
PICTURE "@!K";
ON CHANGE(SELF:ASSIGN(),;
Busca((cAlias),SUBSTR(cBusca,1,SELF:nPos-1)+UPPER(CHR(nKey)),oBrw),oBrw:REFRESH())

Best regards, Armando

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 3358
Joined: Fri Oct 07, 2005 08:20 PM
ON CHANGE help
Posted: Sun Dec 03, 2006 04:26 AM

Jeff:

I forgot to tell you that the incremental search works on the active index.

Regards, Armando

SOI, s.a. de c.v.
estbucarm@gmail.com
http://www.soisa.mex.tl/
http://sqlcmd.blogspot.com/
Tel. (722) 174 44 45
Carpe diem quam minimum credula postero
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
ON CHANGE help
Posted: Sun Dec 03, 2006 06:06 AM

Jeff,

Use a DBCombo. It has built in incremental searching. You can use it with a DBF or an array.

See samples\testdbc1.prg for examples.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion