<DIV><BR><BR><B><I>Richard Gaskin &lt;ambassador@fourthworld.com&gt;</I></B> wrote:
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><BR><BR><BR>&gt;&gt; I tend to use them in two circumstances:<BR>&gt;&gt; <BR>&gt;&gt; - where I might have used globals but want to<BR>&gt;&gt; avoid name-space collisions<BR>&gt;&gt; (great for utilities and plugins where you have<BR>&gt;&gt; no control over the name space)<BR>&gt; <BR>&gt; "name space" is a new expression for me. ???<BR><BR>It's geekspeak for "the range of all possible names".<BR><BR>&gt; after all this, i am back to declaring<BR>&gt; temporary/in-handler locals. a trade off<BR>&gt; between extra text versus having all variables<BR>&gt; declared at the beginning of each handler.<BR>&gt; using handler + parameters to pass info<BR>&gt; involves the same kind of trade off.<BR><BR>When you get the hang of using script-local vars, they serve a different<BR>olace from globals and parameters, and are useful in their own right, worth<BR>becoming familiar with.<BR><BR>If you've been declaring them with "global" I can understand the confusion,<BR>as theyt would then act as common local vars (the "global" declaration is<BR>ignored outside of handlers).<BR><BR><BR>&gt; using the script/static approach generated<BR>&gt; some very strange results:<BR>&gt; <BR>&gt; local sHolder = empty # no quotes<BR>&gt; put the actual "e-m-p-t-y" string into sHolder<BR>&gt; in the first handler that ran<BR>&gt; the only instance i have ever seen where empty<BR>&gt; did not resolve to just that.<BR><BR>If you post the actual code we can identify the problem.<BR><BR>&gt; there was a loop where:<BR>&gt; <BR>&gt; local i # outside any handlers<BR>&gt; on xxx<BR>&gt; repeat with i = 14 to 18<BR>&gt; # on the first pass (i = 14) fine,<BR>&gt; # on the second pass (i = 5)<BR>&gt; put goGetum() after sHolder<BR>&gt; end repeat<BR>&gt; end xxx<BR>&gt; <BR>&gt; function goGetum<BR>&gt; repeat with i = 1 to 5<BR>&gt; doSomething<BR>&gt; end repeat<BR>&gt; end goGetum <BR>&gt; <BR>&gt; this is the only case in my experience where<BR>&gt; repeat with i = <BR>&gt; did not follow orders<BR><BR>This may be a case of the propgram doing what you told it rather than what<BR>you intended. :)<BR><BR>In the first loop, you initialize i to contain 14, but then in its repeat<BR>loop you cann another handler which uses the same variable to count from 1<BR>to 5, so when it returns i contains the last value set: 5.<BR><BR>&gt; take home thought:<BR>&gt; use script/static locals very carefully<BR><BR>Or maybe the take home thought is simply:<BR>If you need two different repeat loops to count independently, you two<BR>different variables as the counter.<BR><BR>-- <BR>Richard Gaskin <BR>Fourth World Media Corporation<BR>Developer of WebMerge 2.2: Publish any database on any site<BR>___________________________________________________________<BR>Ambassador@FourthWorld.com http://www.FourthWorld.com<BR>Tel: 323-225-3717 AIM: FourthWorldInc<BR><BR>_______________________________________________<BR>use-revolution mailing list<BR>use-revolution@lists.runrev.com<BR>http://lists.runrev.com/mailman/listinfo/use-revolution</BLOCKQUOTE></DIV><BR><BR><FONT style="BACKGROUND-COLOR: blanchedalmond" color=blanchedalmond><FONT color=orangered><FONT color=blue>erik@erikhansen.org</FONT>&nbsp;&nbsp;&nbsp; </FONT><FONT color=darkred>http://www.erikhansen.org</FONT></FONT><p><br><hr size=1>Do you Yahoo!?<br>
<a href="http://us.rd.yahoo.com/finance/mailsig/*http://tax.yahoo.com">Yahoo! Tax Center</a> - File online, calculators, forms, and more