Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 processes
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
shoobyman




PostPosted: Tue Nov 21, 2006 6:38 pm   Post subject: processes

I was just wondering if you can have something running in the background and waiting for a get statement simultaneously without using a process (cuz i tried and it messed it up really badly.)

btw, it is because i am trying to get matrix text to run in the background while the user is entering text
Sponsor
Sponsor
Sponsor
sponsor
DKNiGHTX




PostPosted: Tue Nov 21, 2006 7:56 pm   Post subject: (No subject)

Well, if you need help using a process, here is some example code which you can stick your matrix function in to apply it. I just used a very annoying prompt for this example. (It uses a process to demonstrate how to use them)

code:
View.Set ("graphics:max;max")

var Stop := false
var userName : string := ""

process myProcess ()

    const TEMP_FONT := Font.New ("Impact:20")
   
    loop
   
        Font.Draw ("Enter something kthx", Rand.Int (-100, maxx), Rand.Int (0, maxy div 3), TEMP_FONT, black)
        Time.DelaySinceLast(80)
        exit when (Stop)
       
    end loop
   
    Font.Free (TEMP_FONT)
    Draw.FillBox (0, maxy div 2, maxx, 0, white)
   
end myProcess

put "Please enter your username.  " ..

fork myProcess () %This starts our process

get userName : *

Stop := true

put "Thankyou!"
ericfourfour




PostPosted: Tue Nov 21, 2006 8:27 pm   Post subject: (No subject)

Let's not get hasty here. Processes should not be used for a task like this. Look up Input.hasch and Input.getchar. That way you can simply check if there is input in the buffer and if there is you can get it. If there is not you do not have to get it. If you are curious hasch stands for "has character" and getchar stands for "get character".
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: