STUDI FORUM
Would you like to react to this message? Create an account in a few clicks or log in to continue.

PERULANGAN DI VB

Go down

PERULANGAN DI VB Empty PERULANGAN DI VB

Post  Admin Mon Apr 16, 2012 11:29 am

ternyata perulangan di vb tu gak sesulit yang pernah gue pikirin dulu mungkin karena kebanyakan pikiran jadi dulu gue waktu belajar vb paling anti dengan perulangan karena buat gue bingung, .. ini logika nya
Syntax Do… Loops
Digunakan sebagai statemen perulangan.

Syntax 1 :
Do Until (Expression)
(code to execute)
Loop
Contoh :
Dim x as Integer
x=0
Do Until x = 50
x = x+1
Loop

Syntax 2 :
Do While (expression)
(code to execute)
Loop
Contoh :

Dim x as Integer
Do While x = 100
x = x+1
Loop

Syntax 3 :
Do
(code to execute)
Loop While (expression)
Contoh :

Dim x as Integer
Do
x = x+1
Loop While x = 100

Syntax For… Next

Syntax dasar :
For counter = start To end [ step step ]
(code to execute)
Next [ counter ]
CONTOH :
for i = 1 to 10
msgbox ("halo dehasen", & i)
next i
Admin
Admin
Admin

Jumlah posting : 20
Join date : 12.04.12

https://studi.indonesianforum.net

Kembali Ke Atas Go down

Kembali Ke Atas


 
Permissions in this forum:
Anda tidak dapat menjawab topik