Help, what am I doing wrong???

Jan Schenkel janschenkel at yahoo.com
Sat Jul 30 12:59:45 EDT 2005


--- Dennis Brown <see3d at writeme.com> wrote:
> I have the following script (much simplified from
> original).
> In the form shown, it generates results and saves
> them into the  
> following variable names:
> openSAW
> openSAWW
> openSAWWW
> openSAWWWW
> openSAWWWWW
> openSW
> 
> This is not what I intended!
> However if I make a small change to the script as
> shown in the  
> comments it works fine and fills the globals with
> the results.
> 
> Can anyone tell me what I am doing wrong with the
> original script?
> 
> Dennis
> 

Hi Dennis,

I believe this was largely due to modifying the
control variable <inName1> within the repeat loop. I
made some other changes, and you'll find the result
below:

##
global
typSAPW,openSAPW,lowSAPW,highSAPW,closeSAPW,dVol7WEMAW,volP50EMAW,volP50,EMA5W,IIV50W
--
on mouseUp
  breakpoint
  local inNames1,fileText1
  put
"OpenSAP,LowSAP,HighSAP,CloseSAP,TypSAP,DVol7WEMA,VolP50EMA,VolP50EMA5,IIV50"
into inNames1
  put "123"&cr&"456"&cr&"789" into fileText1
  repeat for each item inName1x in inNames1
    put inName1X & "W" into inName1
    do ("global" && inName1 & ";put fileText1 into" &&
inName1)
    do ("global" && inName1 & ";split" && inName1 &&
"with cr")
  end repeat
end mouseUp
##

Running the above script seemed to work for me.

Hope this helped,

Jan Schenkel.

Quartam - Tools for Revolution
<http://www.quartam.com>

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)


		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 



More information about the use-livecode mailing list