Move to the points

-hh hh at hh.on-rev.com
Wed Jul 27 12:14:33 EDT 2016


This kind of a points list is a typical application for "repeat with ..
step",
we had it here recently ...

on mouseUp
   repeat with j=0.1 to 12.5 step 0.1
    put cr & (sin(j)*cos(j)*300 + 400, cos(j)*300 + 400) after pts
  end repeat
  set points of grc "g1" to char 2 to -1 of pts
end mouseUp

Richmond wrote
> Usual nonsense: replying to my own postings:
> 
> The problem lies in my relying on put (KOUNT * 10) into LYNE
> 
> to supply me with continuous line numbers for my listField, now sorted
> out:
> 
> on mouseUp
>     put empty into fld "f1"
>     put 0.1 into KOUNT
>     put 1 into LYNE
>     repeat until KOUNT > 12.6
>        put ( ( ((sin (KOUNT)) * (cos (KOUNT)) ) * 300) + 400) into LR
>        put ((((cos (KOUNT)) ) * 300) +400) into TB
>        put (LR & "," & TB) into line LYNE of fld "f1"
>        add 0.1 to KOUNT
>        add 1 to LYNE
>     end repeat
>     set the points of grc "c1" to fld "f1"
> end mouseUp
> 
> The IDE did not help with its cryptic message.
> 
> R.
> 
> 
> On 27.07.2016 16:46, Richmond wrote:
>> Of course part of this could be the problem that my initial curve 
>> generation script leaves empty lines in
>>
>> the listField that contains the points of the curve.
>>
>> R.
>>
>>
>> On 27.07.2016 16:44, Richmond wrote:
>>> So I have a graphic object generated like this:
>>>
>>> on mouseUp
>>>    put empty into fld "f1"
>>>    put 0.1 into KOUNT
>>>    repeat until KOUNT > 12.6
>>>       put (KOUNT * 10) into LYNE
>>>       put ( ( ((sin (KOUNT)) * (cos (KOUNT)) ) * 300) + 400) into LR
>>>       put ((((cos (KOUNT)) ) * 300) +400) into TB
>>>       put (LR & "," & TB) into line LYNE of fld "f1"
>>>       add 0.1 to KOUNT
>>>    end repeat
>>>    set the points of grc "c1" to fld "f1"
>>> end mouseUp
>>>
>>> (where grc "c1" is a pre-existing graphic)
>>>
>>> and a button containing this:
>>>
>>> on mouseUp
>>>    move grc "g1" to the points of grc "c1" in 10 seconds
>>> end mouseUp
>>>
>>> and all should be fine, but it isn't, because on attempted execution 
>>> of the button I get this:
>>>
>>> "button "GO": execution error at line 2 (move: end point is not a 
>>> point), char 21".
>>>
>>> All very mysterious, Richmond.
>>>
>>> P.S. Before Mark, Jacque or Richard try it; there is a comma before 
>>> my name!
>>>
>>
> 
> 
> _______________________________________________
> use-livecode mailing list

> use-livecode at .runrev

> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/Move-to-the-points-tp4707028p4707036.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list