
-----------------------------------
aznrex
Fri Jan 13, 2006 10:08 pm

Possible to run more then one command at once
-----------------------------------
What i mean is that, is it possible for turing to be able to run 2 sets of code at once.
what i am trying to create is a "Town Project" which i need to utilize the parallel cable. anyways i wanted to make a trafic light (4way) that switch lights in a regular pattern. But how would i be able to do this while the computer is asking for other commands to be inputed? 

so basicly the trafic lights have to switch lights on regular basis, but would also affect other commands, such as when the light is red the car cant move

is there anyway of doing this?

-----------------------------------
pavol
Fri Jan 13, 2006 10:12 pm


-----------------------------------
you could use the Snip! command to Snip! a procedure that will run things simultaneously

Let's keep him on the right track, here.  No mentioning the f or p words.

-----------------------------------
Cervantes
Fri Jan 13, 2006 10:16 pm


-----------------------------------
Are you drawing this, or using parallelput?

There is no way to execute two sets of code simultaneously.  You can sort of do it, but it's quite a ways off, and you'll be selling your soul to the devil to do it.

Instead, put everything in your loop.  If you don't want your input to pause (assuming you're using getch.  If you're using get, switch to getch ;)), wrap an if hasch around your getch line:


loop
  if hasch then
    getch (ch)
  end if
end loop


-----------------------------------
aznrex
Fri Jan 13, 2006 10:33 pm


-----------------------------------
no actualy i aint gonna use a getch, i am going to use mouse button wait, since i will redraw my physical town into turing. so example if the user press on the car, the car will move, but the problem is it doenst make sense if the car moves while its red light.
also since turing is waiting for the user to input a command everything pauses, that includes my traffic lights, i am actualy building a physical thing that i can use a circuit board to control using the parallel port cables

-----------------------------------
Cervantes
Sat Jan 14, 2006 10:30 am


-----------------------------------
Instead of using Mouse.ButtonWait, use Mouse.Where.  It won't pause your program, and you can do everything you can do with Mouse.ButtonWait.  Using Mouse.Where, you can make a mimic of the Mouse.ButtonWait function that doesn't pause for input.  You'll need to use some boolean variables to store data about the value of the mouse buttons.

-----------------------------------
aznrex
Sat Jan 14, 2006 1:59 pm


-----------------------------------
oo, ok thanks
i will try and see if that works

-----------------------------------
codemage
Mon Jan 16, 2006 12:31 pm


-----------------------------------
Please don't tell people to use Snips!
You'll Snip! up your whole program.
