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

Username:   Password: 
 RegisterRegister   
 Delays
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Mr. T




PostPosted: Sun Jan 30, 2005 3:52 pm   Post subject: Delays

How do you cancel a delay?
Sponsor
Sponsor
Sponsor
sponsor
Neo




PostPosted: Sun Jan 30, 2005 3:59 pm   Post subject: (No subject)

What do you mean cancel? Confused
If you mean take out the delay while the program is running then you could put the delay inside an if statement.
Mr. T




PostPosted: Sun Jan 30, 2005 4:08 pm   Post subject: (No subject)

ya sorry, can u give me an example of using an if statement to stop a delay?
basketball4ever




PostPosted: Sun Jan 30, 2005 4:16 pm   Post subject: (No subject)

Pwned wrote:
ya sorry, can u give me an example of using an if statement to stop a delay?


hmm... why would you want a delay to stop. You can set the delay right... so why would you want it to stop while the program in running... can you give like a piece of code so i can see what you're trying to do
person




PostPosted: Sun Jan 30, 2005 4:25 pm   Post subject: (No subject)

u can probably do:

if (something) then
x := 0
end if
delay (x)
Mr. T




PostPosted: Sun Jan 30, 2005 4:38 pm   Post subject: (No subject)

basketball4ever wrote:
Pwned wrote:
ya sorry, can u give me an example of using an if statement to stop a delay?


can you give like a piece of code so i can see what you're trying to do



<<anything above needs a delay of 10>>
delay (10)
cls
delay (0)
<<anythinmg below needs no delay>>
basketball4ever




PostPosted: Sun Jan 30, 2005 4:45 pm   Post subject: (No subject)

k ...
so
code:
% all your code before that
var num:int
get num
if num >10 then
delay(10)
%you don't need an else delay (0) cos... thats like  :? :P
end if

that should work fine.
Cervantes




PostPosted: Sun Jan 30, 2005 4:51 pm   Post subject: (No subject)

Is this inside a loop? If so, chances are you should only have one delay.
Sponsor
Sponsor
Sponsor
sponsor
[Gandalf]




PostPosted: Mon Jan 31, 2005 5:33 pm   Post subject: (No subject)

How about this question:
How would you let the user input something while a delay is running?
Cervantes




PostPosted: Mon Jan 31, 2005 5:50 pm   Post subject: (No subject)

You don't. A delay is like getch: it halts the program until it's done. So, while the delay is on, the program is halted. Thus, you can't be running an Input.KeyDown line while the delay is on.
1337_brad




PostPosted: Mon Jan 31, 2005 6:31 pm   Post subject: But...

But a get statement would do the trick... it would delay until the user inputs a value.. or if you need the delay set to a specific time you could have the get statement and then the delay like so:
code:

var theget : string


put "enter something here"
get theget
Time.Delay(10)
ssr




PostPosted: Mon Jan 31, 2005 8:37 pm   Post subject: (No subject)

How about just hasch
however, I got a question
ok how would u like enter a cheat while the program is running
like you can make teh program run
but if u enter something, it wont show, but it will print do the cheat after the code is fully entered
1337_brad




PostPosted: Mon Jan 31, 2005 9:23 pm   Post subject: You would have to...

Do it with processes... and then fork them, so that the game, and the getcheat command can run at the same time...
ssr




PostPosted: Mon Jan 31, 2005 9:31 pm   Post subject: (No subject)

Quote:

Do it with processes... and then fork them, so that the game, and the getcheat command can run at the same time...

oh ya Thanx man, 1337_brad
helped out a lot
basketball4ever




PostPosted: Mon Jan 31, 2005 10:41 pm   Post subject: (No subject)

ssr wrote:
Quote:

Do it with processes... and then fork them, so that the game, and the getcheat command can run at the same time...

oh ya Thanx man, 1337_brad
helped out a lot


do note that processes will cause alot of trouble.... you might wanna stay away from em... if i were you, i would just use a cheat menu...
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 2  [ 18 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: