Home Project Folders Resources How Do I? MWForum
Site Map Search Our Team

MWForum Message [Date Index] [Threads] [Authors] [Attachments] [Subscribe]

[Thread Prev] [Thread Next]

To: mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Subject: Re: Placing data into Setpos [ ]
From: Alain LCSI <alain@xxxxxxx>
Date: Sun, 18 Feb 2007 11:07:17 -0500

Hi!

Setpos wants a list as input:
setpos [100 100]

If the position is determined by variables, you cannot enclose the variables within brackets. You have to "build" the list using your variables:
setpos se :a :b
se means sentence. It takes the two inputs :a :b and builds a sentence (a list, really). That being done, it passes the resulting list to setpos, who will be happy with this.


Other examples of constructions:

setpos se (xcor + 10) ycor
setpos se (:a + 1) (:b + 1)
setpos ask "t1 [pos]
setpos se (ask "t1 [xcor]) ycor
setpos se (xcor + slider1) (ycor + slider2)

The parenthesis here are just playing cute, but sometimes they are required to "force" a proper parsing of the instruction. Get used to using them.

Other options:
check setpos in Help/ Vocabulary

Alain Tougas
alain@xxxxxxx




Le 07-02-18 à 00:54, rwege@xxxxxxxxxxxxxxxxxxxxxxx a écrit :

Hi mwforum,

I am working on Dynaturtle, which is a spacecraft simulation
wherein the turtle drifts independent of the heading and it
responds to "kicks" of the engine in the back. Speed and
direction are controlled by the force vector produced by the
engine. I am translating an old Apple II version of this into
Microworlds EX and  some commands have changed, Setpos being one.
It used to be SETXY. It uses XCOR AND YCOR to develop data for
setting the position of the turtle at any point in time. I am not
able to make SETPOS take any data though. It will not accept
variables. For instance, it won't take SETPOS [:A :B], nor will
it take SETPOS [XCOR YCOR].
The question is: What is the syntax for getting data into the
SETPOS [] command?

Ralph Wege








  • Previous by thread: Placing data into Setpos [ ]
  • Next by thread: Re: Placing data into Setpos [ ]

  • To save an attachment to your computer, PC users should right-click (Mac users, click and hold the mouse button) on the link and then choose 'save target as' from the pop-up menu. A window will then pop up in which you can choose a location for the file.


    © copyright 2001 - 2006