Programming Question

Anything and Everything about Uplink

Moderators: bert_the_turtle, jelco, Chris, Icepick, Rkiver

CyberGenesis
level2
level2
Posts: 125
Joined: Mon Feb 23, 2004 12:46 am
Location: Wisconsin

Postby CyberGenesis » Sun Feb 29, 2004 9:13 pm

How the hell do you do delays in vb?
User avatar
Starfyre
level5
level5
Posts: 3247
Joined: Sat Jun 29, 2002 3:00 pm
Location: in the tree house

Postby Starfyre » Sun Feb 29, 2004 9:22 pm


Private Sub Command1_Click()
Call Sleep(txtTime)
End Sub


Tadah.
CyberGenesis
level2
level2
Posts: 125
Joined: Mon Feb 23, 2004 12:46 am
Location: Wisconsin

Postby CyberGenesis » Sun Feb 29, 2004 10:00 pm

EDIT: nvm...i got it

(Edited by CyberGenesis at 3:20 pm on Feb. 29, 2004)
ODDin
level5
level5
Posts: 2521
Joined: Fri Jul 04, 2003 10:44 pm
Location: Haifa, Israel
Contact:

Postby ODDin » Sun Feb 29, 2004 10:20 pm

You create a timer, and make its interval the time you need to wait. In the code of the timer, you insert what you need to do after the delay, and when you want to start the delay, you activate the timer.
There's another option (I prefer to use this), but it requiers your code to be a procedure. You make a boolean paramter. If it's false, you run part (a), and activate the timer. In the timer, you call back that procedure, defining the parameter as true - thus activating part (b).

It's annoying, I agree. I believe there is a way to freeze the program - only problem that it freezes the whole system, and that's... well, bad.
CyberGenesis
level2
level2
Posts: 125
Joined: Mon Feb 23, 2004 12:46 am
Location: Wisconsin

Postby CyberGenesis » Sun Feb 29, 2004 10:56 pm

im using a module with this in it:

Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

yeah...it halts it but...i have no sounds so i couldn't care less as long as it works

Return to “General”

Who is online

Users browsing this forum: Google [Bot] and 1 guest