Anybody?
Reinaldo.
Text Autocompletion?
- reinaldocrespo
- Posts: 918
- Joined: Thu Nov 17, 2005 5:49 pm
- Location: Fort Lauderdale, FL
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
-
- Posts: 142
- Joined: Sun Oct 09, 2005 10:59 am
Code: Select all
#include "FiveWin.ch"
//------------------------------------------------------------------------//
function Main()
local oDlg
local cText := "AUTOFILL"
local oGet
DEFINE DIALOG oDlg TITLE "Just a get"
@ 2, 2 SAY "Date:" OF oDlg
@ 2, 6 GET oGet VAR cText OF oDlg SIZE 40, 10 ;
VALID ! Empty( cText) PICTURE "@K!"
oGet:bChange := {|self|test(self , oGet)}
@ 3, 7 BUTTON "&Ok" OF oDlg SIZE 30, 12 ACTION oDlg:End()
@ 3, 16 BUTTON "&Cancel" SIZE 30, 12 OF oDlg ACTION oDlg:End() CANCEL
ACTIVATE DIALOG oDlg CENTERED
return nil
//------------------------------------------------------------------------//
Proc Test(nKey , OGet)
*******************
LOCAL a := {"ABCD" , "ACBCDE" , "ABDCD" , "ABCDEFGH"}
LOCAL Len
LOCAL cBuf , n , nPos := oGet:nPos
IF nKey == 8 // Delete character
RETURN
END
oGet:Assign()
cBuf := oGet:Varget()
Len := LEN(cBuf)
cBuf := LEFT(cBuf , nPos-1)
IF (n := ASCAN(a, cBuf)) > 0
oGet:Varput(PAD(a[n],Len))
oGet:Refresh()
oGet:SetPos(nPos)
END
RETURN
- reinaldocrespo
- Posts: 918
- Joined: Thu Nov 17, 2005 5:49 pm
- Location: Fort Lauderdale, FL