Funny script looping over selectedObjects

Jim Witte jswitte at bloomington.in.us
Sun May 4 19:19:01 EDT 2003


   I've got the following script to delete a number of selected objects:

  put the selectedObjects into tSelObjs
  repeat with i=1 to number of lines in tSelObjs
	get (line i of tSelObjs)
     --delete it
	delete  (line i of tSelObjs)
end repeat

   As it's written, it complains (when run from the message box) that 
there's 'garbage where a command should be'.  But if I switch the 
comment of the 'delete it' line.  If I cange the command from delete to 
'put the cantSelect of' it also doesn't work, but says that it can't 
find the object.  This behavior manifests if I change the delete 
command to 'put the cantSelect of'.  Why will the script work if the 
object descriptor is in a variable, but not if it's in the line itself?

Jim




More information about the use-livecode mailing list