Rabu, 27 Juli 2011

PROGRAM MULTI APLIKASI

Dalam program multi aplikasi ini kami tidak akan membuat proses program di dalam masing-masing form, karena yang menjadi inti pembicaraan adalah bagaimana cara membuat sebuah aplikasi yang terdiri dari beberapa project. Setelah anda memahami cara pembuatannya silakan anda mengembangkan program ini sesuai dengan kebutuhan sistem anda. Misalnya dalam aplikasi sistem akadamik, project dapat dibagi menjadi tiga bagian yaitu :
• Project penerimaan siswa baru
• Project pengolahan data nilai siswa
• Dan project pembayaran SPP

Membuat Project Induk

1. Buatlah sebuah project baru sebagai project induk
2. Ganti nama form1 dengan nama MenuUtama

Membuat Project Anak (Pertama)

3. Tambah project baru (Klik menu file >> add Project)
4. Klik Open
5. Tambah 2 buah form (klik menu project >> Add Form)
6. Di project kedua, Form1 ganti nama dengan menupembelian

 7. Di project kedua, Form2 ganti nama dengan pemasok

 Membuat Project Anak (Kedua)

8. Tambah project baru (klik menu file >> add Project)
9. Tambah 2 buah form
10. Di project ketiga, Form1 ganti nama dengan menupenjualan
11. Di project ketiga, Form2 ganti nama dengan pelanggan
 Mengubah Properti Project
12. Simpan semua objek (project, form,dan class module) berupa grup di sebuah folder tertentu
13. Pilih project2 (sebagai project anak)
14. Klik kanan project2
15. Pilih project properties
16. Ubah project types jadi activex.dll
17. Set startup object jadi none
18. OK
Membuat Class Module
19. Tambahkan class module caranya
20. Klik menu project
21. Add class module
22. Klik Open

23. Tulis coding berikut di class tersebut
Public Sub kedua()
MenuBeli.Show vbModal
End Sub

24. simpan di project2 dgn nama clsbeli
Membuat Project Preferences
25. Sertakan activex .dll project anak tsb ke dalam project induk
     Caranya :
26. Klik project1 (sebagai project induk)
27. Klik menu Project
28. Pilih preferences
29. Pilih project2 (sebagai project anak)
Mengintegrasikan Project Dengan Menu
30. Membuat menu di form induk
31. Klik menu tools
32. Pilih menu editor
33. Buatlah menu Pembelian, Penjualan dan Keluar
34. Hasil pembuatan menu terlihat seperti gambar berikut :
 35. Tambahkan coding di form induk :
Private Sub mnpembelian_Click()
Dim objbeli As New clsbeli
objbeli.kedua
Me.Show
End Sub


36. Pada project2 form MenuPembelian buatlah sebuah menu untuk memangil form pemasok,
begitu juga di project ketiga MenuPenjualan dibuat menu untuk memanggil form pelanggan.
37. Lakukan hal yang sama di project anak berikutnya (pada project3)
38. Hasil akhir pembuatan program mulri aplikasi terlihat pada gambar di bawah ini :
39. Jalankan program

repost from : Uus Rusmawan

Membuat ActiveX DLL (Dynamic Link Library) Pada Visual Basic 6.0

Membuat ActiveX DLL adalah suatu usaha untuk membuat program Anda lebih modular dan code-code
yang sering Anda gunakan sebaiknya Anda kumpulkan dan jadikan dalam sebuah DLL sehingga Anda
dapat menggunakannya kapan saja jika dibutuhkan. OK, sekarang kita mulai saja demo pembuatan
ActiveX DLL melalui Visual Basic ini.
  •  Buka Visual Basic Anda kemudian pilih menu File | New Project dan kemudian pilih ActiveX DLL
    seperti gambar dibawah dan kemudian tekan OK
  •  Visual Basic akan memberi workspace project template ActiveX DLL dengan sebuah class module
    default yang bernama Class1. Ganti nama class module tadi menjadi clsMain.

  •  Tambahkan sebuah form pada project DLL Anda dan beri nama frmHello. Oh ya jangan lupa ganti nama project ActiveX DLL ini menjadi vbdll



  • Tulis code berikut pada class module clsMain tadi: 
Option Explicit
Public stMyProperty As String
Public Sub Main_()
frmHello.Show vbModal
End Sub
Public Property Get MyProperty() As Variant
MyProperty = stMyProperty
End Property
Public Property Let MyProperty(ByVal vNewValue As Variant)
stMyProperty = vNewValue
End Property

  • Nah, pada DLL sederhana kita ini ceritanya kita akan membuat sebuah class clsMain yang di dalamnya
    terdapat method Main_ yang fungsinya memanggil form frmHello. Selain itu kita juga membuat sebuah
    property yang bernama MyProperty yang nantinya kita bisa mengisikan suatu nilai ke dalam property ini.Type dari property MyProperty adalah string.
     
  • Sampai disini maka ActiveX DLL kita sudah jadi. Sekarang simpan project ActiveX DLL ini dengan
    nama vbdll.vbp. Kemudian coba sekarang Anda compile menjadi DLL melalui menu File | Make
    vbdll.dll..
     
  • OK, sekarang kita harus me-registerkan DLL kita tadi ke Windows. Gimana caranya? Gampangggg,
    coba Anda masuk ke MS DOS Prompt, kemudian change directory menuju tempat dimana tadi Anda
    menyimpan atau mengcompile vbdll.dll. Nah kemudian ketikkan perintah berikut pada command prompt DOS.
  • regsvr32 vbdll.dll
    Jika sukses maka di layar akan muncul dialog seperti gambar di bawah:
  •  Sekarang ActiveX DLL vbdll.dll Anda sudah ter-register pada system Windows. Waktunya kita untuk
    menguji dan menggunakan DLL ini. Buka kembali Visual Basic Anda dan buatlah project baru melalui
    File | New Project, kemudian pilih Standard EXE. Letakkan sebuah control CommandButton pada form dan kemudian ketik code berikut pada event Click pada CommandButton tadi:
Option Explicit
Private Sub Command1_Click()
Dim obj
'create sebuah instance dari class vbdll.clsMain
Set obj = CreateObject("vbdll.clsMain")
MsgBox "Sekarang memanggil method Main_ dari vbdll.dll"
'panggil method Main dari vbdll.dll
obj.Main_
MsgBox "Sekarang mengisi property" & _
" MyProperty pada vbdll.dll " & _
"dengan string 'TEST'"
'isi MyProperty dengan string 'TEST'
obj.MyProperty = "TEST"
MsgBox "Isi dari property MyProperty " & _
"sekarang adalah " & obj.MyProperty
'free instance obj dari memory
Set obj = Nothing
End Sub

Download Contoh DISINI

repost from : ilmukomputer.com

Jenis Jenis project Visual Basic 6.0

Visual Basic 6.0 menyediakan 13 jenis project yang bisa dibuat seperti terlihat pada gambar 1.3 di atas. Ada beberapa project yang biasa digunakan oleh banyak pengguna Visual Basic, antara lain:
 1. Standard EXE: Project standar dalam Visual Basic dengan komponen-komponen standar. Jenis project
     ini  sangat sederhana, tetapi memiliki keunggulan bahwa semua komponennya dapat diakui oleh semua 
     unit komputer dan semua user meskipun bukan administrator. Pada buku ini akan digunakan project  
     Standard EXE ini, sebagai konsep pemrograman visualnya.
2. ActiveX EXE: Project ini adalah project ActiveX berisi komponen-komponen kemampuan intuk
    berinteraksi dengan semua aplikasi di sistem operasi windows.
3. ActiveX DLL: Project ini menghasilkan sebuah aplikasi library yang selanjutnya dapat digunakan oleh
    semua aplikasi di sistem operasi Windows.
4. ActiveX Control: Project ini menghasilkan komponen-komponen baru untuk aplikasi Visual Basic yang 
    lain.
5. VB Application Wizard: Project ini memandu pengguna untuk membuat aplikasi secara mudah tanpa harus
    pusing-pusing dengan perintah-perintah pemrograman.
 6. Addin: Project seperti Standard EXE tetapi dengan berbagai macam komponen tambahan yang
      memungkinkan kebebasan kreasi dari pengguna.
 7. Data project: Project ini melengkapi komponennya dengan komponen-komponen database. Sehingga
     bisa dikatakan project ini memang disediakan untuk keperluan pembuatan aplikasi database.
 8. DHTML Application: Project ini digunakan untuk membuat aplikasi internet pada sisi client (client side)
     dengan fungsi-fungsi DHTML.
 9. IIS Application: Project ini menghasilkan aplikasi internet pada sisi server (server side) dengan komponen-
     komponen CGI (Common Gateway Interface).

      Sabtu, 23 Juli 2011

      Error handling in Visual Basic

      Merupakan Penanganan error yang terjadi pada saat program sedang berjalan (run time)

      2 Bentuk Penanganan error yang terdapat dalam VB 6.0:
      - On Error Goto NamaLabel
      - On Error Resume Next
      Dalam menangani kesalahan, tentunya tidak semua bagian kode program harus diberi pernyataan On Error.
      Artinya, ada saatnya kita bisa memanfaatkan fungsionalitas method. Sebagai contoh sederhana, ketika ingin melakukan verifikasi terhadap suatu array, akan lebih baik menggunakan method IsArray dibanding mendefinisikan On Error sebelum kode verifikasi

      Bagaimanapun juga, mekanisme penanganan kesalahan memerlukan tambahan alokasi memori. Artinya, penggunaan pernyataan On Error berbanding lurus terhadap waktu eksekusi. Dengan kata lain, semakin banyak blok On Error di suatu kode program, maka juga akan semakin lambat eksekusinya.

      sorry jek males nerangke kie download ae contoh projecke DISINI 

      Bekerja dengan File System di VB6

       VB menyediakan satu set pernyataan seperti perintah perintah dalam DOS, Berikut Perintah-perintah nyai:
       Pada sintaks di atas, letak ekspresi string menentukan jalan yang valid (secara opsional dapat mencakup drive), drive ekspresi string menentukan huruf drive, dan filespec, oldfilespec, dan newfilespec adalah string ekspresi yang menentukan sebuah file (mereka mungkin opsional termasuk drive dan path).

      Berikut ini adalah satu set fungsi yang dapat digunakan dengan file (semua fungsi, kecuali "SetAttr" yang merupakan pernyataan):


      Nilai kembali dari GetAttr dan argumen atribut SetAttr dan Dir $ dapat memiliki salah satu dari nilai berikut (tidak semua nilai ini berlaku untuk semua fungsi):

      Penggunaan  Umum Fungsi $ Dir

       Fungsi $ Dir umumnya digunakan untuk menguji keberadaan file tertentu, menguji keberadaan sebuah direktori tertentu (folder), dan untuk menghasilkan daftar file yang terkandung dalam direktori tertentu.

      If DIr$("C:\SomeFolder\MyFile.txt") = "" Then 
      MsgBox "File tidak ada."
      Else
      MsgBox "File ada."
      End If 

       Untuk melihat apakah direktori tertentu (folder) ada,menggunakan jalur direktori sebagai argumen pertama untuk fungsi $ Dir, dan atribut vbDirectory sebagai argumen kedua. Jika hasilnya adalah string yang (""), nol-panjang kemudian direktori TIDAK ada - jika tidak, tidak:

      if Dir $ ("C: \ SomeFolder", vbDirectory) = "" then
        MsgBox "Direktori tidak ada."
      Else 
        MsgBox "Direktori ada."
      End If 
       

      Minggu, 17 Juli 2011

      Struktur kontrol keputusan

       Struktur kontrol keputusan IF…THEN
      Struktur keputusan If..Then dapat ditulis dalam 2 bentuk penulisan , yaitu :
      1. IF <kondisi> THEN <peryataan>
      Dimana kondisi adalah pernyataan bersyarat, dan pernyataan adalah pernyataan program Visual Basic
      yang sah. Bila <kondisi> bernilai True maka <peryataan> akan dikerjakan. Sebagai contoh :
      If nilai >= 80 Then Textbox1.Text=A
      2. IF <kondisi> THEN
      <peryataan1>
      ELSE
      <peryataan 2>
      END IF
      Dimana bila <kondisi1> bernilai True maka <peryataan 1> akan dikerjakan,
      tetapi bila <kondisi1> bernilai False maka <peryataan 2> yang akan dikerjakan.
      Contoh :
      If nilai >=60 then
      Modul Pemrograman Visual
      Label1.caption=”Anda LULUS”
      Else
      Label1.caption=”Maaf Anda Belum Lulus”
      Endif
      Atau
      IF <kondisi1> THEN
      <peryataan jika kondisi1 bernilai True>
      ELSEIF <kondisi2>
      <peryataan jika kondisi2 bernilai True>
      ELSEIF <kondisi3>
      <peryataan jika kondisi3 bernilai True>
      ELSE
      <peryataan jika tidak ada kondisi yang bernilai True>
      END IF
      Dimana <kondisi> yang merupakan suatu ekspresi logika akan diuji perintah if yang pertama yang ada
      disebelah kirinya. Jika <kondisi> benar maka blok perintah yang terletak di bawahnya akan dikerjakan
      sampai menemi perintah ElseIf atau Else lalu langsung melompat ke pernyataan End If.
      Sebagai contoh :
      If nilai>=85 Then
      Label1.Caption=”Anda mendapatkan nilai A”
      Elseif nilai>=70 Then
      Label1.Caption=”anda mendapatkan nilai B”
      Elseif nilai>=50 Then
      Label1.Caption=”Anda mendapatkan nilai C”
      Else
      Label1.Caption=”Anda mendapatkan nilai D”
      End if

      Struktur kontrol keputusan SELECT…CASE

      Select Case sebenarnya serupa dengan struktur If…Then…Elself, hanya saja struktur ini lebih efisien , mudah
      dibaca dan mudah digunakan terutama jika percabangan dibuat berdasarkan satu variabel kunci, atau uji
      kasus (test case). Struktur ini biasanya digunakan untuk percabangan dengan pilihan lebih dari 2
      (percabangan dengan banyak pilihan).
      Tata penulisan untuk struktur Select Case adalah sebagai berikut:
      SELECT CASE <pilihan>
      CASE <pilihan 1>
      <peryataan program yang dilaksanakan jika pilihan=pilihan1>
      CASE <pilihan 2>
      <peryataan program yang dilaksanakan jika pilihan=pilihan2>
      CASE <pilihan n>
      <peryataan program yang dilaksanakan jika pilihan=pilihann>
      [CASE ELSE]
      <peryataan program yang dilaksanakan jika pilihan1 sampai n tidak ada yang sesuai maka peryataan ini
      akan dikerjakan>
      END SELECT
      Sebagai contoh :
      Select Case Nilai
      Case >=85
      Label1.Caption=” Anda mendapatkan nilai A”
      Case >=70
      Label1.Caption=”anda mendapatkan nilai B”
      Case >=50
      Label1.Caption=”anda mendapatkan nilai C”
      Else
      Label1.Caption=”Anda mendapatkan nilai D”
      End Select

      STRUKTUR KONTROL

      VB 6 Menyediakan struktur kontrol untuk mengendalikan instruksi program yang
      dilaksanakan berulang-ulang, diantaranya : FOR…, DO…, dan WHILE…,
      1. FOR … NEXT
      Adalah untuk mengulangi suatu perintah (instruksi) dalam jumlah yang telah
      ditentukan, serta besar kenaikannya.
      FOR counter = nilai-awal TO nilai-akhir [STEP kenaikannya]
      …. Instruksi…
      [Exit FOR]
      …. Instruksi …
      NEXT
      2. DO
      a. DO WHILE … LOOP
      Adalah untuk mengulangi suatu perintah (instruksi) selama While (suatu
      kondisi) memenuhi syarat (bernilai TRUE) dan akan berhenti apabila
      while tidak lagi memenuhi syarat (bernilai FALSE).
      DO WHILE (kondisi)                           Dapat juga ditulis : DO
      …. Instruksi…                                        ….Instruksi….
      [Exit Do]                                                  [Exit Do]
      …. Instruksi …                                        … Instruksi …
      LOOP                                                      LOOP WHILE (kondisi)

      b. DO UNTIL … LOOP
      Adalah Kebalikan dari DO WHILE. Ia akan mengulangi suatu perintah
      (instruksi) selama kondisi yang dibandingkan tidak memenuhi syarat
      (bernilai FALSE) dan akan berhenti apabila UNTIL (Kondisinya)
      memenuhi syarat (bernilai TRUE)
      DO UNTIL (kondisi)                             dapat jugu ditulis : DO
      …. Instruksi…                                        ….Instruksi….
      [Exit Do]                                                 ….[Exit DO]
      …. Instruksi …                                        …Instruksi….
      LOOP                                                     LOOP UNTIL (kondisi)

      3. WHILE …. WEND
      Adalah sama dengan DO WHILE … LOOP, Tapi WHILE …WEND bentuk penulisannya hanya satu dan tidak memiliki perintah Exit untuk memberhentikan proses yang berulang-ulang sebelum berakhir.
      WHILE (kondisi)
      …. Instruksi…
      [Exit Do]
      …. Instruksi …
      WEND
      Keterangan :
      [STEP kenaikannya] : Besarnya kenaikan yang diinginkan dalam
      pengulangan FOR
      [Exit FOR] : Perintah yang digunakan utk menghentikan atau keluar
      dari LOOP FOR sebelum nilai Akhir terpenuhi.
      [Exit DO] : Perintah yang digunakan utk menghentikan atau keluar
      dari pengulangan DO … LOOP sebelum kondisi yang
      ditentukan memenuhi syarat
      Instruksi : Kode-kode program yang akan dijalankan jika kondisi
      yang ditentukan memenuhi syarat.
      (Kondisi) : Kondisi yang dibandingkan kebenarannya.

      Contoh :
      Buatlah disain form dgn seting properties berikut :
      Private Sub FOR_NEXT_Click()
      Print
      Print
      For I = 0 To 10 Step 2
      Print " FOR NEXT KE : "; I
      If I = 6 Then
      Exit For
      End If
      Next I
      End Sub

      Kemudian click tombol clear Dulu, lalu click tombol do while hasilnya :
      Private Sub DO_WHILE_Click()
      Print
      Print
      I = 10
      Do While I > 0
      Print " DO WHILE KE : "; I
      I = I - 1
      If I = 6 Then
      Exit Do
      End If
      Loop
      End Sub

      Dan Click tombol Clear Dulu, lalu click tombol DO UNTIL hasilnya :
      Private Sub DO_UNTIL_Click()
      Print
      Print
      I = 1
      Do Until I > 10
      Print " DO UNTIL KE : "; I
      I = I + 1
      If I = 6 Then
      Exit Do
      End If

      Loop
      End Sub

      Dan Click tombol Clear Dulu, lalu click tombol DO UNTIL hasilnya :
      Private Sub WHILE_WEND_Click()
      Print
      Print
      I = 1
      While I <= 10
      Print " WHILE WEND KE : "; I
      I = I + 2
      Wend

      End Sub
      Private Sub KELUAR_Click()
      End
      End Sub
      Private Sub CLS_Click()
      CLS
      End Sub

      Aplikasi API Viewer

      Aplikasi API Viewer menyediakan hampir seluruh deklarasi fungsi, konstanta, dan tipe data yang terdapat dalam file teks (.TXT) maupun dalam file database (.MDB). Setelah menemukan fungsi yang diinginkan, pemakai dapat mengkopinya ke dalam modul yang nantinya dapat digabungkan dengan kode program Visual Basic. Untuk memanggil API Viewer lakukan langkah-langkah berikut ini :
      •   Dari menu Add-Ins, pilih Add-Ins Manager
      •   Pilih VB API Viewer
      •   Pada Load Behavior klik Loaded/Unloaded
      •   Klik Ok
      •   Klik API Viewer dari Add-Ins Menu
      •   Buka Text atau Database File yang ingin dilihat.
      •   Pilih item yang ingin dilihat.
       Penggunaan Windows API dalam Program.
      Contoh program 1 :
      1. Buat projek baru dan tambahkan modul dengan memilih Project, Add Module, Open.
      2. Aktifkan API Viewer.
      3. Klik menu Add-Ins, pilih API Viewer.
      4. Klik menu File, pilih Load Text File.
      5. Pilih file win32api, klik Open.
      6. Pada Available Items, pilih MessageBox.
      7. Klik Add dan Insert. Klik Yes.
      8. Tutup jendela Windows API.
      9. Tutup jendela module.
      10. Tambahkan kontrol timer, label dan tiga buah command button.
      11. Atur property objeknya sbb :
      12. Ketikkan listing berikut :
      Private Sub Command1_Click()
      MessageBox Me.hwnd, "API menyebabkan timer tidak berhenti",
      "Msgbox", vbOKOnly
      End Sub
      Private Sub Command2_Click()
      MsgBox "Non API menyebabkan timer berhenti", vbOKOnly,
      "msgbox"
      End Sub
      Private Sub Command3_Click()
      End
      End Sub
      Private Sub Timer1_Timer()
      Label1.Caption = Time
      End Sub

      13. Simpan Projek.
      14. Jalankan program.
      15. Hasilnya sbb :
      Contoh program 2 :
      1. Buat projek baru dan tambahkan modul dengan memilih Project, Add Module,
      Open.
      2. Aktifkan API Viewer.
      3. Klik menu Add-Ins, pilih API Viewer.
      4. Klik menu File, pilih Load Text File.
      5. Pilih file win32api, klik Open.
      6. Pada Available Items, klik double FlashWindow dan Sleep
      7. Klik Insert. Klik Yes.
      8. Tutup jendela Windows API.
      9. Tutup jendela module.
      10. Tambahkan kontrol command button.
      11. Atur property objeknya sbb :
      12. Ketikkan listing berikut :
      Private Sub Command1_Click()
      Dim x As Long
      For c = 1 To 10
      x = FlashWindow(Form1.hwnd, 1)
      Sleep 500
      Next c
      x = FlashWindow(Form1.hwnd, 0)
      End Sub

      13. Simpan Projek.
      14. Jalankan program.

      Windows API

      • Pengertian Windows API
      Windows API (Application Programming Interface) merupakan sekumpulan fungsi-fungsi eksternal yang terdapat dalam file-file perpustakaan Windows (library windows) atau file library lainnya yang dapat digunakan. Fungsi ini dapat menangani semua yang berhubungan dengan Windows, seperti pengaksesan disk, interface printer, grafik windows, kotak dialog (buka file, simpan file, memilih font, memilih warna, dll), Windows shell, setting sistem informasi, penanganan file, mengakses sistem registry, memainkan musik, dsb.
      Fungsi ini menyediakan banyak fitur-fitur standar untuk semua program yang berbasis Windows. Semua fungsi Windows API hampir terdapat dalam direktori sistem milik Windows (C:\Windows\System) dan paling banyak berekstensi .DLL yang digunakan oleh sistem operasi Windows. Selain itu fungsi ini juga memastikan
      secara konsisten penggunaan semua sumber yang terdapat dalam Windows. Filefile itulah yang disebut dengan Windows API. Windows API digunakan ketika program harus melakukan pengkodean yang tidak terdapat dalam bahasa Visual Basic. Misalnya menentukan kecepatan kursor berkedip dalam Visual Basic tidak ada. Dengan memanggil fungsi Windows API yaitu GetCaretBlinkTime (untuk mengembalikan nilai kursor berkedip dalam satuan milidetik) dapat ditentukan kecepatan kursor berkedip.

      • Pengertian DLL
      File library Windows DLL (Dynamic Link Library) yang selanjutnya disebut DLL adalah kode yang sudah dikompilasi dan dapat digunakan oleh program lain. DLL biasanya ditulis dengan bahasa C/C++, Delphi atau bahasa lainnya yang mendukung sistem operasi Windows. Dengan memanggil fungsi yang terdapat dalam DLL, pemakai dapat mengakses ribuan fungsi yang berhubungan dengan sistem Windows, dengan kualitas sebaik yang digunakan dalam bahasa yang digunakan. Berikut ini namanama library milik Windows yang sering dan paling banyak digunakan dalam Windows API.

      Hal yang perlu dilakukan untuk menggunakan fungsi-fungsi dalam file library Windows yaitu dengan menspesifikasikan di mana fungsi tersebut ditemukan dan menyediakan informasi yang dibutuhkan fungsi pada bagian pendeklarasian fungsi Windows Langkah pertama adalah mendeklarasikan fungsi di dalam bagian modul, dengan sintaks sbb :
      Declare Function NamaFungsi Lib “NamaLibrary” [Alias “AliasFungsi”]
      [([[ByVal/ByRef] variabel [As type] [,[ByVal/ByRef] variabel [As
      type]]…])] As Type

      Jika fungsi tersebut tidak mengembalikan nilai, maka gantilah kata
      Function dengan kata Sub.
      Declare Sub NamaFungsi Lib “NamaLibrary” [Alias “AliasFungsi”]
      [([[ByVal/ByRef] variabel [As type] [,[ByVal/ByRef] variabel [As
      type]]…])]

      Keterangan :
      Contoh dari pendeklarasian fungsi API adalah sbb :
      Public Declare Function SetWIndowText Lib “User32” Alias
      “SetWindowTextA” (ByVal hwnd As Long, ByVal lpString As
      String) As Long

      Untuk mencari nama fungsi API, tipe data dan konstanta, gunakan aplikasi viewer yang disertakan dalam Visual Basic. Jika mendeklarasikan dalam form, modul maupun class module, perintah Declare diawali dengan kata Private atau Public untuk mendefinisikan jangkauan fungsi dalam kode. Setelah fungsi
      tersebut dideklarasikan, pemakai dapat menggunakannya dalam program.

      Jumat, 15 Juli 2011

      Control Array

      Pada visual Basic, array tidak hanya berlaku untuk variabel tetapi juga berlaku untuk komponen. Pemakaian array pada komponen ini dinamakan dengan control array. Control array ini banyak terjadi ketika membuat komponen dengan cara meng-copy dari komponen yang sudah ada, misalkan untuk membuat command
      button dengan meng-copy command1 akan muncul konfirmasi “You already have a control named command1. Do you want to create a control array ?”. Bila pertanyaan ini djawab dengan Yes, maka hasil command yang kedua mempunyai nama command1(1), sedangkan command yang pertama mempunyai nama command1(0). Control array ini sangat berguna bila membuat suatu project dengan banyak komponen yang mempunyai model dan kegunaan yang sama. Control array juga berguna untuk membuat project dengan komponen serupa yang sangat banyak misalkan untuk lampu indikator yang menyatakan volume atau kekuatan.
      Contoh Aplikasi :
      Membuat kalkulator dengan kemampuan penjumlahan dan pengurangan, dapat dilakukan dengan memanfaatkan control array pada tombol-tombol yang digunakan.
      (1) Buat project baru dengan StandardEXE. Untuk form, isi porperty [Name] dengan formLatihan64.
      (2) Tambahkan komponen TextBox, atur property [Font] dengan size 18 dan bold, atur property alignment dengan 1-Right Justify. Isi property [Text] dengan 0 (nol).
      (3) Tambahkan command Button, atur property [Font] dengan size 14 dan bold. Buatlah 14 buah command button dengan cara meng-copy dan jadikan control array sehingga menjadi command1(0), command1(1), command1(2) sampai dengan command1(13).
      (4) Atur posisinya seperti gambar 6.4 berikut.
      (5) Pada jendela code, tambahkan kode program sebagai operasi kalkulator sebagai berikut:
      % Definisi variabel global
      Dim kal, operasi As String
      Dim bil As Integer
      Private Sub Command1_Click(Index As Integer)

      % Penambahan kerakter setiap tombol angka ditekan
      kal = kal + Trim(Str(Index))
      Text1 = kal
      End Sub
      Private Sub Command2_Click()

      % Membersihkan memory dan text1
      Text1 = "0"
      kal = ""
      End Sub
      Private Sub Command3_Click(Index As Integer)

      Select Case Index
      Case 0:

      % Operasi perhitungan bila tombol = ditekan
      bil2 = Val(kal)
      If operasi = "+" Then bil = bil + bil2

      If operasi = "-" Then bil = bil - bil2
      Text1 = bil
      kal = Trim(Str(bil))
      Case 1:
      %Penampungan variabel dan operator untuk penjumlahan
      bil = Val(kal)
      operasi = "+"
      kal = ""
      Case 2:
      %Penampungan variabel dan operator untuk pengurangan
      bil = Val(kal)
      operasi = "-"
      kal = ""
      End Select
      End Sub


      (6) Simpan project dengan nama projectLatihan64. Cobalah lakukan proses perhitungan seperti kalkulator biasa. Kalkulator ini memang masih sederhana, dan bisa ditambah fasilitasnya dengan menambah command button dan setiap eventnya.

      Contoh Aplikasi :
      Membuat indikator proses dengan memanfaatkan control array. Lakukan pengulangan 1 sampai dengan 20, setiap pengulangan lakukan pengulangan lagi sebanyak 1000000 dn lakukan proses perhitungan sederhana misalkan x=2*j+1. Buatlah indikator yang menunjukkan sudah berapa pengulangan pertama yang selesai dengan indikator dibuat memanfaatkan property [Visible] pada shape. Untu membuat program ini lakukan langkah-langkah sebagai berikut:
      (1) Buat project baru dengan StandardEXE. Untuk form1, isi property [Name] dengan formLatihan65
      (2) Tambahkan komponen Command, isi property [Caption] dengan Proses.
      (3) Tambahkan komponen shape, isi property [FillColor] dengan Pallete Merah, dan isi property [FillStyle] dengan 0-Solid. Copy komponen shape ini sebanyak 19 kali sehingga totalnya adalah 20 shape dan letakkan berjajar, seperti pada gambar berikut.
      (4) Pada jendela code, tambahkan kode program untuk menampilkan indikator pengulangan sebagai berikut:
      Private Sub Command1_Click()
      'Hilangkan semua shape dengan mengatur visible
      For i = 0 To 19
      Shape1(i).Visible = False
      Next i
      'Lakukan pengulangan
      For i = 1 To 20
      'Lakukan pengulangan sebanyak 1000000
      For j = 1 To 1000000
      'Lakukan proses perhitungan sederhana
      x = 2 * i + 1
      Next j

      'Tampilkan shape ke i-1
      Shape1(i - 1).Visible = True
      Shape1(i - 1).Refresh
      Next i
      End Sub

      (5) Simpan project dengan nama projectLatihan

      Array 2 Dimensi

      Array bisa menggunakan satu indeks yang disebut dengan satu dimensi seperti yang sudah dijelaskan di atas. Dan juga bisa menggunakan lebih dari satu, misalkan 2 indeks yang dinamakan dengan array 2 dimensi dan ditulis dengan: variabel(indeks1,indeks2)
      Array 2 dimensi ini biasa digunakan untuk keperluan matrik, dimana indeks pertama menyatakan baris dan indeks kedua menyatakan kolom. Sebagai contoh a(2,3) adalah nilai a pada baris 2 dan kolom 3.
      Contoh Aplikasi 1:
      Membuat program untuk memasukkan matrik dan menampilkan matrik sebagai berikut:
      (1) Buat project baru dengan standardEXE
      (2) Tambahkan komponen-komponen: 1 buah labe, 1 buah textbox, 1 buah listbox, dan 2 buah command buttom
      (3) Isi property setiap komponen seperti pada tabel d bawah ini, dan atur posisinya
      seperti gambar

       
      (4) Pada jendela code, tambahkan kode perogram sebagai berikut:
      'Definisi matrik berukuran 4x4
      Dim m(4, 4) As Single
      Private Sub Command1_Click()
      'Memasukkan nilai matrik sesuai dengan
      'baris dan kolom yang dimasukkan
      baris = Val(Text1)
      kolom = Val(Text2)
      m(baris, kolom) = Val(Text3)
      End Sub
      Private Sub Command2_Click()
      'Menampilkan semua isi matrik
      List1.Clear
      For i = 1 To 4
      kal = ""
      For j = 1 To 4
      kal = kal & m(i, j) & " "
      Next j
      List1.AddItem kal
      Next i
      End Sub
      (5) Simpan project ini dengan nama projectLatihan.
      Contoh 3:Membuat penjumlahan dua buah matrik a dan b yang berukuran sama (mxn)
      menggunakan rumus:
      dapat dilakukan dengan:
      For baris=1 To m
      For kolom=1 To n
      c(baris,kolom) = a(baris,kolom) + b(baris,kolom)
      Next kolom
      Next baris

      Contoh 4:
      Membuat perkalian dua buah matrik a dan b yang berukuran sama (nxn)
      menggunakan rumus:
       
      dapat dilakukan dengan:
      For baris=1 To n
      For kolom=1 To n
      z = 0
      For i=1 To n
      z = z + a(baris,i) * b(i,kolom)
      Next i
      c(baris,kolom) = z
      Next kolom
      Next baris

      Konsep Array & Contoh

      Konsep Array
           Array dalam bahasa Indonesia adalah indeks, maka variabel array adalah variabel yang mempunyai indeks. Sehingga penulisannya adalah var(indeks). Array sangat penting di dalam pemrograman, karena array mampu menampung banyak data yang bertipe sama. Sebagai contoh variabel array x menampung nilai-nilai
      bilangan bulat {3, 6, 8, 7, 5, 1} berarti indeks untuk variabel x ini adalah 1 sampai dengan 6, dan ditulis sebagai x(1), x(2), x(3), x(4), x(5) dan x(6).
           Array dapat diibaratkan sebagai kereta api dalam komputer, yang di dalamnya tedapat gerbong-gerbong memory yang berisi data-data yang mempunyai tipe dan perlakuan yang sama. Untuk mengambil atau menampilkan nilai array dapat dianalogikan dengan mencari kursi dalam gerbong kereta api, maka pada karcis perlu dituliskan nomor gerbong, Array juga demikian, untuk menampilkan nilai array tinggal menyebutkan indeks-nya. Misalkan untuk menampilkan nilai variabel x yang ke 5 dituliskan dengan x(5).
           Untuk dapat membuat variabel array maka terlebih dahulu harus didefinisikan nama variabel array dan berapa jumlah maksimalnya dengan cara:
      Dim nama_variabel(jumlah_array) as Tipe_Data
       Perintah ini diletakkan sesuai kebutuhan apakah array ini hanya untuk subroutine (event) lokal atau pada seluruh event di form. Sebagai contoh untuk membuat array bilangan bulat yang dapat menampung 10
      bilangan dapat dituliskan dengan:
      Dim bilangan(10) as integer
      Bila jumlah array sudah ditentukan 10 maka tidak boleh menggunakan data lebih dari 10, karena 10 menyatakan jumlah maksimum dari data yang akan ditampung adalan suatu array. Sebagai contoh:
      Bilangan(4) = 100 Perintah ini benar
      Bilangan(12) = 8 Perintah ini salah karena batasnya sudah ditentukan 10.

      Contoh 1:
      Memasukkan 6 nama sebagai berikut “Basuki”, “Achmad”, “Rizki”, “Widya”, “Dian”, dan “Teguh” ke dalam array dan menampilkan semua nama ke dalam List saat form di panggil.
      Dim nama(6) as String
      Private Sub Form_Load()
      nama(0) = ”Basuki”
      nama(1) = ”Achmad”
      nama(2) = ”Rizki”
      nama(3) = ”Widya”
      nama(4) = ”Dian”
      nama(5) = ”Teguh”
      List1.Clear
      For i=0 To 5

      List1.AddItem nama(i)
      Next i
      End Sub

      Array pada Visual Basic dimulai dari indeks 0. Sehingga data pertama dituliskan dengan var(0).
      Visual Basic juga mengenal array dinamis, dimana jumlahnya bisa tak terbatas. Untuk mendefinisikan array dinamis dapat dilakukan dengan mendefinisikan array tanpa menuliskan jumlah maksimum arraynya sebagai berikut:
      Dim variabel() as tipe_data
      Untuk contoh nama di atas, dapat dituliskan dengan:
      Dim nama() as string


      Contoh Aplikasi 1:
      Membuat project untuk menuliskan data-data nama siswa dengan nomor dibuat otomatis, dengan jumlah data siswa maksimum adalah 20. Kemudian menampilkan semua data nama siswa yang sudah dimasukkan.
      (1) Buat project baru dengan StandardEXE
      (2) Tambahkan komponen-komponen: 1 label, 1 textbox, 1 listbox dan 2 command button
      (3) Masukkan nilai property dari masing-masing komponen dan form seperti tabel di
      bawah ini, dan atur penempatan setiap komponen seperti gambar 1.
       
      (4) Tambahkan kode program pada jendela kode sebagai berikut:
      ‘ Mendefinisikan variabel global nama sebagai array
      ‘ dan jumlah data
      Dim nama(20) As String
      Dim n As Integer
      Private Sub Command1_Click()
      ‘ Menambah nomor array dan memindahkan isi text1
      ‘ ke array nama
      n = n + 1
      nama(n) = Trim(Text1.Text)

      ‘ Mengosongkan isi text1 dan menaruh kursor ke text1
      Text1.Text = ""
      Text1.SetFocus
      End Sub
      Private Sub Command2_Click()
      ‘ Menampilkan semua isi array nama
      List1.Clear
      For i = 1 To n
      List1.AddItem nama(i)
      Next i
      End Sub
      Private Sub Form_Load()
      ‘ Saat form dipanggil jumlah array diisi dengan nol
      n = 0
      End Sub
      (5) Simpan project dengan nama project Latihan1. 

      Contoh Aplikasi 2:
      Membuat project untuk memasukkan data-data penjualan yang berisi jumlah produk penjualan dalam satu bulan. Kemudian dihitung rata-rata penjualan, bulan yang mengalami penjualan tertinggi dan bulan yang mengalami penjualan terendah.
      (1) Buat project baru dengan StandardEXE
      (2) Tambahkan komponen-komponen: 2 buah label, 2 textbox, 1 listbox dan 4 command button
      (3) Isi property dari setiap komponen seperti tabel di bawah ini dan atur posisi tiap komponen seperti             gambar 2
      (4) Pada jendela kode, tambahkan kode program berikut:
      'Mendefinisikan array data penjualan jual(n)
      'Dan jumlah data penjualan n
      Dim jual(100) As Single
      Dim n As Integer
      Private Sub Command1_Click()

      'Jumlah data bertambah dan ambil data dari text1
      n = n + 1
      jual(n) = Val(Text1)
      'Tampilkan ke list
      List1.AddItem jual(n)
      End Sub
      Private Sub Command2_Click()

      'Menghitung nilai rata-rata dari data
      jumlah = 0
      For i = 1 To n
      jumlah = jumlah + jual(i)
      Next i
      rata2 = jumlah / n
      List1.AddItem ""
      List1.AddItem "Rata-rata = " & rata2
      End Sub
      Private Sub Command3_Click()
      'Menghitung nilai maksimal dari data
      jualMaks = jual(1)
      For i = 2 To n
      If jual(i) > jualMaks Then jualMaks = jual(i)
      Next
      List1.AddItem ""
      List1.AddItem "Penjualan maksimum = " & jualMaks
      End Sub

      Private Sub Command4_Click()'Menghitung nilai minimal dari data
      jualMin = jual(1)
      For i = 2 To n
      If jual(i) < jualMin Then jualMin = jual(i)
      Next
      List1.AddItem ""
      List1.AddItem "Penjualan maksimum = " & jualMin
      End Sub
      Private Sub Form_Load()
      'Nilai awal jumlah data diberi nol
      n = 0
      List1.Clear
      End Sub

      (5) Simpan project dengan nama projectLatihan2.


      Contoh 2:
      Membuat barisan fibbonanci menggunakan konsep array. Definisi dari barisan fibonanci adalah suku ke n adalah jumlah dari dua suku sebelumnya (suku ke n-1 dan suku ke n-2) atau dituliskan dengan:
      x(n) = x(n-1) + x(n-2)
      Dan kode programnya adalah:
      x(1) = 1
      x(2) = 1
      For i=1 To N
      x(i) = x(i-1) + x(i+1)
      Next i
      ‘ Menampilkan hasilnya
      For i=1 To N
      List1.AddItem x(i)
      Next i

      Array

      Array adalah kelompok berturut-turut lokasi memori yang semua memiliki nama yang sama dan jenis yang sama. Untuk merujuk ke lokasi tertentu atau elemen dalam array, kita tentukan nama array dan nomor elemen array posisi.

      Elemen individual array diidentifikasi dengan menggunakan indeks. Array memiliki batas atas dan bawah dan elemen-elemen harus terletak dalam batas-batas tersebut. Setiap nomor indeks dalam array dialokasikan ruang memori individu dan karena itu pengguna harus menghindari mendeklarasikan array dari ukuran yang lebih besar daripada yang dibutuhkan. Kita dapat mendeklarasikan array dari salah satu tipe data dasar termasuk varian, -ditetapkan jenis pengguna dan variabel obyek. Elemen individual dari array adalah semua tipe data yang sama.
      Mendeklarasikan array

      Array menempati ruang memori. Pemrogram menentukan tipe array dan jumlah elemen yang dibutuhkan oleh array sehingga kompilator dapat cadangan jumlah yang sesuai dari memori. Array dapat dinyatakan sebagai Masyarakat (dalam kode modul), modul atau lokal. Modul array dideklarasikan dalam deklarasi umum menggunakan kata kunci Dim atau Private. array Lokal dinyatakan dalam prosedur menggunakan Dim atau statis. Array harus dideklarasikan secara eksplisit dengan kata kunci "Sebagai".

      Ada dua jenis array dalam Visual Basic yaitu:

      Fixed-ukuran array: Ukuran array selalu tetap ukuran-sama tidak berubah selama eksekusi program.

      Dynamic array: Ukuran array dapat diubah pada waktu perubahan ukuran berjalan selama pelaksanaan program.
      Berukuran tetap Array

      Ketika batas atas ditentukan dalam deklarasi itu, array-Fixed dibuat. Batas atas harus selalu berada dalam kisaran tipe data lama.

      Mendeklarasikan array-tetap

      Dim angka (5) As Integer

      Dalam ilustrasi di atas, angka adalah nama dari array, dan angka 6 termasuk dalam kurung adalah batas atas array. Pernyataan di atas membuat sebuah array dengan 6 elemen, dengan nomor indeks berjalan dari 0 hingga 5.

      Jika kita ingin menentukan batas bawah, maka tanda kurung harus mencakup batas bawah dan atas bersama dengan Untuk kata kunci. Contoh untuk ini diberikan di bawah ini.

      Dim angka (1 To 6) As Integer

      Dalam pernyataan di atas, sebuah array dari 10 elemen dinyatakan tetapi dengan indeks berjalan dari 1 sampai 6.

      Sebuah array publik dapat dideklarasikan menggunakan kata kunci Umum Dim bukan seperti yang ditunjukkan di bawah ini.

      Publik nomor (5) As Integer
      Multidimensional Array

      Array dapat memiliki beberapa dimensi. Penggunaan umum dari array multidimensi adalah merupakan tabel nilai-nilai yang terdiri dari informasi yang diatur dalam baris dan kolom. Untuk mengidentifikasi elemen tabel tertentu, kita harus menentukan dua indeks: Yang pertama (oleh konvensi) mengidentifikasi elemen baris dan kolom elemen yang kedua (oleh konvensi) mengidentifikasi.

      Tabel atau array yang membutuhkan dua indeks untuk mengidentifikasi elemen tertentu disebut array dua dimensi. Perhatikan bahwa array multidimensi dapat memiliki lebih dari dua dimensi. Visual Basic mendukung setidaknya 60 dimensi array, tapi kebanyakan orang akan perlu menggunakan lebih dari dua atau tiga dimensi-array.

      Pernyataan berikut mendeklarasikan array dua dimensi 50 dengan 50 array dalam prosedur.

      Dim AvgMarks (50, 50)

      Hal ini juga memungkinkan untuk menetapkan batas yang lebih rendah untuk salah satu atau kedua dimensi sebagai untuk array ukuran tetap. Contoh untuk ini diberikan di sini.

      Dim Marks (101 Untuk 200, 1 Untuk 100)

      Contoh untuk tiga array dimensi-dengan batas yang lebih rendah pasti diberikan di bawah ini.

      Dim Rincian (101 Untuk 200, 1 Untuk 100, 1 Untuk 100)
      Statis dan array dinamis

      Pada dasarnya, Anda dapat membuat baik array statis atau dinamis. array statis harus mencakup sejumlah tetap item, dan jumlah ini harus diketahui pada waktu kompilasi sehingga kompilator dapat menyisihkan jumlah memori yang diperlukan. Anda membuat array statis menggunakan pernyataan Dim dengan argumen yang konstan:

      'Ini adalah array statis.
      Dim Nama (100) As String

      Visual Basic indeks array dimulai dengan 0. Oleh karena itu, array sebelumnya benar-benar memegang 101 item.

      Kebanyakan program tidak menggunakan array statis karena jarang programmer tahu pada waktu kompilasi berapa banyak item yang Anda butuhkan dan juga karena array statis tidak dapat diubah ukurannya selama eksekusi. Kedua permasalahan ini diselesaikan dengan array dinamis. Anda menyatakan dan membuat array dinamis dalam dua langkah yang berbeda. Secara umum, Anda mendeklarasikan array untuk memperhitungkan visibilitas (misalnya, pada awal modul jika Anda ingin membuatnya terlihat oleh semua prosedur dari modul) menggunakan perintah Dim dengan pasangan kosong dari kurung. Kemudian Anda membuat sebuah array saat Anda benar-benar membutuhkannya, menggunakan pernyataan ReDim:

      'Sebuah array didefinisikan dalam modul BAS (dengan lingkup Swasta)
      Dim Pelanggan () As String
      ...
      Sub Main ()
      'Di sini Anda membuat array.
      ReDim Pelanggan (1000) As String
      End Sub

      Jika Anda membuat sebuah array yang lokal untuk prosedur, Anda dapat melakukan segala sesuatu dengan pernyataan ReDim tunggal:

      Sub PrintReport ()
      'Array ini hanya akan terlihat prosedur.
      ReDim Pelanggan (1000) As String
      '...
      End Sub

      Jika Anda tidak menentukan indeks lebih rendah dari sebuah array, Visual Basic mengasumsikan itu menjadi 0, kecuali sebuah Option Base 1 pernyataan ditempatkan pada awal modul. Saran saya adalah ini: Jangan gunakan pernyataan Option Base karena membuat ulang kode lebih sulit. (Anda tidak dapat memotong dan rutinitas paste tanpa khawatir tentang Option Base saat ini.) Jika Anda ingin secara eksplisit menggunakan indeks lebih rendah berbeda dari 0, gunakan sintaks ini sebagai gantinya:

      ReDim Pelanggan (1 To 1000) As String

      Dynamic array dapat diciptakan kembali di akan, setiap kali dengan nomor yang berbeda dari item. Bila Anda kembali membuat array dinamis, isinya direset ke 0 (atau string kosong) dan Anda kehilangan data yang berisi. Jika Anda ingin mengubah ukuran array tanpa kehilangan isinya, gunakan perintah ReDim Preserve:

      ReDim Preserve Pelanggan (2000) As String

      Ketika Anda mengubah ukuran array, Anda tidak dapat mengubah jumlah dimensinya maupun jenis nilai-nilai yang dikandungnya. Selain itu, ketika Anda menggunakan ReDim Preserve pada array multidimensi, Anda dapat mengubah ukuran hanya dimensi terakhir:

      ReDim Sel (1 Untuk 100, 10) As Integer
      ...
      ReDim Preserve Sel (1 Untuk 100, 20) Seperti ini Integer 'bekerja.
      ReDim Preserve Sel (1 Untuk 200, 20) As Integer 'Ini tidak.

      Akhirnya, Anda dapat menghancurkan sebuah array menggunakan statement Erase. Jika array dinamis, Visual Basic membebaskan memori yang dialokasikan untuk unsur-unsurnya (dan Anda tidak dapat membaca atau menulis mereka lagi), jika array yang statis, elemen perusahaan diatur ke 0 atau string kosong.

      Anda dapat menggunakan LBound dan fungsi UBound untuk mengambil indeks bawah dan atas. Jika array memiliki dua atau lebih dimensi, Anda harus lulus argumen kedua untuk fungsi-fungsi ini untuk menentukan dimensi yang Anda butuhkan:

      Cetak LBound (Sel, 1) 'Menampilkan 1, lebih rendah indeks 1 dimensi
      Cetak LBound (Sel) 'Sama seperti di atas
      Cetak UBound (Sel, 2) 'Menampilkan 20, indeks atas 2 dimensi
      'Evaluasi jumlah elemen.
      NumEls = (UBound (Sel) LBound _ (Sel) + 1) * _
      (UBound (Sel, 2) _ LBound (Sel, 2) + 1)
      Array dalam UDTs

      struktur UDT dapat mencakup baik array statis dan dinamis. Berikut adalah struktur sampel yang mengandung kedua jenis:

      Jenis MyUDT
      StaticArr (100) As Long
      DynamicArr () As Long
      Akhir Jenis
      ...
      Dim UDT sebagai MyUDT
      'Anda harus Dimensi array dinamis sebelum menggunakannya.
      ReDim udt.DynamicArr (100) As Long
      'Anda tidak perlu melakukan itu dengan array statis.
      udt.StaticArr (1) = 1234

      Operator Pada Visual Basic dan Urutan Operasinya

      Visual basic meyediakan operator aritmatika, komparasi dan logika, salah satu hal yang harus dipahami oleh programmer adalah tata urutan operasi dari masing-masing operator tersebut sehingga mampu membuat ekspresi yang akan menghasilkan nilai yang benar, Tabel 1-2, menunjukkan operator dan urutan operasinya dari atas kebawah.
      Contoh :
      A = 1 + 2 * 3                'Akan menghasilkan 7
      B = (1 + 2) * 3              'Akan menghasilkan 9
      Aritmatika
      Komparasi
      Logika
      Pangkat (^)
      Sama (=)
      Not
      Negatif (-)
      Tidak sama (<>)
      And
      Kali dan Bagi (*, /)
      Kurang dari (<)
      Or
      Pembagian bulat (\)
      Lebih dari (>)
      Xor
      Sisa Bagi (Mod)
      Kurang dari atau sama (<=)
      Eqv
      Tambah dan Kurang (+,-)
      Lebih dari atau sama (>=)
      Imp
      Pengabungan String (&)
      Like

      Kamis, 14 Juli 2011

      Ascii

      ASCII Character Codes (0 through 127)

      ASCII Character Codes (128 through 255)



      VB Error Number and Description more than 650

      0        The operation completed successfully.
      1        Incorrect function.
      2        The system cannot find the file specified.
      3        The system cannot find the path specified.
      4        The system cannot open the file.
      5        Access is denied.
      6        The handle is invalid.
      7        The storage control blocks were destroyed.
      8        Not enough storage is available to process this command.
      9        The storage control block address is invalid.
      10        The environment is incorrect.
      11        An attempt was made to load a program with an incorrect format.
      12        The access code is invalid.
      13        The data is invalid.
      14        Not enough storage is available to complete this operation.
      15        The system cannot find the drive specified.
      16        The directory cannot be removed.
      17        The system cannot move the file to a different disk drive.
      18        There are no more files.
      19        The media is write protected.
      20        The system cannot find the device specified.
      21        The device is not ready.
      22        The device does not recognize the command.
      23        Data error (cyclic redundancy check)
      24        The program issued a command but the command length is incorrect.
      25        The drive cannot locate a specific area or track on the disk.
      26        The specified disk or diskette cannot be accessed.
      27        The drive cannot find the sector requested.
      28        The printer is out of paper.
      29        The system cannot write to the specified device.
      30        The system cannot read from the specified device.
      31        A device attached to the system is not functioning.
      32        The process cannot access the file because it is being used by another process.
      33        The process cannot access the file because another process has locked a portion of the file.
      34        The wrong diskette is in the drive. Insert %2 (Volume Serial Number: %3) into drive %1.
      36        Too many files opened for sharing.
      38        Reached end of file.
      39        The disk is full.
      50        The network request is not supported.
      51        The remote computer is not available.
      52        A duplicate name exists on the network.
      53        The network path was not found.
      54        The network is busy.
      55        The specified network resource or device is no longer available.
      56        The network BIOS command limit has been reached.
      57        A network adapter hardware error occurred.
      58        The specified server cannot perform the requested operation.
      59        An unexpected network error occurred.
      60        The remote adapter is not compatible.
      61        The printer queue is full.
      62        Space to store the file waiting to be printed is not available on the server.
      63        Your file waiting to be printed was deleted.
      64        The specified network name is no longer available.
      65        Network access is denied.
      66        The network resource type is not correct.
      67        The network name cannot be found.
      68        The name limit for the local computer network adapter card was exceeded.
      69        The network BIOS session limit was exceeded.
      70        The remote server has been paused or is in the process of being started.
      71        No more connections can be made to this remote computer at this time because there are already as many    connections as the computer can accept.
      72        The specified printer or disk device has been paused.
      80        The file exists.
      82        The directory or file cannot be created.
      83        Fail on INT 24
      84        Storage to process this request is not available.
      85        The local device name is already in use.
      86        The specified network password is not correct.
      87        The parameter is incorrect.
      88        A write fault occurred on the network.
      89        The system cannot start another process at this time.
      100        Cannot create another system semaphore.
      101        The exclusive semaphore is owned by another process.
      102        The semaphore is set and cannot be closed.
      103        The semaphore cannot be set again.
      104        Cannot request exclusive semaphores at interrupt time.
      105        The previous ownership of this semaphore has ended.
      106        Insert the diskette for drive %1.
      107        Program stopped because alternate diskette was not inserted.
      108        The disk is in use or locked by another process.
      109        The pipe has been ended.
      110        The system cannot open the device or file specified.
      111        The file name is too long.
      112        There is not enough space on the disk.
      113        No more internal file identifiers available.
      114        The target internal file identifier is incorrect.
      117        The IOCTL call made by the application program is not correct.
      118        The verify-on-write switch parameter value is not correct.
      119        The system does not support the command requested.
      120        This function is only valid in Win32 mode.
      121        The semaphore timeout period has expired.
      122        The data area passed to a system call is too small.
      123        The filename, directory name, or volume label syntax is incorrect.
      124        The system call level is not correct.
      125        The disk has no volume label.
      126        The specified module could not be found.
      127        The specified procedure could not be found.
      128        There are no child processes to wait for.
      129        The %1 application cannot be run in Win32 mode.
      130        Attempt to use a file handle to an open disk partition for an operation other than raw disk I/O.
      131        An attempt was made to move the file pointer before the beginning of the file.
      132        The file pointer cannot be set on the specified device or file.
      133        A JOIN or SUBST command cannot be used for a drive that contains previously joined drives.
      134        An attempt was made to use a JOIN or SUBST command on a drive that has already been joined.
      135        An attempt was made to use a JOIN or SUBST command on a drive that has already been substituted.
      136        The system tried to delete the JOIN of a drive that is not joined.
      137        The system tried to delete the substitution of a drive that is not substituted.
      138        The system tried to join a drive to a directory on a joined drive.
      139        The system tried to substitute a drive to a directory on a substituted drive.
      140        The system tried to join a drive to a directory on a substituted drive.
      141        The system tried to SUBST a drive to a directory on a joined drive.
      142        The system cannot perform a JOIN or SUBST at this time.
      143        The system cannot join or substitute a drive to or for a directory on the same drive.
      144        The directory is not a subdirectory of the root directory.
      145        The directory is not empty.
      146        The path specified is being used in a substitute.
      147        Not enough resources are available to process this command.
      148        The path specified cannot be used at this time.
      149        An attempt was made to join or substitute a drive for which a directory on the drive is the target of a previous        substitute.
      150        System trace information was not specified in your CONFIG.SYS file, or tracing is disallowed.
      151        The number of specified semaphore events for DosMuxSemWait is not correct.
      152        DosMuxSemWait did not execute; too many semaphores are already set.
      153        The DosMuxSemWait list is not correct.
      154        The volume label you entered exceeds the label character limit of the target file system.
      155        Cannot create another thread.
      156        The recipient process has refused the signal.
      157        The segment is already discarded and cannot be locked.
      158        The segment is already unlocked.
      159        The address for the thread ID is not correct.
      160        The argument string passed to DosExecPgm is not correct.
      161        The specified path is invalid.
      162        A signal is already pending.
      164        No more threads can be created in the system.
      167        Unable to lock a region of a file.
      170        The requested resource is in use.
      173        A lock request was not outstanding for the supplied cancel region.
      174        The file system does not support atomic changes to the lock type.
      180        The system detected a segment number that was not correct.
      182        The operating system cannot run %1.
      183        Cannot create a file when that file already exists.
      186        The flag passed is not correct.
      187        The specified system semaphore name was not found.
      188        The operating system cannot run %1.
      189        The operating system cannot run %1.
      190        The operating system cannot run %1.
      191        Cannot run %1 in Win32 mode.
      192        The operating system cannot run %1.
      193        %1 is not a valid Win32 application.
      194        The operating system cannot run %1.
      195        The operating system cannot run %1.
      196        The operating system cannot run this application program.
      197        The operating system is not presently configured to run this application.
      198        The operating system cannot run %1.
      199        The operating system cannot run this application program.
      200        The code segment cannot be greater than or equal to 64KB.
      201        The operating system cannot run %1.
      202        The operating system cannot run %1.
      203        The system could not find the environment option that was entered.
      205        No process in the command subtree has a signal handler.
      206        The filename or extension is too long.
      207        The ring 2 stack is in use.
      208        The global filename characters, * or ?, are entered incorrectly or too many global filename characters are     specified.
      209        The signal being posted is not correct.
      210        The signal handler cannot be set.
      212        The segment is locked and cannot be reallocated.
      214        Too many dynamic link modules are attached to this program or dynamic link module.
      215        Can't nest calls to LoadModule.
      230        The pipe state is invalid.
      231        All pipe instances are busy.
      232        The pipe is being closed.
      233        No process is on the other end of the pipe.
      234        More data is available.
      240        The session was cancelled.
      254        The specified extended attribute name was invalid.
      255        The extended attributes are inconsistent.
      259        No more data is available.
      266        The Copy API cannot be used.
      267        The directory name is invalid.
      275        The extended attributes did not fit in the buffer.
      276        The extended attribute file on the mounted file system is corrupt.
      277        The extended attribute table file is full.
      278        The specified extended attribute handle is invalid.
      282        The mounted file system does not support extended attributes.
      288        Attempt to release mutex not owned by caller.
      298        Too many posts were made to a semaphore.
      299        Only part of a Read/WriteProcessMemory request was completed.
      317        The system cannot find message for message number 0x%1 in message file for %2.
      487        Attempt to access invalid address.
      534        Arithmetic result exceeded 32 bits.
      535        There is a process on other end of the pipe.
      536        Waiting for a process to open the other end of the pipe.
      994        Access to the extended attribute was denied.
      995        The I/O operation has been aborted because of either a thread exit or an application request.
      996        Overlapped I/O event is not in a signalled state.
      997        Overlapped I/O operation is in progress.
      998        Invalid access to memory location.
      999        Error performing inpage operation.
      1001        Recursion too deep, stack overflowed.
      1002        The window cannot act on the sent message.
      1003        Cannot complete this function.
      1004        Invalid flags.
      1005        The volume does not contain a recognized file system. Please make sure that all required file system drivers are loaded and that the volume is not corrupt.
      1006        The volume for a file has been externally altered such that the opened file is no longer valid.
      1007        The requested operation cannot be performed in full-screen mode.
      1008        An attempt was made to reference a token that does not exist.
      1009        The configuration registry database is corrupt.
      1010        The configuration registry key is invalid.
      1011        The configuration registry key could not be opened.
      1012        The configuration registry key could not be read.
      1013        The configuration registry key could not be written.
      1014        One of the files in the Registry database had to be recovered by use of a log or alternate copy.  The recovery was successful.
      1015        The Registry is corrupt. The structure of one of the files that contains Registry data is corrupt, or the system's image of the file in memory is corrupt, or the file could not be recovered because the alternate     copy or log was absent or corrupt.
      1016        An I/O operation initiated by the Registry failed unrecoverably. The Registry could not read in, or write out, or flush, one of the files that contain the system's image of the Registry.
      1017        The system has attempted to load or restore a file into the Registry, but the specified file is not in a Registry file format.
      1018        Illegal operation attempted on a Registry key which has been marked for deletion.
      1019        System could not allocate the required space in a Registry log.
      1020        Cannot create a symbolic link in a Registry key that already has subkeys or values.
      1021        Cannot create a stable subkey under a volatile parent key.
      1022        A notify change request is being completed and the information is not being returned in the caller's buffer. The caller now needs to enumerate the files to find the changes.
      1051        A stop control has been sent to a service which other running services are dependent on.
      1052        The requested control is not valid for this service
      1053        The service did not respond to the start or control request in a timely fashion.
      1054        A thread could not be created for the service.
      1055        The service database is locked.
      1056        An instance of the service is already running.
      1057        The account name is invalid or does not exist.
      1058        The specified service is disabled and cannot be started.
      1059        Circular service dependency was specified.
      1060        The specified service does not exist as an installed service.
      1061        The service cannot accept control messages at this time.
      1062        The service has not been started.
      1063        The service process could not connect to the service controller.
      1064        An exception occurred in the service when handling the control request.
      1065        The database specified does not exist.
      1066        The service has returned a service-specific error code.
      1067        The process terminated unexpectedly.
      1068        The dependency service or group failed to start.
      1069        The service did not start due to a logon failure.
      1070        After starting, the service hung in a start-pending state.
      1071        The specified service database lock is invalid.
      1072        The specified service has been marked for deletion.
      1073        The specified service already exists.
      1074        The system is currently running with the last-known-good configuration.
      1075        The dependency service does not exist or has been marked for deletion.
      1076        The current boot has already been accepted for use as the last-known-good control set.
      1077        No attempts to start the service have been made since the last boot.
      1078        The name is already in use as either a service name or a service display name.
      1100        The physical end of the tape has been reached.
      1101        A tape access reached a filemark.
      1102        Beginning of tape or partition was encountered.
      1103        A tape access reached the end of a set of files.
      1104        No more data is on the tape.
      1105        Tape could not be partitioned.
      1106        When accessing a new tape of a multivolume partition, the current blocksize is incorrect.
      1107        Tape partition information could not be found when loading a tape.
      1108        Unable to lock the media eject mechanism.
      1109        Unable to unload the media.
      1110        Media in drive may have changed.
      1111        The I/O bus was reset.
      1112        No media in drive.
      1113        No mapping for the Unicode character exists in the target multi-byte code page.
      1114        A dynamic link library (DLL) initialization routine failed.
      1115        A system shutdown is in progress.
      1116        Unable to abort the system shutdown because no shutdown was in progress.
      1117        The request could not be performed because of an I/O device error.
      1118        No serial device was successfully initialized.  The serial driver will unload.
      1119        Unable to open a device that was sharing an interrupt request (IRQ) with other devices. At least one other device that uses that IRQ was already opened.
      1120        A serial I/O operation was completed by another write to the serial port. (The IOCTL_SERIAL_XOFF_COUNTER reached zero.)
      1121        A serial I/O operation completed because the time-out period expired. (The IOCTL_SERIAL_XOFF_COUNTER did not reach zero.)
      1122        No ID address mark was found on the floppy disk.
      1123        Mismatch between the floppy disk sector ID field and the floppy disk controller track address.
      1124        The floppy disk controller reported an error that is not recognized by the floppy disk driver.
      1125        The floppy disk controller returned inconsistent results in its registers.
      1126        While accessing the hard disk, a recalibrate operation failed, even after retries.
      1127        While accessing the hard disk, a disk operation failed even after retries.
      1128        While accessing the hard disk, a disk controller reset was needed, but even that failed.
      1129        Physical end of tape encountered.
      1130        Not enough server storage is available to process this command.
      1131        A potential deadlock condition has been detected.
      1132        The base address or the file offset specified does not have the proper alignment.
      1140        An attempt to change the system power state was vetoed by another application or driver.
      1141        The system BIOS failed an attempt to change the system power state.
      1150        The specified program requires a newer version of Windows.
      1151        The specified program is not a Windows or MS-DOS program.
      1152        Cannot start more than one instance of the specified program.
      1153        The specified program was written for an older version of Windows.
      1154        One of the library files needed to run this application is damaged.
      1155        No application is associated with the specified file for this operation.
      1156        An error occurred in sending the command to the application.
      1157        One of the library files needed to run this application cannot be found.
      1200        The specified device name is invalid.
      1201        The device is not currently connected but it is a remembered connection.
      1202        An attempt was made to remember a device that had previously been remembered.
      1203        No network provider accepted the given network path.
      1204        The specified network provider name is invalid.
      1205        Unable to open the network connection profile.
      1206        The network connection profile is corrupt.
      1207        Cannot enumerate a non-container.
      1208        An extended error has occurred.
      1209        The format of the specified group name is invalid.
      1210        The format of the specified computer name is invalid.
      1211        The format of the specified event name is invalid.
      1212        The format of the specified domain name is invalid.
      1213        The format of the specified service name is invalid.
      1214        The format of the specified network name is invalid.
      1215        The format of the specified share name is invalid.
      1216        The format of the specified password is invalid.
      1217        The format of the specified message name is invalid.
      1218        The format of the specified message destination is invalid.
      1219        The credentials supplied conflict with an existing set of credentials.
      1220        An attempt was made to establish a session to a network server, but there are already too many sessions established to that server.
      1221        The workgroup or domain name is already in use by another computer on the network.
      1222        The network is not present or not started.
      1223        The operation was cancelled by the user.
      1224        The requested operation cannot be performed on a file with a user mapped section open.
      1225        The remote system refused the network connection.
      1226        The network connection was gracefully closed.
      1227        The network transport endpoint already has an address associated with it.
      1228        An address has not yet been associated with the network endpoint.
      1229        An operation was attempted on a non-existent network connection.
      1230        An invalid operation was attempted on an active network connection.
      1231        The remote network is not reachable by the transport.
      1232        The remote system is not reachable by the transport.
      1233        The remote system does not support the transport protocol.
      1234        No service is operating at the destination network endpoint on the remote system.
      1235        The request was aborted.
      1236        The network connection was aborted by the local system.
      1237        The operation could not be completed.  A retry should be performed.
      1238        A connection to the server could not be made because the limit on the number of concurrent connections for this account has been reached.
      1239        Attempting to login during an unauthorized time of day for this account.
      1240        The account is not authorized to login from this station.
      1241        The network address could not be used for the operation requested.
      1242        The service is already registered.
      1243        The specified service does not exist.
      1244        The operation being requested was not performed because the user has not been authenticated.
      1245        The operation being requested was not performed because the user has not logged on to the network.The specified service does not exist.
      1246        Return that wants caller to continue with work in progress.
      1247        An attempt was made to perform an initialization operation when initialization has already been completed.
      1248        No more local devices.
      1300        Not all privileges referenced are assigned to the caller.
      1301        Some mapping between account names and security IDs was not done.
      1302        No system quota limits are specifically set for this account.
      1303        No encryption key is available.  A well-known encryption key was returned.
      1304        The NT password is too complex to be converted to a LAN Manager password.  The LAN Manager password returned is a NULL string.
      1305        The revision level is unknown.
      1306        Indicates two revision levels are incompatible.
      1307        This security ID may not be assigned as the owner of this object.
      1308        This security ID may not be assigned as the primary group of an object.
      1309        An attempt has been made to operate on an impersonation token by a thread that is not currently impersonating a client.
      1310        The group may not be disabled.
      1311        There are currently no logon servers available to service the logon request.
      1312         A specified logon session does not exist.  It may already have  been terminated.
      1313         A specified privilege does not exist.
      1314         A required privilege is not held by the client.
      1315        The name provided is not a properly formed account name.
      1316        The specified user already exists.
      1317        The specified user does not exist.
      1318        The specified group already exists.
      1319        The specified group does not exist.
      1320        Either the specified user account is already a member of the specified group, or the specified group cannot be deleted because it contains a member.
      1321        The specified user account is not a member of the specified group account.
      1322        The last remaining administration account cannot be disabled or deleted.
      1323        Unable to update the password.  The value provided as the current password is incorrect.
      1324        Unable to update the password.  The value provided for the new password contains values that are not allowed in passwords.
      1325        Unable to update the password because a password update rule has been violated.
      1326        Logon failure: unknown user name or bad password.
      1327        Logon failure: user account restriction.
      1328        Logon failure: account logon time restriction violation.
      1329        Logon failure: user not allowed to log on to this computer.
      1330        Logon failure: the specified account password has expired.
      1331        Logon failure: account currently disabled.
      1332        No mapping between account names and security IDs was done.
      1333        Too many local user identifiers (LUIDs) were requested at one time.
      1334        No more local user identifiers (LUIDs) are available.
      1335        The subauthority part of a security ID is invalid for this particular use.
      1336        The access control list (ACL) structure is invalid.
      1337        The security ID structure is invalid.
      1338        The security descriptor structure is invalid.
      1340        The inherited access control list (ACL) or access control entry (ACE) could not be built.
      1341        The server is currently disabled.
      1342        The server is currently enabled.
      1343        The value provided was an invalid value for an identifier authority.
      1344        No more memory is available for security information updates.
      1345        The specified attributes are invalid, or incompatible with the attributes for the group as a whole.
      1346        Either a required impersonation level was not provided, or the provided impersonation level is invalid.
      1347        Cannot open an anonymous level security token.
      1348        The validation information class requested was invalid.
      1349        The type of the token is inappropriate for its attempted use.
      1350        Unable to perform a security operation on an object which has no associated security.
      1351        Indicates a Windows NT Server could not be contacted or that objects within the domain are protected such that necessary information could not be retrieved.
      1352        The security account manager (SAM) or local security authority (LSA) server was in the wrong state to perform the security operation.
      1353        The domain was in the wrong state to perform the security operation.
      1354        This operation is only allowed for the Primary Domain Controller of the domain.
      1355        The specified domain did not exist.
      1356        The specified domain already exists.
      1357        An attempt was made to exceed the limit on the number of domains per server.
      1358        Unable to complete the requested operation because of either a catastrophic media failure or a data structure corruption on the disk.
      1359        The security account database contains an internal inconsistency.
      1360        Generic access types were contained in an access mask which should already be mapped to non-generic types.
      1361        A security descriptor is not in the right format (absolute or self-relative).
      1362        The requested action is restricted for use by logon processes only.  The calling process has not registered as a logon process.
      1363        Cannot start a new logon session with an ID that is already in use.
      1364        A specified authentication package is unknown.
      1365        The logon session is not in a state that is consistent with the requested operation.
      1366        The logon session ID is already in use.
      1367        A logon request contained an invalid logon type value.
      1368        Unable to impersonate via a named pipe until data has been read from that pipe.
      1369        The transaction state of a Registry subtree is incompatible with the requested operation.
      1370        An internal security database corruption has been encountered.
      1371        Cannot perform this operation on built-in accounts.
      1372        Cannot perform this operation on this built-in special group.
      1373        Cannot perform this operation on this built-in special user.
      1374        The user cannot be removed from a group because the group is currently the user's primary group.
      1375        The token is already in use as a primary token.
      1376        The specified local group does not exist.
      1377        The specified account name is not a member of the local group.
      1378        The specified account name is already a member of the local group.
      1379        The specified local group already exists.
      1380        Logon failure: the user has not been granted the requested logon type at this computer.
      1381        The maximum number of secrets that may be stored in a single system has been exceeded.
      1382        The length of a secret exceeds the maximum length allowed.
      1383        The local security authority database contains an internal inconsistency.
      1384        During a logon attempt, the user's security context accumulated too many security IDs.
      1385        Logon failure: the user has not been granted the requested logon type at this computer.
      1386        A cross-encrypted password is necessary to change a user password.
      1387        A new member could not be added to a local group because the member does not exist.
      1388        A new member could not be added to a local group because the member has the wrong account type.
      1389        Too many security IDs have been specified.
      1390        A cross-encrypted password is necessary to change this user password.
      1391        Indicates an ACL contains no inheritable components
      1392        The file or directory is corrupt and non-readable.
      1393        The disk structure is corrupt and non-readable.
      1394        There is no user session key for the specified logon session.
      1395        The service being accessed is licensed for a particular number of connections. No more connections can be made to the service at this time because there are already as many connections as the service can accept.
      1400        Invalid window handle.
      1401        Invalid menu handle.
      1402        Invalid cursor handle.
      1403        Invalid accelerator table handle.
      1404        Invalid hook handle.
      1405        Invalid handle to a multiple-window position structure.
      1406        Cannot create a top-level child window.
      1407        Cannot find window class.
      1408        Invalid window, belongs to other thread.
      1409        Hot key is already registered.
      1410        Class already exists.
      1411        Class does not exist.
      1412        Class still has open windows.
      1413        Invalid index.
      1414        Invalid icon handle.
      1415        Using private DIALOG window words.
      1416        The listbox identifier was not found.
      1417        No wildcards were found.
      1418        Thread does not have a clipboard open.
      1419        Hot key is not registered.
      1420        The window is not a valid dialog window.
      1421        Control ID not found.
      1422        Invalid message for a combo box because it does not have an edit control.
      1423        The window is not a combo box.
      1424        Height must be less than 256.
      1425        Invalid device context (DC) handle.
      1426        Invalid hook procedure type.
      1427        Invalid hook procedure.
      1428        Cannot set non-local hook without a module handle.
      1429        This hook procedure can only be set globally.
      1430        The journal hook procedure is already installed.
      1431        The hook procedure is not installed.
      1432        Invalid message for single-selection listbox.
      1433        LB_SETCOUNT sent to non-lazy listbox.
      1434        This list box does not support tab stops.
      1435        Cannot destroy object created by another thread.
      1436        Child windows cannot have menus.
      1437        The window does not have a system menu.
      1438        Invalid message box style.
      1439        Invalid system-wide (SPI_*) parameter.
      1440        Screen already locked.
      1441        All handles to windows in a multiple-window position structure must have the same parent.
      1442        The window is not a child window.
      1443        Invalid GW_* command.
      1444        Invalid thread identifier.
      1445        Cannot process a message from a window that is not a multiple document interface (MDI) window.
      1446        Popup menu already active.
      1447        The window does not have scroll bars.
      1448        Scroll bar range cannot be greater than 0x7FFF.
      1449        Cannot show or remove the window in the way specified.
      1450        Insufficient system resources exist to complete the requested service.
      1451        Insufficient system resources exist to complete the requested service.
      1452        Insufficient system resources exist to complete the requested service.
      1453        Insufficient quota to complete the requested service.
      1454        Insufficient quota to complete the requested service.
      1455        The paging file is too small for this operation to complete.
      1456        A menu item was not found.
      1500        The event log file is corrupt.
      1501        No event log file could be opened, so the event logging service did not start.
      1502        The event log file is full.
      1503        The event log file has changed between reads.
      1700        The string binding is invalid.
      1701        The binding handle is not the correct type.
      1702        The binding handle is invalid.
      1703        The RPC protocol sequence is not supported.
      1704        The RPC protocol sequence is invalid.
      1705        The string universal unique identifier (UUID) is invalid.
      1706        The endpoint format is invalid.
      1707        The network address is invalid.
      1708        No endpoint was found.
      1709        The timeout value is invalid.
      1710        The object universal unique identifier (UUID) was not found.
      1711        The object universal unique identifier (UUID) has already been registered.
      1712        The type universal unique identifier (UUID) has already been registered.
      1713        The RPC server is already listening.
      1714        No protocol sequences have been registered.
      1715        The RPC server is not listening.
      1716        The manager type is unknown.
      1717        The interface is unknown.
      1718        There are no bindings.
      1719        There are no protocol sequences.
      1720        The endpoint cannot be created.
      1721        Not enough resources are available to complete this operation.
      1722        The RPC server is unavailable.
      1723        The RPC server is too busy to complete this operation.
      1724        The network options are invalid.
      1725        There is not a remote procedure call active in this thread.
      1726        The remote procedure call failed.
      1727        The remote procedure call failed and did not execute.
      1728        A remote procedure call (RPC) protocol error occurred.
      1730        The transfer syntax is not supported by the RPC server.
      1732        The universal unique identifier (UUID) type is not supported.
      1733        The tag is invalid.
      1734        The array bounds are invalid.
      1735        The binding does not contain an entry name.
      1736        The name syntax is invalid.
      1737        The name syntax is not supported.
      1739        No network address is available to use to construct a universal unique identifier (UUID).
      1740        The endpoint is a duplicate.
      1741        The authentication type is unknown.
      1742        The maximum number of calls is too small.
      1743        The string is too long.
      1744        The RPC protocol sequence was not found.
      1745        The procedure number is out of range.
      1746        The binding does not contain any authentication information.
      1747        The authentication service is unknown.
      1748        The authentication level is unknown.
      1749        The security context is invalid.
      1750        The authorization service is unknown.
      1751        The entry is invalid.
      1752        The server endpoint cannot perform the operation.
      1753        There are no more endpoints available from the endpoint mapper.
      1754        No interfaces have been exported.
      1755        The entry name is incomplete.
      1756        The version option is invalid.
      1757        There are no more members.
      1758        There is nothing to unexport.
      1759        The interface was not found.
      1760        The entry already exists.
      1761        The entry is not found.
      1762        The name service is unavailable.
      1763        The network address family is invalid.
      1764        The requested operation is not supported.
      1765        No security context is available to allow impersonation.
      1766        An internal error occurred in a remote procedure call (RPC).
      1767        The RPC server attempted an integer division by zero.
      1768        An addressing error occurred in the RPC server.
      1769        A floating-point operation at the RPC server caused a division by zero.
      1770        A floating-point underflow occurred at the RPC server.
      1771        A floating-point overflow occurred at the RPC server.
      1772        The list of RPC servers available for the binding of auto handles    has been exhausted.
      1773        Unable to open the character translation table file.
      1774        The file containing the character translation table has fewer than 512 bytes.
      1775        A null context handle was passed from the client to the host during a remote procedure call.
      1777        The context handle changed during a remote procedure call.
      1778        The binding handles passed to a remote procedure call do not match.
      1779        The stub is unable to get the remote procedure call handle.
      1780        A null reference pointer was passed to the stub.
      1781        The enumeration value is out of range.
      1782        The byte count is too small.
      1783        The stub received bad data.
      1784        The supplied user buffer is not valid for the requested operation.
      1785        The disk media is not recognized.  It may not be formatted.
      1786        The workstation does not have a trust secret.
      1787        The SAM database on the Windows NT Server does not have a computer account for this workstation trust relationship.
      1788        The trust relationship between the primary domain and the trusted domain failed.
      1789        The trust relationship between this workstation and the primary domain failed.
      1790        The network logon failed.
      1791        A remote procedure call is already in progress for this thread.
      1792        An attempt was made to logon, but the network logon service was not started.
      1793        The user's account has expired.
      1794        The redirector is in use and cannot be unloaded.
      1795        The specified printer driver is already installed.
      1796        The specified port is unknown.
      1797        The printer driver is unknown.
      1798        The print processor is unknown.
      1799        The specified separator file is invalid.
      1800        The specified priority is invalid.
      1801        The printer name is invalid.
      1802        The printer already exists.
      1803        The printer command is invalid.
      1804        The specified datatype is invalid.
      1805        The Environment specified is invalid.
      1806        There are no more bindings.
      1807        The account used is an interdomain trust account.  Use your global user account or local user account to access this server.
      1808        The account used is a Computer Account.  Use your global user account or local user account to access this server.
      1809        The account used is an server trust account.  Use your global user account or local user account to access this server.
      1810        The name or security ID (SID) of the domain specified is inconsistent with the trust information for that domain.
      1811        The server is in use and cannot be unloaded.
      1812        The specified image file did not contain a resource section.
      1813        The specified resource type can not be found in the image file.
      1814        The specified resource name can not be found in the image file.
      1815        The specified resource language ID cannot be found in the image file.
      1816        Not enough quota is available to process this command.
      1817        No interfaces have been registered.
      1818        The server was altered while processing this call.
      1819        The binding handle does not contain all required information.
      1820        Communications failure.
      1821        The requested authentication level is not supported.
      1822        No principal name registered.
      1823        The error specified is not a valid Windows RPC error code.
      1824        A UUID that is valid only on this computer has been allocated.
      1825        A security package specific error occurred.
      1826        Thread is not cancelled.
      1827        Invalid operation on the encoding/decoding handle.
      1828        Incompatible version of the serializing package.
      1829        Incompatible version of the RPC stub.
      1898        The group member was not found.
      1899        The endpoint mapper database could not be created.
      1900        The object universal unique identifier (UUID) is the nil UUID.
      1901        The specified time is invalid.
      1902        The specified Form name is invalid.
      1903        The specified Form size is invalid
      1904        The specified Printer handle is already being waited on
      1905        The specified Printer has been deleted
      1906        The state of the Printer is invalid
      1907        The user must change his password before he logs on the first time.
      1908        Could not find the domain controller for this domain.
      1909        The referenced account is currently locked out and may not be logged on to.
      2000        The pixel format is invalid.
      2001        The specified driver is invalid.
      2002        The window style or class attribute is invalid for this operation.
      2003        The requested metafile operation is not supported.
      2004        The requested transformation operation is not supported.
      2005        The requested clipping operation is not supported.
      2202        The specified username is invalid.
      2250        This network connection does not exist.
      2401        This network connection has files open or requests pending.
      2402        Active connections still exist.
      2404        The device is in use by an active process and cannot be disconnected.
      3000        The specified print monitor is unknown.
      3001        The specified printer driver is currently in use.
      3002        The spool file was not found.
      3003        A StartDocPrinter call was not issued.
      3004        An AddJob call was not issued.
      3005        The specified print processor has already been installed.
      3006        The specified print monitor has already been installed.
      4000        WINS encountered an error while processing the command.
      4001        The local WINS can not be deleted.
      4002        The importation from the file failed.
      4003        The backup Failed.  Was a full backup done before ?
      4004        The backup Failed.  Check the directory that you are backing the database to.
      4005        The name does not exist in the WINS database.
      4006        Replication with a non-configured partner is not allowed.
      6118        The list of servers for this workgroup is not currently available