On 3/5/01 8:23 PM, Will Mazurek ([EMAIL PROTECTED]) sent:
>What I want to do is make a list of all the marker names then pick one
>at random and go to it.

--if you really want a list
on test
  global gMarkerList
  put [] into gMarkerList
  repeat with x = 1 to (the number of lines in the labelList) -1
    add(gMarkerList, line x of the labelList)
  end repeat
  put count (gMarkerList) into X
  put getAt(gMarkerList, random(X)) into Y
  go Y
end

--if you just want to go to a random marker
on test2
  go line random((the number of lines in the labelList)-1) of the 
labelList
end

The problem is, the deceivingly named labelList is not a list. It's a 
text field. Hence, count gives you an error. The -1 in both cases above 
is because the last item in the labelList is a CR, so it's possible to 
get "" from the above if you don't account for it.

Rich Shupe 


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to