Mau share tugas kuliahku,, simple aja sih,, buat pemula yang baru memakai Visual Basic.. Semoga berguna bagi kalian semua,,
ini script untuk membalikkan kata yang kita inputkan..
Script kodenya:


Public Function balik_kata(ByVal x As String) As String

Dim n, p As Integer

Dim kata As String

p = Len(x)

For n = 1 To p

kata = kata & Left(Right(x, n), 1)

Next n

balik_kata = kata

End Function

Private Sub Command1_Click()

Dim kata2() As String

Dim i As Integer

Dim revKata As String

kata2 = Split(Text1.Text, Chr(32))

For i = LBound(kata2) To UBound(kata2)

kata2(i) = balik_kata(kata2(i))

revKata = revKata + ” ” + kata2(i)

Next i

Text2.Text = LCase(revKata)

End Sub

Private Sub Command2_Click()

End

End Sub

Private Sub Text1_click()

Text1.Text = “”

Text2.Text = “”

End Sub

ini hasil printscreen nya

January 10, 2011 at 4:10 pm by oris
Category: belajar VB
Tags: , ,