
-----------------------------------
Taur
Wed Dec 14, 2005 6:10 pm

Get that doesn't pause
-----------------------------------
is there a way to use get without pausing everything else? I tried making a procedure and then calling get in it, but it still pauses it. the only other way I can think of is making a new get procedure by using keys and stuff, I could do it but I was wondering if there was an easier way?

-----------------------------------
pkchris
Wed Dec 14, 2005 6:26 pm


-----------------------------------
Maybe if you put it in a process then used fork.


process getpro
get whatever
end getpro
fork getpro


-----------------------------------
Taur
Wed Dec 14, 2005 6:31 pm


-----------------------------------
I don't understand that fork does :?

-----------------------------------
pkchris
Wed Dec 14, 2005 6:36 pm


-----------------------------------
"Fork" just makes a process run seperate so that you can have other stuff going on at the same time. Check out Turing Help for more info.  :wink:

-----------------------------------
Paul
Wed Dec 14, 2005 6:55 pm


-----------------------------------
The general concensus is to avoid using processes and forks in your programs.
read up on the Input.KeyDown then F9 (turing's reference).

-----------------------------------
Taur
Wed Dec 14, 2005 7:16 pm


-----------------------------------
what has that got to do with using a get that doesn't pause?

-----------------------------------
Paul
Wed Dec 14, 2005 7:28 pm


-----------------------------------
Perhaps if you'd read the tutorial, its about input. What is get? its input.
Check out this old input without pausing the game. Get it?

-----------------------------------
Taur
Wed Dec 14, 2005 7:35 pm


-----------------------------------
I aldready considered that and I posted in my title, it would take a bit of coding and 1 line would be much easier if not much more efficient, but I guess it's the only way

-----------------------------------
md
Wed Dec 14, 2005 8:12 pm


-----------------------------------
easy and how you do something aren't always the same. So what if it's more then one line, write a procedure! You probably should be doing so anyways. If you ask for help don't complain because the answers given are "too hard" or are "more then a line".

-----------------------------------
Taur
Wed Dec 14, 2005 8:47 pm


-----------------------------------
sorry but I was looking for a build in turing procedure because mine might be less efficient..

-----------------------------------
Paul
Wed Dec 14, 2005 8:54 pm


-----------------------------------
Its ok.
But you have to realize that turing is not meant for that sort of thing. Turing is a learning language, where you should build everything from scratch, and you're only given a few things for you to work with.

Things like C++ have huge amounts pre-made things that comes in its libraries.

Have fun being creative!  :D

-----------------------------------
Taur
Thu Dec 15, 2005 8:02 pm


-----------------------------------
okay thx

I finished it, it works pretty good with the exception of the little black boxy thingy :P but yah thx for everything

-----------------------------------
Albrecd
Tue Dec 20, 2005 9:19 am


-----------------------------------
Or, A much simpler way would be to use:

 var input : char

put "Please Type A Letter"
input := getchar
put "Your Letter Was: ",input


-----------------------------------
Cervantes
Tue Dec 20, 2005 1:50 pm


-----------------------------------
Hmm? That still pauses.
If you want to use getch/getchar, you need to wrap it in an if hasch statement:

var input := ""
for i : 0 .. maxx
    if hasch then
        input += getchar
    end if
    locate (1, 1)
    put input
    Draw.Dot (i, 50, black)
    delay (10)
end for

Although, this would be better if instead of having a delay, you had a loop that accepted input.  (Think: what happens if you press a key while the delay is on, then lift the key before the key is lifted?)

var input := ""
var time_enter : int

for i : 0 .. maxx
    time_enter := Time.Elapsed
    loop
        if hasch then
            input += getchar
        end if
        exit when Time.Elapsed - time_enter >= 10
    end loop
    locate (1, 1)
    put input
    Draw.Dot (i, 50, black)
end for

