>Ed,
>>I'm afraid, it's too difficult. And also I know, that UDFs in SQL could
>1) slow down the speed
>2) work unpredictable (it could work in one situation and not work in another).
>
Take a look at my more recent answer of building the entire SELECT into a .PRG, compiling it and running it.
> We have to find simpler solution. On Monday will be our programmer's meeting, so we'll discuss.
> I think, it's a general situation, so, if you already have a working example and can share with us, it would be great.
>
If you can build the SQL Select now using macro-expansion, simply concatenate the whole thing together in a single string and use STRTOFILE() to write it to disk. Compile the file you write using STRTOFILE(). Execute the compiled code. Something like:
cMyEntireSQLCommand = 'SELECT '+ cMySelectMacro + ;
' ' + cMyJoinExpression + ;
' ' + cMyWhereExpression + ;
' ' + cMyIntoClause + ;
' ' + cMyGroupByExpression + ;
' ' + cMyOrderByExpression
cMyPrgFile = SYS(2015) + '.PRG'
= STRTOFILE(cMyEntireSQLCommandAsAString,cMyPrgFile)
COMPILE (cMyPrgFile)
DO (cMyPrgFile)
> BTW, I ask about VFP7.0. Do you know, when will MS release this product? Will this annoying limitation be fixed in the new version?
>
> I can write a long list of desired improvements in VFP (actually, I did it once). Should I? And where do I need to post it? In chatter section?