Welcome to my blog..

Feel free to read/copy anything and please put the reference link to original source.
Share your blog link at the bottom of this page.

my sharing server : http://172.25.169.224/
How to download : http://rionix88.blogspot.com/2011/04/rionix-sharing.html
Other Sharing site : http://rionix88.blogspot.com/2011/01/ump-sharing-links-2.html

buat duit : http://rionix88.blogspot.com/2011/01/buat-ump-sharing-buat-duit.html

How to build server : http://rionix88.blogspot.com/2011/01/kaedah-membuat-ump-sharing-server.html
Showing posts with label programming. Show all posts
Showing posts with label programming. Show all posts

25 August 2009

VB : Error_handler

Kenkadang kalau korang run prog pastu masukkan tulisan, nnt die kuar error tahape2 yang korang x paham kan? Utk elakkan camtu, kite wat error_handler

Private Sub Command1_Click()
On Error GoTo error_handler
'(lepas command click tu masukkan error_handler)

'sini korang nyer coding2 merepek tu

Exit Sub 'To prevent error handling even the inputs are valid
error_handler:
MsgBox "The input is not a number! Try again!", vbExclamation
End Sub

'(sebelum end sub tu korang masukkan exit sub, pastu masukkan error_handler korang)



rionix ~ tadi lupe nk copy acap nyer programming time nk anta esemen 1 td.. haha..

21 August 2009

VB6 : Reaction Calculation (case 3)


3 textbox, 2 label, 1 button

Private Sub Command1_Click()
Dim a, b As Single
Dim c, d As Integer

'Dalam satu declare leh ada dua nama je, kalo lebih buat declaration baru.

a = (Text2.Text) 'length 1
b = (Text3.Text) 'length 2
d = a + b 'total length
c = Text1.Text * Text2.Text

Label2.Caption = (c / d) 'reaction b
Label1.Caption = (Text1.Text) - (Label2.Caption)
End Sub

---
Data yg boleh dimasukkan dlm kotak input cuma single (sbb korg declare single)
kalau data lain kuar error.

16 August 2009

Reaction Calculation

Aku tengah bosan



Buat satu input textbox (Force), satu segitiga, satu garis, dua jarak L, dua reaction RAy (Label1), RBy (Label2), Dan butang utk calculate.

---
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim num3, num4 As Single
num3 = Force.Text
num4 = num3 / 2
Label1.Text = num4
Label2.Text = num4
End Sub
---


"Tadah!!" Program yg simple ni menandakan aku malas wat kompleks2.

Blog Exchange