Tuo IP: 54.90.127.10  
Cerca nel sito:
Home Ansi C ASP HTML Java JavaScript Visual Basic C++ JSP VB.Net
Altri linguaggi
* AppleScript
* Assembler MIPS
* Fortran
* Lisp
* Pascal
* Perl
* Python
* SQL
* VBScript
* VBA

Servizi
* Tips
* Tools
* Webmasters
* Domini e Posta

Articoli tecnici
* Oracle Sequence
* Java Servlet
* Compressione File
* Le Socket di Berkeley
* Immagini x PC
* Errori di Email
* Flash del BIOS
* No Banner
* Codici a barre
* Codici Colori
* Estensione domini
* Connessione ODBC
* Tabella Codici ASCII
* Tabella ISO-8859-1
Altro su Tips
Varie. Delay a VB program without using the API
Versione Stampabile
Stampa
Torna Indietro
Linguaggio: Visual Basic Autore: James Wilson Data Archiviazione: 14/07/1999


Here is a way to delay an event or even stop everything for any amount of time. To delay an event and let windows handle other stuff use this code:

Public Sub Delay(HowLong as date)
TempTime=DateAdd("s", HowLong, Now)
While TempTime > Now
DoEvents 'Allows windows to handle other stuff
Wend
End Sub
Or if you don't want windows to handle other background stuff use this code:

Public Sub Delay(HowLong as date)
Dim TempTime as Date
TempTime=DateAdd("s", HowLong, Now)
While TempTime > Now
Wend
End Sub
So, to make the program wait for 5 seconds use the following code:

Delay 5
'other code here that will not be done
'until after the delay
© 1998, Jammer Ltd.





Note: (Nessuna)
Codice testato con: Visual Basic Versione: 6.0 (Service Pack 5)
Sito Produttore: http://www.microsoft.com/
--------
Guide
PDF
* Hardware
* Guida all'MS DOS
* Storia di Internet
* Usabilità siti Web
* Programmazione Linux (6.852 KB)
* Scripting Shell Bash
* Ansi C
* Java 2

Ordinamenti
* Bubble Sort
* Insertion Sort
* Merge Sort
* Quick Sort
* Selection Sort
* Shell Sort
(La visualizzazione degli esempi richiede Virtual Java Machine)



Miscellanea
* Download
* Conversioni misure
* Glossario
* Siti lavoro

Chi c'è online
In questo momento ci sono 20 Visitatori