Hi All
I use the following as general picklist function
cIntls := BrowseaDBF(oEmp,{"INTLS","NAME"},{"Init","Name"},cFile,{||oEmp:intls},"",cIntls)
function BrowseaDBF(oData,aFields,aHdgs,cTitle,bReturnExp,xRetVal,cSoft)
local oDlg,oLbx,cLine := "",i := 0,nKey := 0,lExit := FALSE,nLen := 0
oData:GoTop()
oData:Seek(cSoft,TRUE)
for i := 1 to len( aFields )
cLine += "cValToChar("+aFields[i] + if( i < len( aFields ), "),", ")" )
SysRefresh()
next
nLen := len(cLine)
DEFINE DIALOG oDlg ;
FROM 2,5 TO 16,(42 + int((nLen/4))) ;
TITLE cTitle ;
STYLE nOr(4,WS_POPUP,WS_CAPTION,WS_THICKFRAME) ;
@0,0 LISTBOX oLbx FIELDS "" ;
SIZE 65 + (nLen * 2),65 + nLen ;
of oDlg ;
ON DBLCLICK (xRetVal := eval( bReturnExp ),lExit := TRUE, oDlg:End())
oLbx:nClrForeFocus := CLR_WHITE
oLbx:nClrBackFocus := CLR_BLUE
oLbx:nClrBackHead := CHEADBACK
oLbx:nClrForehead := CHEADFRONT
oLbx:bKeyChar := {|nKey| iif(nKey == VK_RETURN,(xRetVal := eval( bReturnExp),lExit := TRUE,oDlg:End()),)}
oLbx:aHeaders := aHdgs
oLbx:bLine := &("{|| {"+ cLine + "} }")
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT(oDlg:SetControl(oLbx));
VALID(lExit)
return(xRetVal)
I was previously using another database server but now I have converted to the fivewin database class
and now I get an error on - oLbx:bLine := &("{|| {"+ cLine + "} }")
Error description: Error BASE/1003 Variable does not exist: INTLS
Args:
Stack Calls
===========
Called from: Fnctn.prg => (b)BROWSEADBF(165)
Called from: .\source\classes\WBROWSE.PRG => TWBROWSE:DEFAULT(1344)
Cheers
Colin