****************************************************************************** * * Function: MKMEMO * * * Parameters: fields to be included in memo, the select expression if required ie a=b, the delimiter to be used * Returns: Results of the select as a concatanated string * Variables: * : lcFields Fields list for select * : lcExpr The limiting select expression * : lcDelimiter The separator to be used (It defaults to a carriage return) * : lcCom Macro string for execution to create browse window * : lcMemo The string variable the select result ends up in * : liFcount The number of fields in the select ****************************************************************************** *[169 * OVERVIEW of SWEPROC.PRG MKMEMO * Allows placing of mutiple different size columns on reports by storing the columns in concatenated string *]169 FUNC mkmemo LPARAM lcFields,lcExpr,lcDelimiter * lcFields = fields to be included in memo ie "Name,Address,Zip" * lcExpr = the select expression if required ie "Name=Cusname" * lcDelimiter = the record delimiter to be used it defaults to a cariage Return line feed lcAlias=ALIAS() lcFields=IIF(TYPE('lcFields')='C' AND !EMPTY(lcFields),lcFields,'*') lcExpr=IIF(TYPE('lcExpr')='C' AND !EMPTY(lcExpr),lcExpr+' and !deleted() ','!deleted()') lcDelimiter=IIF(TYPE('lcDelimiter')='C' AND LEN(lcDelimiter)>0,lcDelimiter,CHR(13)+CHR(10)) lcCom = [SELECT ]+lcFields+[ FROM ]+lcAlias+[ WHERE ]+lcExpr+[ INTO CURSOR ZQUERY] &lcCom lcMemo='' IF RECCO()>0 liFcount=FCOUNT() SCAN FOR i = 1 TO liFcount lcMemo=lcMemo+' '+ALLTRIM(trans(EVAL(FIELD(i)))) ENDFOR lcMemo=lcMemo+lcDelimiter ENDSCAN ENDIF if used('zquery') use in zquery endif SELE (lcAlias) RETURN lcMemo>Any ideas on how to tackle this one? It's twisting my melon real bad...!