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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.