CLICK HERE FOR BLOGGER TEMPLATES AND MYSPACE LAYOUTS »

Rabu, 29 Juli 2009

KONEKSI VB DENGAN MS.ACCES
1. Masuk ke sebuah folder/drive yang Anda inginkan.
2. Klik kanan di area kosong dan pilih New--> Text Document
3. Kemudian abaikan untuk mengubah namanya (langsung enter saja).
4. Setelah itu, jalankan file text document itu tadi (biasanya akan
masuk ke notepad) dan pilih save as dengan nama file terserah anda
tetapi extensionnya gunakan *.udl
c:/ con.udl
5. Jika berhasil, maka di folder/drive itu akan muncul sebuah file baru
dengan extension udl. (File text document nya bisa anda hapus).
6. Jalankan file *.udl itu. Pada bagian tab "Provider" pilih provider
dengan nama : "Microsoft Jet 4.0 OLE DB Provider" (Ini provider untuk
database Ms Access). Lalu klik tombol Next
7. Pada tab "Connection", silahkan cari database access anda dengan
mengklik tombol browse (...) disebelah kanan. Lalu tekan tombol "Test
Connection", jika berhasil maka akan ada pesan bahwa test koneksi
berhasil, jika tidak biasanya database access yang anda pilih sedang
digunakan (coba tutup dulu saja). Selanjutnya klik tombol OK.
8. Kembali menuju file *.udl yang tadi. Sekarang klik kanan file
tersebut dan pilih Open With --> Notepad.
9. Setelah notepad terbuka anda akan melihat ada 3 baris isi dari file
tersebut. Yang akan anda gunakan untuk menghubungkan VB 6 dengan Ms
Access adalah ada pada baris ke-3. Oleh karena itu silahkan copy seluruh
baris ke tiga tersebut. (Dimulai dari tulisan provider sampai akhir baris).
----------------------------------------------------------
--Coding di VB6--

1. Pada source code vb 6 anda, silahkan pilih menu Project -->
References. Lalu cari "Microsoft ActiveX Data Objects 2.x Library".
Maksud dari 'x' disamping adalah versinya. Biasanya ada v 2.1, 2.2, 2.3,
dst. Saran saya pilih versi dibawah satu versi yang tertinggi. Misal yg
tertinggi 2.6 maka biasanya saya memilih yang 2.5 (Soalnya waktu saya
lihat di bagian Location nya (ada dibagian bawah) yang versi tertinggi
memiliki versi file yang lebih rendah. Misalnya v 2.6 filenya
"msado15.tlb" sedangkan yg v 2.5 filenya "msado25.tlb". Saya sendiri
masih bingung dengan hal ini. Jadi sebaiknya anda memilih satu versi
dibawah versi tertinggi.

2. Kemudian untuk lebih mudahnya, anda bisa tambahkan sebuah modul dalam
source code vb 6 anda. Dan tuliskan coding dibawah ini:
~~~~~~~~~~~~~~~~~Batas Awal Coding~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*Public con As New ADODB.Connection
Public rs As ADODB.Recordset
Public src As String*

*Sub BukaKoneksi()
Set con = New ADODB.Connection
con.Open "(baris ke 3 yang anda copy tadi tanpa tanda kurung)"*

' contohnya : con.open "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=D:\My Documents\My Project\Proyek Keni\db_blackcute.mdb;Persist
Security Info=False"
' untuk flexibilitas program anda, sebaiknya anda pindahkan
database anda menjadi satu folder dengan source code vb6 anda. Jika anda
mengikuti saran saya, maka
' coding untuk koneksi sedikit diubah menjadi :

'* con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
app.path & "\db_blackcute.mdb;Persist Security Info=False*
' dengan demikian dimanapun anda jalankan program anda maka anda
tidak perlu mengkonfigurasi secara manual lokasi databasenya.
*End Sub

Sub buka_rs()
Set rs = New ADODB.Recordset
rs.Open src, con, 1, 3

End Sub*
~~~~~~~~~~~~~~~~~~~~Batas Akhir Coding~~~~~~~~~~~~~~~~~~~~~~~~~~~
3. Setelah coding diatas anda masukkan ke dalam modul. Maka sekarang
anda sudah bisa bermain-main dengan database access anda melalui VB 6.
4. Contoh penggunaannya :

* Private Sub Form_Load()*
*BukaKoneksi* 'untuk membuka jalur komunikasi dengan
database anda

*src = "" * from MsBarang"* 'perintah sql untuk
membuka/memanipulasi tabel pada database anda
*buka_rs* 'menjalankan perintah sql diatas.

*end sub*
5. Jadi yang perlu anda perhatikan dalam coding diatas adalah, sub
"BukaKoneksi" pada modul hanya akan kita letakkan pada Form_Load di
masing-masing form. Sedangkan untuk variabel 'src' dan sub "buka_rs"
bisa anda gunakan dimanapun dalam source code vb 6 anda untuk
membuka/memanipulasi tabel2 yang ada di database anda. Ingat !! variabel
'src' selalu bergandengan dengan sub "buka_rs". Karena sub "buka_rs"
membutuhkan isi dari variabel 'src' untuk melakukan tugasnya.

Rabu, 22 Juli 2009

Ada beberapa definisi tentang arsitektur yaitu sebagai berikut
 Menurut Laundon,Arsitektur informasi adalah bentuk khusus yang
menggunakan teknologi informasi dalam organisasi untuk mencapai tujuantujuan
maupun fungsi-fungsi yang telah dipilih.
 Menurut Zwsas,Arsitektur informasi adalah desain sistem komputer secara
keseluruhan termasuk sistem jaringan untuk memenuhi kebutuhan-kebutuhan
organisasi yang spesifik

Arsitektur Informasi menggunakan arsitektur teknologi dibedakan atas 3 macam yaitu
 Arsitektur tersentralisasi
Arsitektur ini telah dikenal sejak tahun 1960-an dengan mainframe sebagai
faktor utama.Mainframe adalah komputer yang berukuran relatif besaruntuk
menangani data yang berukuran besar dengan ribuan terminal untuk mengakses data
dengan tanggapan yang sangat cepat dan melibatkan jutaan transaksi.
Implementasinya adalah pemrosesan data yang terpusat/komputasi
terpusat.Semua pemrosesan data dilakukan oleh komputer yang ditempatkan didalam
suatu lokasi untuk melayani semua pemakai dalam organisasi

Arsitektur Desentralisasi
Arsitektur desentralisasi merupakan konsep dari pemrosesan data
tersebar/terdistribusi.Sistem pemrosesan data terdistribusi/komputasi tersebar sebagai
sistem yang terdiri atas sejumlah komputer yang tersebar pada berbagai lokasi yang
dihubungkan dengan sarana telekomunikasi dengan masing-masing komputer mampu
melakukan pemrosesan yang serupa secara mandiri,tetapi bisa saling berinteraksi
dalam pertukaran data

Arsitektur Client/Server
Server adalah sistem/proses yang menyediakan data/layanan yang diminta oleh
client.Server dapat berupa komputer (mainframe,mini komputer,workstation,ataupun
PC ) atau piranti lain misalnya printer.
Client mempunyai kemampuan untuk melakukan proses sendiri.Ketika sebuah client
meminta suatu data ke server,server akan segera menanggapinya dengan memberikan
data yang diminta ke client bersangkutanSeteleh diterima client akan melakukan
pemrosesan.Model komputasi yang berbasis client/server terdapat pada sistem
operasi.

Sistem Informasi Manajemen adalah sekumpulan hardware, software, brainware, prosedur dan atau aturan yang diorganisasikan secara integral untuk mengolah data menjadi informasi yang bermanfaat guna memecahkan masalah dan pengambilan keputusan.



Komponen Sistem Informasi

Komponen keras ( Hardware )
Perangkat lunak ( Software ) atau program
Prosedur
Orang
Basis Data ( Database )
Jaringan Komputer dan Komunikasi Data

SISTEM INFORMASI PRIBADI


3 Macam Arsitektur dalam Sistem Informasi
Arsitektur tersentralisasi
Arsitektur terdistribusi
Arsitektur Client / Server

Selasa, 09 Juni 2009

tugASq





















KETERANGAN :

1. Menu bar :menu pilihan yang berupa teks.

2. Menu editor:Menampilkan daftar menu yang berisi daftar perintah-perintah yang dapat
digunakan saat bekerja pada Visual BASIC

3. Classes

4. Form 1 project 1

5. Project - Form 1 (Code)

6. Propertise - Command 1

7. Folder - form

8.Option button

9. Immediate

10.Locals

11. Add watch

12. Form Layout

tugas

Dim NewElement As Integer (membuat variable / elemen baru sebagai integer)Private Sub Form_Click (membuat bentuk klik yang bisa diinput gambar) ()Load Image1(NewElement)Image1(NewElement).Visible = True(menentukan letak gambar)'Image1(NewElement).Top = Image1(NewElement - 1).Top'Image1(NewElement).Left = Image1(NewElement - 1).Left + 495( Menambah komponen dengan berurutan satu persatu)'NewElement = NewElement + 1'==================================================(utk mengatur tmpt ackan dng kode)'For Random Placement use this code:Image1(NewElement).Top = CInt(Form1.Height * Rnd (menentkan ltak ackan))Image1(NewElement).Left = CInt(Form1.Width * Rnd (menentkan ltak ackan))NewElement = NewElement + 1 ( Menambah komponen dengan berurutan satu persatu) '=================================================="End SubPrivate Sub Form_Load (menmplkan pesn sesuai dng properties isi_pesan dan judl_pesn yg di input melalui komponen yg kita buat)()NewElement = 1 (jml komponen yg ditmbahkan secra berurutn)End Sub (mengakhiri)

chapter 6



















he following constants are used to give the lights a certain color
Const Off = &H8000000F
Const Red = vbRed
Const Green = vbGreen
Const Orange = &H80C0FF

'a simple traffic junction of two perpendicular crossing streets
'consists of 4 traffic poles. Each traffic pole has a green, orange
'and red light. There is always just one light on per pole.

'The traffic lights control on one of those junctions has just 4
'statusses. The current status is stored in the variable "Status".
Dim Status As Integer

'The time a status lasts, is derived from the following constants, which
'indicate the time in seconds.
Const TimeForStatus1 = 5
Const TimeForStatus2 = 3
Const TimeForStatus3 = 5
Const TimeForStatus4 = 3

Private Sub SetStatus(ByVal intStatus As Integer)
'Set the status variable to the new status
Status = intStatus

'Turn off all the lights
shpLamp1Groen.FillColor = Off
shpLamp1Oranje.FillColor = Off
shpLamp1Rood.FillColor = Off
shpLamp2Groen.FillColor = Off
shpLamp2Oranje.FillColor = Off
shpLamp2Rood.FillColor = Off
shpLamp3Groen.FillColor = Off
shpLamp3Oranje.FillColor = Off
shpLamp3Rood.FillColor = Off
shpLamp4Groen.FillColor = Off
shpLamp4Oranje.FillColor = Off
shpLamp4Rood.FillColor = Off

'Turn on the appropriate lights with the correct color,
'depending on the current status
Select Case intStatus 'or "Select Case Status", won't make any difference
Case 1
shpLamp1Rood.FillColor = Red
shpLamp2Groen.FillColor = Green
shpLamp3Rood.FillColor = Red
shpLamp4Groen.FillColor = Green

Timer1.Interval = TimeForStatus1 * 1000
Case 2
shpLamp1Rood.FillColor = Red
shpLamp2Oranje.FillColor = Orange
shpLamp3Rood.FillColor = Red
shpLamp4Oranje.FillColor = Orange

Timer1.Interval = TimeForStatus2 * 1000
Case 3
shpLamp1Groen.FillColor = Green
shpLamp2Rood.FillColor = Red
shpLamp3Groen.FillColor = Green
shpLamp4Rood.FillColor = Red

Timer1.Interval = TimeForStatus3 * 1000
Case 4
shpLamp1Oranje.FillColor = Orange
shpLamp2Rood.FillColor = Red
shpLamp3Oranje.FillColor = Orange
shpLamp4Rood.FillColor = Red

Timer1.Interval = TimeForStatus4 * 1000
End Select

'We need to call the following subroutine
RefreshLights
End Sub

Private Sub RefreshLights()
'This subroutine makes sure that de data on the screen is
'displayed correctly
shpLamp1Groen.Refresh
shpLamp1Oranje.Refresh
shpLamp1Rood.Refresh
shpLamp2Groen.Refresh
shpLamp2Oranje.Refresh
shpLamp2Rood.Refresh
shpLamp3Groen.Refresh
shpLamp3Oranje.Refresh
shpLamp3Rood.Refresh
shpLamp4Groen.Refresh
shpLamp4Oranje.Refresh
shpLamp4Rood.Refresh
End Sub

Private Sub Form_Load()
'When the programs starts, it starts with status 1
SetStatus 1
'Initializing the timer will start the timer1_timer subroutine after the
'set interval has elapsed (in milliseconds)
Timer1.Interval = TimeForStatus1 * 1000
End Sub
Private Sub Timer1_Timer()
'Change to the next status
Status = Status + 1
'If the next status is 5 then we need to change it back to one
If Status = 5 Then Status = 1

SetStatus Status
End Sub

soal uts

1.Skrip yang masih tergolong bahasa pemrograman bahasa level Rendah adalah : 0B38:0100 B402

2. Skrip yang masih tergolong bahasa pemrograman bahasa level menengah adalah : Mov AH,02h

3. Skrip yang masih tergolong bahasa pemrograman bahasa level tinggi adalah : Write(‘A’);

4. Berisi Data atau program adalah bagian definisi dari : file

5. Kumpulan instruksi / perintah yang dirangkaian sehingga membentuk suatu proses dinamakan :program

6. Apa yang dimaksud dengan meng-Compile instruksi program yang dibuat : memeriksa program yang telah disusun

7. Flowchart berfungsi sebagai : alat bantu yang berupa simbol – simbol yang saling dihubungkan sehingga dapat menggambarkan alur pikir sebuah program atau permasalahan yang akan diproses dengan progam komputer.

8. Contoh Bahasa Pemrograman Berbasis Teks, kecuali: Visual basic

9. Bahasa Pemrograman Visual Basic memiliki karakter utama yakni event driven yang bermakna : Program menunggu user menjalankan program

10. Berikut yang bukan termasuk Event adalah : Merubah tampilan window

11. Salah satu contoh Properties yakni : Bentuk tampilan di window dapat anda ubah melalui template(cetakan) yang disediakan.

12. Yang dimaksud dengan methode adalah : susunan perintah yang dikerjakan bila event dijalankan

13. Jelaskan tujuan program berikut :
Private Sub Lblnama_DblClick()
Lblnama.caption =“ Saya sedang Belajar Visual Basic”
End Sub
Jika diklik 2 kali maka akan ditampilkan “Saya sedang Belajar Visual Basic.

14. Apa Perbedaan dari Combo Box dengan List Box :Combo box tampilannya hanya satu sedangkan List box menampilkan beberapa pilihan.

15. Property Alignment pada label berfungsi untuk :Mengatur tata letak teks.

16. Tempat dimana kita membuat tampilan (user interface) dari program aplikasi dinamakan :properties

17. Dengan melihat tampilan program diatas,komponen yang dibutuhkan adalah :

18. Dengan melihat gambar diatas, komponen yang ditunjuk oleh label A adalah :

19. Dengan melihat gambar diatas, komponen yang ditunjuk oleh label A adalah :

20. Dengan melihat gambar diatas, komponen yang ditunjuk oleh label A adalah :

Rabu, 01 April 2009

ulaR..













Private Declare Function GetTickCount Lib "kernel32" () As Long 'this function lets us not use timer'timers are bad :)
'main body... each part of the snake has X and YPrivate Type PartX As IntegerY As IntegerEnd Type
'Dynamic array to store part coordinatesDim Part() As Part
'Velocity in X and Y direction of the snakeDim vX As Integer, vY As IntegerDim i As Integer 'for loopsDim CS As Single 'cell size
Dim FX As Integer, FY As Integer 'food coordinatesDim X As Integer, Y As Integer
Dim bRunning As Boolean, died As Boolean
Private Sub Form_Load()Randomize 'random generation
'Initialize controls******************Picture1.BackColor = vbWhitePicture1.ScaleMode = 3 'pixels
CS = 20 'cell size in pixelsX = Int(Picture1.ScaleWidth / CS)Y = Int(Picture1.ScaleHeight / CS)
Picture1.AutoRedraw = TruePicture1.ScaleWidth = X * CSPicture1.ScaleHeight = Y * CS
Me.WindowState = 2Me.Show
DrawGrid Picture1, CS'*************************************
died = False'set up the gameReDim Part(0)Part(0).X = 0Part(0).Y = 0
FX = Int(Rnd * X)FY = Int(Rnd * Y)'go to main loopbRunning = TrueMainLoopEnd Sub
Sub MainLoop()Do While bRunning = True Update Draw WAIT (50) 'increasing this number makes game slowerLoop
Unload MeEnd Sub
Sub Update()'MOVE PARTSFor i = UBound(Part) To 1 Step -1 Part(i).X = Part(i - 1).X Part(i).Y = Part(i - 1).YNext i
'MOVE HEADPart(0).X = Part(0).X + vXPart(0).Y = Part(0).Y + vY
'HAS HE GONE OUT OF BOUNDS ?If Part(0).X <>= X Or Part(0).Y <>= Y Thendied = TrueEnd If
'HAS HE CRASHED INTO HIMSELF ?For i = 1 To UBound(Part)If Part(i).X = Part(0).X And Part(i).Y = Part(0).Y Thendied = TrueEnd IfNext i
'DID HE EAT FOOD ?If Part(0).X = FX And Part(0).Y = FY Then ReDim Preserve Part(UBound(Part) + 1) Part(UBound(Part)).X = -CS Part(UBound(Part)).Y = -CS FX = Int(Rnd * X) FY = Int(Rnd * Y) Form1.Caption = "Parts: " & UBound(Part)End If
'IS HE DEAD ?If died = True Then NewGameEnd Sub
Sub Draw() 'DRAW WHITENESS Rectangle 0, 0, X * CS, Y * CS, vbWhite 'DRAW SNAKE. PARTS IN BLUE, HEAD IN GREEN For i = 1 To UBound(Part) Rectangle Part(i).X * CS, Part(i).Y * CS, Part(i).X * CS + CS, Part(i).Y * CS + CS, vbBlue Next i Rectangle Part(0).X * CS, Part(0).Y * CS, Part(0).X * CS + CS, Part(0).Y * CS + CS, vbGreen 'DRAW FOOD Rectangle FX * CS, FY * CS, FX * CS + CS, FY * CS + CS, vbRed DrawGrid Picture1, CSEnd Sub
Sub Rectangle(X1 As Integer, Y1 As Integer, X2 As Integer, Y2 As Integer, color As Long) Picture1.Line (X1, Y1)-(X2, Y2), color, BFEnd Sub
Sub NewGame()'SET UP NEW GAMEdied = False
ReDim Part(0)Part(0).X = 0Part(0).Y = 0
vX = 0vY = 0
FX = Int(Rnd * X)FY = Int(Rnd * Y)End Sub
Sub DrawGrid(Pic As Control, CS As Single) '************************************************************************** 'DRAW GRID '************************************************************************** Dim i As Integer, Across As Single, Up As Single Across = Pic.ScaleWidth / CS Up = Pic.ScaleHeight / CS For i = 0 To Across Pic.Line (i * CS, 0)-(i * CS, Up * CS) Next i For i = 0 To Up Pic.Line (0, i * CS)-(Across * CS, i * CS) Next iEnd Sub
Sub WAIT(Tim As Integer) '************************************************************************** 'WAIT FUNCTION '************************************************************************** Dim LastWait As Long LastWait = GetTickCount Do While Tim > GetTickCount - LastWait DoEvents LoopEnd Sub
Private Sub Picture1_KeyDown(KeyCode As Integer, Shift As Integer)'USER KEYPRESSES HANDLED HERESelect Case KeyCodeCase vbKeyRightvX = 1vY = 0Case vbKeyLeftvX = -1vY = 0Case vbKeyUpvX = 0vY = -1Case vbKeyDownvX = 0vY = 1End SelectEnd Sub
Private Sub Picture1_KeyPress(KeyAscii As Integer)'27 is ESC. IF user presses ESC, QUITIf KeyAscii = 27 Then bRunning = FalseEnd Sub
Private Sub Form_Unload(Cancel As Integer)'This function can be left outEndEnd Sub

kalEnder...













Option ExplicitDim days As Long '<-Stores the number of days elapsed from 1/1/1900 to current month and yearDim i As Integer
Private Sub cmdGenerate_Click()On Error GoTo Error_handle 'On error, goto to end of functiondays = 0For i = 0 To 34 Label1(i).Caption = "" 'Clear all the labelsNext i
For i = 1900 To txtYear.Text - 1 If i Mod 4 = 0 Then 'If leap year then count 366 days days = days + 366 Else 'else 365 days days = days + 365 End IfNext i
For i = 1 To txtMonth.Text - 1 If i = 1 Or i = 3 Or i = 5 Or i = 7 Or i = 8 Or i = 10 Or i = 12 Then 'For January,March,May....,December count 31 days days = days + 31 ElseIf (i = 4 Or i = 6 Or i = 9 Or i = 11) Then 'For April,June,September,November count 30 days days = days + 30 ElseIf (i = 2 And txtYear.Text Mod 4 = 0) Then 'If month is February and year is leap year count 29 days days = days + 29 Else 'If month is February and year is not a leap year, count 28 days days = days + 28 End If Next i
If (i = 1 Or i = 3 Or i = 5 Or i = 7 Or i = 8 Or i = 10 Or i = 12) Then show_calender 31 'Show calender with 31 days ElseIf (i = 4 Or i = 6 Or i = 9 Or i = 11) Then show_calender 30 'Show calender with 30 days ElseIf (i = 2 And txtYear.Text Mod 4 = 0) Then show_calender 29 'Show calender with 29 days Else show_calender 28 'Show calender with 28 days End IfError_handle:End Sub
Private Function show_calender(n As Integer) '//<- n stores the number of days to displayDim i, k As Integerk = days Mod 7 'Divide days with 7, the remainder give the current dayFor i = 1 To n Label1(k).Caption = i 'Display the number in calender format k = k + 1 If k = 35 Then k = 0Next iEnd Function

chapter 3..















Option Explicit

Private Hasil As Double
Private Const opNol = 0
Private Const opTambah = 1
Private Const opKurang = 2
Private Const opKali = 3
Private Const opBagi = 4
Private Operator As Integer
Private NilaiBaru As Boolean

' untuk menghapus karakter terakhir
Private Sub Hapus()
Dim txt As String
Dim min_len As Integer

txt = txtDisplay.Text
If Left$(txt, 1) = "-" Then
min_len =
2
Else
min_len =
1
End If


If Len(txt) > min_len Then
txtDisplay.Text = Left$(txt, Len(txt) - 1)
Else
txtDisplay.Text = "0"
End If
End Sub

' hapus angka, hasil terakhir dan operator

Private Sub cmdClear_Click()
cmdClearEntry_Click
Hasil = 0
Operator = opNol

End Sub

' hapus angka
Private Sub cmdClearEntry_Click()
txtDisplay.Text = ""
End Sub

' menambahkan koma (desimal)
Private Sub cmdKoma_Click()
If InStr(txtDisplay.Text, ".") Then
Beep
Else

If NilaiBaru Then
txtDisplay.Text = "."
"
NilaiBaru = False


Else
txtDisplay.Text = txtDisplay.Text & "."
End If
End If
End Sub

' Menghitung
Private Sub cmdSamaDengan_Click()
Dim HasilBaru As Double

If txtDisplay.Text = "" Then
HasilBaru = 0
Else

HasilBaru = CDbl(txtDisplay.Text)
End If
Select Case Operator


Case opNol
Hasil = HasilBaru
Case opTambah
Hasil = Hasil + HasilBaru
Case opKurang
Hasil = Hasil - HasilBaru
Case opKali


Hasil = Hasil * HasilBaru
Case opBagi
'Tidak bisa dibagi nol


If HasilBaru = 0 Then
MsgBox "Tidak bisa dibagi 0", vbOKOnly + vbCritical, "Kalku ERROR"
Call cmdClear_Click
Else
Hasil = Hasil / HasilBaru
End If

End Select
Operator = opNol
NilaiBaru = True
txtDisplay.Text = Format$(Hasil)


End Sub


' menuliskan angka
Private Sub cmdAngka_Click(Index As Integer)


If NilaiBaru Then
txtDisplay.Text = Format$(Index)
NilaiBaru = False


Else
txtDisplay.Text = _
txtDisplay.Text & Format$(Index)
End If
End Sub

' tombol tambah/kurang/bagi/kali
Private Sub cmdOperator_Click(Index As Integer)


cmdSamaDengan_Click

Operator = Index

NilaiBaru = True
End Sub

' merubah tanda +/-
Private Sub cmdPlusMinus_Click()
If NilaiBaru Then
txtDisplay.Text = "-"
ElseIf Left$(txtDisplay.Text, 1) = "-" Then
txtDisplay.Text = Right$(txtDisplay.Text, 2)
Else


Artikel Populer IlmuKomputer.Com
Copyright © 2005 IlmuKomputer.Com

txtDisplay.Text = "-" & txtDisplay.Text
End If
End Sub

' filter untuk angka saja yg dapat diketikkan
Private Sub Form_KeyPress(KeyAscii As Integer)
txtDisplay_KeyPress KeyAscii
End Sub

Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
txtDisplay_KeyUp KeyCode, Shift
End Sub

' supaya kursor tetap di kanan
Private Sub txtDisplay_Change()
txtDisplay.SelStart = Len(txtDisplay.Text)
End Sub

Private Sub txtDisplay_GotFocus()
txtDisplay_Change
End Sub

' untuk mengetikkan angka di keyboard
Private Sub txtDisplay_KeyPress(KeyAscii As Integer)
Dim ch As String

ch = Chr$(KeyAscii)
Select Case ch
Case "0"
cmdAngka_Click
0
Case "1"
cmdAngka_Click
1
Case "2"
cmdAngka_Click
2
Case "3"
cmdAngka_Click
3
Case "4"
cmdAngka_Click
4
Case "5"
cmdAngka_Click
5
Case "6"
cmdAngka_Click
6
Case "7"
cmdAngka_Click
7
Case "8"
cmdAngka_Click
8
Case "9"
cmdAngka_Click
9
Case "*", "x", "X"
cmdOperator_Click opKali
Case "+"
"
cmdOperator_Click opTambah
Case vbCrLf, vbCr, "="
"

cmdSamaDengan_Click
Case "-"
"
cmdOperator_Click opKurang
Case "."
"
cmdKoma_Click
Case "/"
"
cmdOperator_Click opBagi
Case "C", "c"
cmdClearEntry_Click
End Select


KeyAscii = 0
End Sub

' untuk ketikan angka di numpad
Private Sub txtDisplay_KeyUp(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyNumpad0
cmdAngka_Click 0
Case vbKeyNumpad1
cmdAngka_Click 1
Case vbKeyNumpad2
cmdAngka_Click 2
Case vbKeyNumpad3
cmdAngka_Click 3
Case vbKeyNumpad4
cmdAngka_Click 4
Case vbKeyNumpad5
cmdAngka_Click 5
Case vbKeyNumpad6
cmdAngka_Click 6
Case vbKeyNumpad7
cmdAngka_Click 7
Case vbKeyNumpad8
cmdAngka_Click 8
Case vbKeyNumpad9
cmdAngka_Click 9
Case vbKeyMultiply
cmdOperator_Click opKali
Case vbKeyAdd
cmdOperator_Click opTambah
Case vbKeySeparator
cmdSamaDengan_Click
Case vbKeySubtract
cmdOperator_Click opKurang
Case vbKeyDivide
cmdOperator_Click opBagi
Case vbKeyDecimal
cmdKoma_Click
Case vbKeyBack, vbKeyDelete

Hapus

End Select

KeyCode = 0
End Sub


Private Sub Text1_Change()

End Sub

chapter 2..

chapter 1..