Dasar Pemrograman 1 Pemrograman Visual Basic 6.0
-
Upload
muhammad-aji -
Category
Documents
-
view
158 -
download
7
Transcript of Dasar Pemrograman 1 Pemrograman Visual Basic 6.0
What is Visual Basic?
Visual Basic is a tool that allows you to develop Windows (Graphic User Interface - GUI) applications. The applications have a familiar appearance to the user.
Visual Basic is event-driven, meaning code remains idle until called upon to respond to some event (button pressing, menu selection, ...).
Application (Project) Forms - Windows that you create for user interface Controls - Graphical features drawn on forms to allow user
interaction (text boxes, labels, scroll bars, command buttons, etc.) (Forms and Controls are objects.)
Properties - Every characteristic of a form or control is specified by a property. Example properties include names, captions, size, color, position, and contents. Visual Basic applies default properties. You can change properties at design time or run time.
Methods - Built-in procedure that can be invoked to impart some action to a particular object.
Event Procedures - Code related to some object. This is the code that is executed when a certain event occurs.
General Procedures - Code not related to objects. This code must be invoked by the application.
Modules - Collection of general procedures, variable declarations, and constant definitions used by application.
Keterangan Singkat Standart EXE
Membuat aplkasi visual basic standart (umum) ActiveX EXE
Membuat aplikasi activeX ActiveX DLL
Membuat Library ActiveX activeX Control
Membuat kontrol activeX VB Application Wizard
Membuat aplikasi VB dengan bantuan wizard VB Wizard Manager
IPusat Pengelolaan Wizard Visual Basic IIS Aplication
Membuat aplikasi IIS (Internet Information Server) DHTML Application
Membuat aplikasi DHTML
Penggunaan jendela Kode
Arti Warna text Pada Umumnya Biru
Text ini merupakan kata kunci (reserved word) Hijau
Text ini merupakan keterangan Hitam
Tulisan biasa (kode, nama variabel dan yang lainnya) Merah
Kode program yang salah
Type Data Integer
Type data berupa bilangan bulat (-32.768 – 32.767) Byte Decimal String Single Double Date Currency Long Object Varinant
Deklarasi Variabel
Variabel dideklarasikan dengan Dim Sintaksnya
Dim namavariabel As Type Data Contoh
Dim Nama As String Dim No As Integer Dim TglLahir As Date
Variabel Global dan Local
Variabel Global : variabel yang dapat diakses dari semua lokasi di dalam program. Contoh
PUBLIC Counter As Integer (Pendeklarasian di Jendela modul kode)
Variabel Lokal : variabel yang hanya dapat digunakan di lingkungannya sendiri. Contoh
Pendeklarasian variabel di dalam event
Pemberian Nama Variabel
Nama diberikan untuk memperjelas kegunaan variabel tersebut
Tipe Data Awalan Contoh
Boolean Bln BlnStatus
Integer Int IntTotal
Single Sng SngJumlah
Aturan Suffix
Dim No As Integer Bisa dipersingkat Dim No%
Tipe Data Simbol
Integer %
Long &
Single !
Double #
String $
Currency @
Konstanta
Media Penympanan nilai yang bersifat tetap Contoh : TotalBiaya = 0,5*Produksi + Ovr Dimana Ovr = 500000 Ovr = KONSTANTA
Cara Penuliasan konstanta
Const namakonstanta As Tipe = Nilai
Operator Aritmatika
Operator yang dilakukan untuk melakukan perhitungan mamtematis.
Operator Arti Contoh
+ Penjumlahan X=4+6
- Pengurangan X=4-6
* Perkalian X=4*6
/ Pembagian X=4^6
^ Perpangkatan X=4/6
& Penggambungan String Str1&Str2
Tingkat Urutan
Pangkat Perkalian dan Pembagian Penjumlahan dan pengurangan
Contoh Total = 2*5+3^2 =2*5+9 =10+9 =19
Operator Perbandingan
Contoh Jumlah >=10
Operator Arti
= Sama Dengan
> Lebih Besar
< Lebih Kecil
>= Lebih Besar atau sama
<= Kurang dari atau sama dengan
<> Tidak samadengan