Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Utility for Type, List & Select / Incremental Search

Program Source Code

Utility for Type, List & Select / Incremental Search

by  advancepack  Posted    (Edited  )
set talk OFF
define window customer from 0,0 to 20,80 in window screen font 'arial',10 title 'Customer Database'
move window customer center
activate window customer
@ .1,1 say 'Type some Characters to Find, Press <DOWNARRAY> & <ENTER> to select' style "B" color R+/w*
Use Customer
SrchONField="Company"
define popup CustPOP from 0,0 prompt field &SrchONField
@ 2,2 get CustVar1 default space(1) pict '@!' size 1,1.5 valid CustList() when CustList()
@ 2,$ get CustVar2 default space(1) pict '@!' size 1,1.5 valid CustList() when CustList()
@ 2,$ get CustVar3 default space(1) pict '@!' size 1,1.5 valid CustList() when CustList()
@ 2,$ get CustVar4 default space(1) pict '@!' size 1,1.5 valid CustList() when CustList()
@ 2,$ get CustVar5 default space(1) pict '@!' size 1,1.5 valid CustList() when CustList()
@ 3,2 get OptArray popup CustPOP size 11,40 default Company when WCustPOP()
READ
release window customer
wait wind iif(lastkey()=13,"Selected Company : "+OptArray,"") nowa
RETURN

FUNCTION CustList
*****************
for ii=_Curobj to 5
store " " to ("CustVar"+allt(str(ii+1)))
endfor
set filt to upper(&SrchONField)=upper(allt(CustVar1+CustVar2+CustVar3+CustVar4+CustVar5))
do case
case last()=24
_curobj=objn(OptArray)
case last()=13 AND !empty(CustVar1)
clear read
case last()=1 AND _curobj#1
_curobj=objn(CustVar1)
endcase
show gets
RETURN

FUNCTION WCustPOP
*****************
if !inlist(Lastkey(),24,5)
_curobj=1
keyboard chr(lastkey()) plain
endif
RETURN
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top