Algoritma & PEMROGRAMAN 2B (Visual basic)

Slides:



Advertisements
Presentasi serupa
Putu Darmawan,S.Kom,MM Bahasa Pemrograman 1 1 MENGGUNAKAN FUNGSI MSGBOX() fungsi msgbox() adalah fungsi untuk menampilkan kotak pesan (message), dan kita.
Advertisements

panduan praktis belajar VISUAL BASIC 6.0
1 Algoritma Bahasa Pemrograman dan Bab 1.1. Pengertian Algoritma.
PENCARIAN DATA DENGAN KONTROL DATA
Perancangan Basis Data
Function.
© aSup-2007 PENGENALAN SPSS   1 INTRODUCTION to SPSS Statistical Package for Social Science.
Alg&Pemrog 2B Sistem Komputer Variable  Variable dapat didefinisikan sebagai bagian dari memory untuk menyimpan nilai yang telah ditentukan.  Setiap.
KOTAK DIALOG / MESSAGEBOX
DIALOG BOX.
Javascript Javascript Javascript Javascript Javascript Javascript
SQL 2. Database TRANSACTION Tabel yang terlibat : Customer berisi data pelanggan (nama, alamat, dll) OderInfo berisi info pemesanan oleh pelanggan (tgl.
LOOPING dan array Tinaliah, S. Kom.
Perancangan Database Pertemuan 07 s.d 08
REPETITION CONTROL STRUCTURES
Testing Implementasi Sistem Oleh :Rifiana Arief, SKom, MMSI
PRAKTIKUM 3 PEMROGRAMAN BASIS DATA. Menghapus baris  Deleting rows- DELETE FROM Use the DELELE FROM command to delete row(s) from a table, with the following.
INTRODUCTION TO SPSS Statistical Package for Social Science 1.
Pemrograman VB.NET Pertemuan 3.
1 Diselesaikan Oleh KOMPUTER Langkah-langkah harus tersusun secara LOGIS dan Efisien agar dapat menyelesaikan tugas dengan benar dan efisien. ALGORITMA.
BASIC CISCO. Memakai Cisco Cisco dapat dikonfigurasi melalui 3 cara : Console : menggunakan cable console yang dihubungkan melalui serial port dan menggunakan.
Menulis Kolom  Kolom adalah opini atau artikel. Tidak seperti editorial, kolom memiliki byline.  Kolom Biasanya ditulis reguler. Biasanya mingguan atau.
Masalah Transportasi II (Transportation Problem II)
Bayu Priyambadha, S.Kom.  Classes, which are the "blueprints" for an object and are the actual code that defines the properties and methods.  Objects,
9.3 Geometric Sequences and Series. Objective To find specified terms and the common ratio in a geometric sequence. To find the partial sum of a geometric.
OPERATOR DAN FUNGSI MATEMATIK. Operator  Assignment operator Assignment operator (operator pengerjaan) menggunakan simbol titik dua diikuti oleh tanda.
Cursor MI2163 Dasar Pemrograman Basis Data. Introduction Cursor merupakan suatu variabel yang digunakan untuk menampung hasil query yang terdiri atas.
3 Ways to Record PowerPoint From within PowerPoint From within Camtasia Studio.
Visual Basic for Aplications in powerpoint. What is Visual Basic for Aplications? Visual Basic for Applications (VBA) is a very powerful objectoriented.
Dasar query basis data dengan SQLite
Pengantar Teknik Kompilasi
Review Pemrograman Visual I
Teknik. Pemrog. Terstruktur 2
Membuat Macro.
Konsep Pemrograman 3
Penggunaan Struktur Kontrol SELECT
Latihan Form Login.
Dynamic Array and Linked List
Rekayasa Perangkat Lunak Class Diagram
Algoritma Pemrograman A
Konsep pemrograman LOOP
Bahasa Pemrograman 1 STRUKTUR KONTROL VB Chapter 03 bimocahyo.
Algoritma & PEMROGRAMAN 2B (Visual basic)
Struktur Kontrol Keputusan IF dan Select
AKT211 – CAO 08 – Computer Memory (2)
CLASS DIAGRAM.
Dasar-Dasar Pemrograman
Pertemuan 24 Teknik Searching
Algorithms and Programming Searching
STRUKTUR DATA.
Pertemuan 4 CLASS DIAGRAM.
PAKET PROGRAM APLIKASI
Teknik. Pemrog. Terstruktur 2
Algoritma & Pemrograman 1 Achmad Fitro The Power of PowerPoint – thepopp.com Chapter 3.
Lesson 2-1 Conditional Statements 1 Lesson 2-1 Conditional Statements.
V ERIZON SETTINGS FOR I P HONE, A NDROID, O UTLOOK, AND W INDOWS P HONE.
HughesNet was founded in 1971 and it is headquartered in Germantown, Maryland. It is a provider of satellite-based communications services. Hughesnet.
Procedure dan Function
Here you'll find the complete solution about how to set up Roadrunner settings for iPhone, Android, Windows Phone and Outlook. Unable to set up Roadrunner.
Do you want to check your Zoho mail incoming or outgoing logs and unable to check, go through with this article and access Zoho mail incoming or outgoing.
 Zoho Mail offers easy options to migrate data from G Suite or Gmail accounts. All s, contacts, and calendar or other important data can be imported.
If you are an user, then you know how spam affects your account. In this article, we tell you how you can control spam’s in your ZOHO.
How do I Add or Remove a delegate to my Gmail account? Google launched delegation service 9 years ago for Gmail that allows you to give permission to access.
INTERROGATIVE ADJECTIVE. DEFINITION FUNCTION EXAMPLE QUESTION.
Perulangan (Loop) Oleh : Tim Teaching
Draw a picture that shows where the knife, fork, spoon, and napkin are placed in a table setting.
2. Discussion TASK 1. WORK IN PAIRS Ask your partner. Then, in turn your friend asks you A. what kinds of product are there? B. why do people want to.
3 Ways to Record PowerPoint From within PowerPoint From within Camtasia Studio.
Transcript presentasi:

Algoritma & PEMROGRAMAN 2B (Visual basic) Bonang Waspadadi Ligar, S.Si, MMSI

MsgBox "Hello there!"

intResponse = MsgBox("Are you sure you want to quit intResponse = MsgBox("Are you sure you want to quit?", vbYesNo + vbQuestion, "Quit")

Msgbox “Anda baru saja menekan tombol”, VbExclamation, “Pemberitahuan”

Inthasil = Msgbox(“Tidak dapat mengakses disket”, 16 + 2,”Warning”)

Msgbox “Selamat anda berhasil”, vbinformation,”Berita”

Inthasil = Msgbox(“Tidak dapat mengakses disket”, 16 + 2,”Warning”)

Message box Message Box / Kotak pesan adalah kotak dialog khusus yang digunakan untuk menampilkan informasi kepada pengguna User tidak bisa mengetik apapun pada message box MsgBox adalah perintah yang digunakan untuk menampilkan message box.

syntax Syntax: MsgBox “prompt” [, buttons, “title”] Prompt. Required. Pesan yang ditampilkan di kotak dialog. Panjang maksimum prompt kira-kira 1024 karakter, tergantung lebar karakter yang digunakan. Buttons. Optional. Ekspresi numerik yang menentukan jenis tombol, icon, dll. Title. Optional. Judul dialog box, jika tidak ditentukan maka nama program yang akan ditampilkan.

The buttons argument The buttons argument is formed by five groups of values. The first group of values (0–5) describes the number and type of buttons displayed in the dialog box; The second group (16, 32, 48, 64) describes the icon style; The third group (0, 256, 512, 768) determines which button is the default;

First group Determines which buttons to display Constant Value Description vbOKOnly Display OK button only. vbOKCancel 1 Display OK and Cancel buttons. vbAbortRetryIgnore 2 Display Abort, Retry, and Ignore buttons. vbYesNoCancel 3 Display Yes, No, and Cancel buttons. vbYesNo 4 Display Yes and No buttons. vbRetryCancel 5 Display Retry and Cancel buttons.

second group Determines which icon to display Constant Value Description Icon vbCritical 16 Display Critical Message icon. vbQuestion 32 Display Warning Query (question mark) icon. vbExclamation 48 Display Warning Message icon. vbInformation 64 Display Information Message icon.

third group Determines which button is default Constant Value Description vbDefaultButton1 First button is default. vbDefaultButton2 256 Second button is default. vbDefaultButton3 512 Third button is default. vbDefaultButton4 768 Fourth button is default (applicable only if a Help button has been added).

fourth group Special buttons Constant Value Description vbMsgBoxHelpButton 16384 Adds Help button to the message box VbMsgBoxSetForeground 65536 Specifies the message box window as the foreground window vbMsgBoxRight 524288 Text is right aligned vbMsgBoxRtlReading 1048576 Specifies text should appear as right-to-left reading on Hebrew and Arabic systems

Message box There are 2 basic ways to use MsgBox: If you do NOT need to test which button the user clicked if you DO need to test which button the user clicked

Call MsgBox(arguments) Message box If you do NOT need to test which button the user clicked (only an OK button), then you can use MsgBox as if you were calling a Sub. You can use the following syntax:   Msgbox arguments -or- Call MsgBox(arguments)

causes the following box to be displayed: Example The statement MsgBox "Hello there!" causes the following box to be displayed:

causes the following box to be displayed: Example The statement MsgBox "The Last Name field must not be blank.", vbExclamation, "Last Name“ causes the following box to be displayed:

Example vbExclamation + vbOKOnly making the full statement read: MsgBox "The Last Name field must not be blank.", vbExclamation + vbOKOnly, "Last Name"

MsgBox "The Last Name field must not be blank.", 48, "Last Name" Example Remember, for the buttons argument, you can add one value from each of the four groups.   An alternative (not recommended) is to use the hard-coded number for the buttons argument, as in: MsgBox "The Last Name field must not be blank.", 48, "Last Name"

MsgBox "A bad database error has occurred.", vbCritical, Example MsgBox "A bad database error has occurred.", vbCritical, "UpdateCustomerTable" Result:

IntegerVariable = Msgbox (arguments) Message box If you DO need to test which button the user clicked (i.e., message box with more than one button), then you must use MsgBox as a function, using the following syntax:  IntegerVariable = Msgbox (arguments)

Meesage box Constant Value Description vbOK 1 The OK button was pressed vbCancel 2 The Cancel button was pressed vbAbort 3 The Abort button was pressed vbRetry 4 The Retry button was pressed vbIgnore 5 The Ignore button was pressed vbYes 6 The Yes button was pressed vbNo 7 The No button was pressed

Example Result: Dim intResponse As Integer intResponse = MsgBox("Are you sure you want to quit?", vbYesNo + vbQuestion, "Quit") If intResponse = vbYes Then End End If Result: After the user clicks a button, you would test the return variable (intResponse) for a value of vbYes or vbNo (6 or 7).

Example Note that the use of the built-in constants makes the code more readable. The statement   intResponse = MsgBox("Are you sure you want to quit?", vbYesNo + vbQuestion, "Quit") is more readable than intResponse = MsgBox("Are you sure you want to quit?", 36, "Quit")

Example Note that the use of the built-in constants makes the code more readable. The statement   If intResponse = vbYes Then is more readable than If intResponse = 6 Then

Example You could use the MsgBox function directly in an if statement without using a separate variable to hold the result ("intResponse" in this case). For example, the above example could have been coded as: If MsgBox("Are you sure you want to quit?", vbYesNo + vbQuestion, "Quit")= vbYes Then End End If

Example Following is an example using the vbDefaultButton2 constant: Dim intResponse As Integer intResponse = MsgBox("Are you sure you want to delete all of the rows " & "in the Customer table?", vbYesNo + vbQuestion + vbDefaultButton2, "Delete") If intResponse = vbYes Then ' delete the rows ... End If The message box displayed by this example would look like this:

input box Input Box adalah kotak dialog yang dirancang khusus yang memungkinkan pemrogram meminta sebuah nilai dari pengguna dan menggunakan nilai itu seperlunya. Terdiri dari judul, pesan untuk menunjukkan nilai yang diminta, text box, dan 2 tombol: OK and Cancel. InputBox adalah perintah yang digunakan untuk menampilkan message box.

syntax Syntax: stringvariable = InputBox (“prompt” , “title” [, default] [, xpos] [, ypos]) Prompt. Required. Pesan yang ditampilkan di input box. Panjang maksimum prompt kira-kira 1024 karakter, tergantung lebar karakter yang digunakan. Title. Optional. Judul input box, jika tidak ditentukan maka nama program yang akan ditampilkan. Default. Optional. Ekspresi numerik yang akan tampil pertama kali saat kotak inputbox tampil. xpos and ypos. Optional. koordinat untuk menentukan posisi kotak masukan (ukuran pixel)

causes the following box to be displayed: Example The statement Dim strName As String strName = InputBox("Enter your name:", "Input Test") causes the following box to be displayed:

Example The statement strAcctID = InputBox("Enter account ID:", "Input Test", "ABC- 123") causes the following box to be displayed:

Example Private Sub Commandl_Click( ) Dim destination As String Do destination = InputBox("Enter destination", "Vacation destinations", _ "Hawaii", 100,300) If destination <> “” Then MsgBox "You have chosen" & destination Loop Until destination <> “ “ End Sub causes the following box to be displayed: