Very interesting! Thank you, - Joe On Saturday, December 01, 2007 10:52 AM, Lew wrote: > >Date: Sat, 01 Dec 2007 10:52:07 -0500 >From: Lew >To: [EMAIL PROTECTED] >cc: >Subject: RE: Execscript glitch? > >I admit that you didn't miss anything. There is no 'clue' and I had to >discover this myself. 'Scripts' on >other platforms like VBA support thousands of line of code, distinct from our >"&" in line macro idea. There >is/was no similar concept in VFP. Maybe we could have guessed based on the >fact that scripts support >lparameters statements and cr delimited, multiple lines of code. If you open >the executing folder in windows >explorer, you can see the fxp get created & erased as you step through the >code. > >-----Original Message----- >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Joe Yoder >Sent: Saturday, December 01, 2007 10:24 AM >To: [email protected] >Subject: re: Execscript glitch? > >So the clue I missed is in the name itself - any time the name includes >the word "script" we are supposed to know that are dealing with the >equivalent of a separate program? - Joe > >On Saturday, December 01, 2007 2:31 AM, Lew wrote: >> >>Date: Sat, 01 Dec 2007 02:31:16 -0500 >>From: Lew >>To: [EMAIL PROTECTED] >>cc: >>Subject: RE: Execscript glitch? >> >>There's nothing wrong with the help. You just inferred too much. Undeclared >>memvars are "private" by default, >>so when your script executes it creates a private memvar that is not visible >>outside the script unless you >>take some steps to make it so. execscripts are actually compiled at runtime >>like prgs and behave like them >vis >>a vis the scope & visibility of their memvars. That's good or bad depending >>on what you need. Inline macros >>fire in place so they can 'see' what everything else in the neighboring code >>sees. >> >>-----Original Message----- >>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Joe Yoder >>Sent: Friday, November 30, 2007 11:10 PM >>To: [email protected] >>Subject: re: Execscript glitch? >> >>After it was explained, I understood how it works. My second question is >>about the contents of the Help system. What did I miss there that allows >>a newbee to understand just by reading? - Joe >> >>On Friday, November 30, 2007 10:10 PM, Gianni Turri wrote: >>> >>>Date: Sat, 01 Dec 2007 04:10:51 +0100 >>>From: Gianni Turri >>>To: [EMAIL PROTECTED] >>>cc: >>>Subject: Re: Execscript glitch? >>> >>>As Lew as already tried to explain, it is like doing the following: >>> >>>* ... your code >>> >>>do MyProcWithTheQuery >>> >>>?_tally >>> >>>* ... your code >>> >>>RETURN >>>* >>>FUNCTION MyProcWithTheQuery >>>local m.macro >>>m.macro = 'select CNT(*),' + m.fldstr +; >>> " DISTINCT FROM (m.InTbl) WHERE desthop > 0 and not >>> INLIST('out'," +; >>> m.fldstr + ' ) GROUP BY ' + m.fldstr + ' INTO array Rarray' >>>¯o >>>ENDFUNC >>> >>>The scope of Rarray will default to local, local to MyProcWithTheQuery. >>>This is true also for simple memvar not only array. >>> >>>Unless you declare and define the variable before calling MyProcWithTheQuery >>>(or EXECSCRIPT) >>>like in my first reply. >>> >>>HTH >>>Gianni >>> >>>On Fri, 30 Nov 2007 20:36:44 -0500, Joe Yoder <[EMAIL PROTECTED]> wrote: >>> >>>>Thanks Gianni and Lew, >>>> >>>>I guess that's one reason to use Execscript instead of macro >>>>substitution. I was trying to figure out if there were any advantages >>>>beyond the elegance of a one liner. >>>> >>>>I went back to the help but didn't find anything to indicate that an >>>>array created there would not be accessible in the following code. Is >>>>there a clue I am missing or am I just supposed to know?? >>>> >>>>TIA - Joe >>>> >>>>On Friday, November 30, 2007 7:03 PM, Lew wrote: >>>>> >>>>>Date: Fri, 30 Nov 2007 19:03:26 -0500 >>>>>From: Lew >>>>>To: [EMAIL PROTECTED] >>>>>cc: >>>>>Subject: RE: Execscript glitch? >>>>> >>>>>Your array will have been created as a local memvar within the script, so >>>>>it won't be around when the >>script >>>>>finishes. Play around with the parameters idea then >>>>>local myarray[1] >>>>>execscript(cScript,@MyArray) >>>>>HTH >>>>> >>>>>-----Original Message----- >>>>>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Joe Yoder >>>>>Sent: Friday, November 30, 2007 6:39 PM >>>>>To: [email protected] >>>>>Subject: Execscript glitch? >>>>> >>>>>I just coded an SQL select statement using execscript and found it won't >>>>>create an array. If I substitute >>>>>"cursor" for "array" all is well. _Tally after code execution reports the >>>>>correct value so the SQL >>apparently >>>>>runs but does not create the array. When I use macro substitution the >>>>>array is created as expected. Does >>>>>someone have an explanation for this behavior? >>>>> >>>>> TIA - Joe >>>>> >>>>>Here is the code: >>>>>?EXECSCRIPT('select CNT(*),' + m.fldstr +; >>>>> " DISTINCT FROM (m.InTbl) WHERE desthop > 0 and not >>>>> INLIST('out'," +; >>>>> m.fldstr + ' ) GROUP BY ' + m.fldstr + ' INTO array Rarray') >>>>> >>>>>?_tally >>> >>> [excessive quoting removed by server]
_______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

