0% found this document useful (0 votes)
18 views3 pages

Looping (Perulangan) : Do Loop

The document discusses three types of looping in programming: Do loops, For-Next loops, and While-End While loops. It provides examples of code for each loop type that clears a list box and then adds the numbers 1 through 10 to demonstrate how each loop works. The code examples show initializing a counter variable, incrementing it each loop, and using it as a condition to determine when to exit the loop.

Uploaded by

Anggi Purwansyah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views3 pages

Looping (Perulangan) : Do Loop

The document discusses three types of looping in programming: Do loops, For-Next loops, and While-End While loops. It provides examples of code for each loop type that clears a list box and then adds the numbers 1 through 10 to demonstrate how each loop works. The code examples show initializing a counter variable, incrementing it each loop, and using it as a condition to determine when to exit the loop.

Uploaded by

Anggi Purwansyah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

LOOPING (PERULANGAN)

- Do Loop
- For Next
- While E While

Do Loop
Desain :

Setting Properties :
- Button Proses : Name = BP
- Listbox1 : Name = Listbox1

Proses :
Double klik pada button Proses, lalu masukkan :
Dim i As Integer
i = 1

ListBox1.Items.Clear()
Do Until i > 10
ListBox1.Items.Add(i)
i = i + 1
Loop
Selesai

For Next
Desain :
Setting Properties :
- Button Proses : Name = BP
- Listbox1 : Name = Listbox1

Proses :
Double klik pada button Proses, lalu masukkan :
Dim i As Integer
ListBox1.Items.Clear()
For i = 1 To 10
ListBox1.Items.Add(i)
Next

Selesai

While E While
Desain :
Setting Properties :
- Button Proses : Name = BP
- Listbox1 : Name = Listbox1

Proses :
Double klik pada button Proses, lalu masukkan :
Dim i As Integer
i = 1

ListBox1.Items.Clear()
While i <= 10
ListBox1.Items.Add(i)
i = i + 1
End While
Selesai

You might also like