Universitas Sumatera Utara
|
|
- Sharon Marshall
- 6 years ago
- Views:
Transcription
1 43 L A M P I R A N
2 44 Penulisan Kode Program Aplikasi Game Tetris A. Kode program aplikasi game tetris untuk form1 ( MainF.frm ) adalah sebagai berikut. Dim BANK As Database Dim RS As DAO.Recordset Private Sub C_GotFocus(Index As Integer) KeyDownC.SetFocus End Sub Private Sub Check1_Click() KeyDownC.SetFocus End Sub Private Sub Check1_KeyDown(KeyCode As Integer, Shift As Integer) KeyDownC.SetFocus End Sub Private Sub Command1_Click() RS.MoveFirst RS.Edit RS("hiscoref") = 0
3 45 RS.Update HIS.Caption = "Hi Score : " + CStr(RS("hiscoref")) If KeyDownC.Enabled Then KeyDownC.SetFocus End Sub Private Sub Form_GotFocus() KeyDownC.SetFocus End Sub Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 39 Then Call MOVErigth If KeyCode = 37 Then Call MOVEleft End Sub Private Sub Form_Load() 'KeyDownC.SetFocus Set BANK = DBEngine.OpenDatabase(App.Path + "\hiscore.mdb") Set RS = BANK.OpenRecordset("his") RS.MoveFirst HIS.Caption = "Hi Score : " + CStr(RS("hiscoref")) BEGflag = True If SND.Value = 1 Then j = sndplaysound(app.path + "\startgame.wav", 0) nextshape BEGflag1 = True
4 46 MAINtimer.Enabled = True End Sub Private Sub Form_Unload(Cancel As Integer) If SND.Value = 1 Then j = sndplaysound(app.path + "\gameover.wav", SND_ASYNC Or SND_LOOP) End Sub Private Sub KeyDownC_KeyPress(KeyCode As Integer) KeyDownC.Caption = KeyAscii 'Form1.BackColor = GRRc.BackColor If KeyCode = 48 Then If SELshape = 4 Then SELshape = 1 Else SELshape = SELshape + 1 If KeyCode = 48 Then Call ROTATEshape If KeyCode = 54 Then Call MOVErigth If KeyCode = 52 Then Call MOVEleft If KeyCode = 53 Then Call MOVEdown 'If KeyCode = 51 Then Call nextshape If KeyCode = 32 Then FASTdownFLAG = True
5 47 Call MOVEdown If KeyCode = 112 Or KeyCode = 80 Then Call pousekey End Sub Function GetMEi() 'If BEGflag Then ' ' BEGflag = False Call GetMEi ' COLORt = S(6) 'PRi = i 'rewflag = True Randomize Timer pishi1 = Rnd * 1000 For i = 1 To 8 If pishi1 > i * And pishi1 <= i * 142 Then Exit For Next i TEMPi = PRi DEFshape If Not BEGflag Then PRi = i
6 48 Call PRIshape Else BEGflag = False Call GetMEi i = TEMPi 'BEGflag = False End Function Function nextshape() KeepFLAG = True MainI = 4 SELshape = 1 'For k = 1 To 160 ' MM(k) = False 'Next k If KeepFLAG = True Then GetMEi DEFshape For j = 0 To 3 MM(MainI + S(j)) = S(6) Next j For cleaner = 1 To 160 If MM(cleaner) <> 0 Then
7 49 If MM(cleaner) = 1 Then C(cleaner).BackColor = BCOLOR(1).BackColor If MM(cleaner) = 2 Then C(cleaner).BackColor = BCOLOR(2).BackColor If MM(cleaner) = 3 Then C(cleaner).BackColor = BCOLOR(3).BackColor If MM(cleaner) = 4 Then C(cleaner).BackColor = BCOLOR(4).BackColor If MM(cleaner) = 5 Then C(cleaner).BackColor = BCOLOR(5).BackColor If MM(cleaner) = 6 Then C(cleaner).BackColor = BCOLOR(6).BackColor If MM(cleaner) = 7 Then C(cleaner).BackColor = BCOLOR(7).BackColor Else C(cleaner).BackColor = BLAKc.BackColor Next cleaner If SND.Value = 1 Then j = sndplaysound(app.path + "\falldown.wav", SND_ASYNC Or SND_LOOP) End Function Private Sub LEVEL_KeyPress(KeyAscii As Integer) If KeyAscii = 112 Then Call pousekey End Sub Private Sub MAINtimer_Timer() MOVEdown End Sub
8 50 Function ROTATEshape() KeepFLAG = True 'MainI = 4 For j = 0 To 3 MM(MainI + S(j)) = 0 Next j 'If KeepFLAG = True Then 'GetMEi DEFshape ' temp = MainI Mod 10 If temp = 0 Then temp = 10 row = ((MainI - (temp)) / 10) + 1 If MainI > S(4) + ((row - 1) * 10) Then fillflag = True For q = 0 To 3 If MM(MainI + S(q)) Then fillflag = True Next q If fillflag Then If SELshape = 1 Then SELshape = 4 Else SELshape = SELshape - 1 DEFshape
9 51 fillflag = False For j = 0 To 3 MM(MainI + S(j)) = S(6) Next j For cleaner = 1 To 160 If MM(cleaner) <> 0 Then If MM(cleaner) = 1 Then C(cleaner).BackColor = BCOLOR(1).BackColor If MM(cleaner) = 2 Then C(cleaner).BackColor = BCOLOR(2).BackColor If MM(cleaner) = 3 Then C(cleaner).BackColor = BCOLOR(3).BackColor If MM(cleaner) = 4 Then C(cleaner).BackColor = BCOLOR(4).BackColor If MM(cleaner) = 5 Then C(cleaner).BackColor = BCOLOR(5).BackColor If MM(cleaner) = 6 Then C(cleaner).BackColor = BCOLOR(6).BackColor If MM(cleaner) = 7 Then C(cleaner).BackColor = BCOLOR(7).BackColor Else C(cleaner).BackColor = BLAKc.BackColor Next cleaner End Function Function MOVErigth() KeepFLAG = True For j = 0 To 3 MM(MainI + S(j)) = False Next j MainI = MainI + 1
10 52 temp = MainI Mod 10 If temp = 0 Then temp = 10 row = ((MainI - (temp)) / 10) + 1 If MainI > S(4) + ((row - 1) * 10) Then MainI = MainI - 1 If i = 7 And (SELshape = 2 Or SELshape = 4) And temp = 1 Then MainI = MainI - 1 For q = 0 To 3 If MM(MainI + S(q)) Then fillflag = True Next q If fillflag Then MainI = MainI - 1 fillflag = False For j = 0 To 3 MM(MainI + S(j)) = S(6) Next j For cleaner = 1 To 160 If MM(cleaner) <> 0 Then If MM(cleaner) = 1 Then C(cleaner).BackColor = BCOLOR(1).BackColor If MM(cleaner) = 2 Then C(cleaner).BackColor = BCOLOR(2).BackColor If MM(cleaner) = 3 Then C(cleaner).BackColor = BCOLOR(3).BackColor If MM(cleaner) = 4 Then C(cleaner).BackColor = BCOLOR(4).BackColor If MM(cleaner) = 5 Then C(cleaner).BackColor = BCOLOR(5).BackColor If MM(cleaner) = 6 Then C(cleaner).BackColor = BCOLOR(6).BackColor If MM(cleaner) = 7 Then C(cleaner).BackColor = BCOLOR(7).BackColor Else C(cleaner).BackColor = BLAKc.BackColor
11 53 Next cleaner End Function Function MOVEleft() KeepFLAG = True For j = 0 To 3 MM(MainI + S(j)) = 0 Next j MainI = MainI - 1 row = ((MainI - (MainI Mod 10)) / 10) + 1 If MainI < 1 + ((row - 1) * 10) Then MainI = MainI + 1 For q = 0 To 3 If MM(MainI + S(q)) <> 0 Then fillflag = True Next q If fillflag Then MainI = MainI + 1 fillflag = False 'If KeepFLAG = True Then '******************************** 'GetMEi ' DEFshape ' For j = 0 To 3 MM(MainI + S(j)) = S(6) Next j For cleaner = 1 To 160 If MM(cleaner) <> 0 Then
12 54 If MM(cleaner) = 1 Then C(cleaner).BackColor = BCOLOR(1).BackColor If MM(cleaner) = 2 Then C(cleaner).BackColor = BCOLOR(2).BackColor If MM(cleaner) = 3 Then C(cleaner).BackColor = BCOLOR(3).BackColor If MM(cleaner) = 4 Then C(cleaner).BackColor = BCOLOR(4).BackColor If MM(cleaner) = 5 Then C(cleaner).BackColor = BCOLOR(5).BackColor If MM(cleaner) = 6 Then C(cleaner).BackColor = BCOLOR(6).BackColor If MM(cleaner) = 7 Then C(cleaner).BackColor = BCOLOR(7).BackColor Else C(cleaner).BackColor = BLAKc.BackColor Next cleaner End Function Function MOVEdown() Dim lineflag As Boolean SCORE.Text = Val(SCORE.Text) + 5 'If MAINtimer.Interval < 200 Then ' MAINtimer.Interval = 500 ' LEVEL.Text = Val(LEVEL.Text) + 1 ' 'MAINtimer.Interval = MAINtimer.Interval - 2 'If SND.Value = 1 Then j = sndplaysound(app.path + "\falldown.wav", SND_ASYNC) KeepFLAG = True
13 55 For j = 0 To 3 MM(MainI + S(j)) = 0 Next j MainI = MainI + 10 'If MainI > S(5) Then 'p = i ' For q = 0 To 3 If MM(MainI + S(q)) <> 0 Then fillflag = True Next q If S(5) < MainI Or fillflag Then MainI = MainI - 10 For p = 0 To 3 MM(MainI + S(p)) = S(6) Next p fillflag = False If MainI < 10 And Not BEGflag1 Then MAINtimer.Enabled = False If Val(SCORE.Text) > RS("hiscoref") Then RS.Edit RS("hiscoref") = Val(SCORE.Text) RS.Update HIS.Caption = "Hi Score : " + CStr(RS("hiscoref")) C(44).BackColor = Smile.BackColor
14 56 C(47).BackColor = Smile.BackColor C(62).BackColor = Smile.BackColor C(73).BackColor = Smile.BackColor C(84).BackColor = Smile.BackColor C(85).BackColor = Smile.BackColor C(86).BackColor = Smile.BackColor C(87).BackColor = Smile.BackColor C(78).BackColor = Smile.BackColor C(69).BackColor = Smile.BackColor If SND.Value = 1 Then j = sndplaysound(app.path + "\gameover.wav", SND_ASYNC Or SND_LOOP) MsgBox "YOU LOSE THE GAME! " KeyDownC.Enabled = False Exit Function BEGflag1 = False For w = 0 To 15 lineflag = True For e = 1 To 10 If MM(w * 10 + e) = 0 Then lineflag = False Next e If lineflag = True Then SCORE.Text = Val(SCORE.Text) For r = w To 1 Step -1 For t = 1 To 10
15 57 MM(r * 10 + t) = MM((r - 1) * 10 + t) MM((r - 1) * 10 + t) = 0 'If MM(r * 10 + t) Then C(r * 10 + t).backcolor = GRRc.BackColor Else C(r * 10 + t).backcolor = BLAKc.BackColor Next t Next r 'GoTo 1 If SND.Value = 1 Then j = sndplaysound(app.path + "\LINEFILL.wav", SND_ASYNC) Next w For cleaner = 1 To 160 If MM(cleaner) <> 0 Then If MM(cleaner) = 1 Then C(cleaner).BackColor = BCOLOR(1).BackColor If MM(cleaner) = 2 Then C(cleaner).BackColor = BCOLOR(2).BackColor If MM(cleaner) = 3 Then C(cleaner).BackColor = BCOLOR(3).BackColor If MM(cleaner) = 4 Then C(cleaner).BackColor = BCOLOR(4).BackColor If MM(cleaner) = 5 Then C(cleaner).BackColor = BCOLOR(5).BackColor If MM(cleaner) = 6 Then C(cleaner).BackColor = BCOLOR(6).BackColor If MM(cleaner) = 7 Then C(cleaner).BackColor = BCOLOR(7).BackColor Else C(cleaner).BackColor = BLAKc.BackColor Next cleaner FASTdownFLAG = False
16 58 nextshape Else If FASTdownFLAG Then Call MOVEdown 'If MainI > 140 Then MainI = MainI - 10 'If KeepFLAG = True Then 'GetMEi 'DEFshape ' For j = 0 To 3 MM(MainI + S(j)) = S(6) Next j For cleaner = 1 To 160 If MM(cleaner) <> 0 Then If MM(cleaner) = 1 Then C(cleaner).BackColor = BCOLOR(1).BackColor If MM(cleaner) = 2 Then C(cleaner).BackColor = BCOLOR(2).BackColor If MM(cleaner) = 3 Then C(cleaner).BackColor = BCOLOR(3).BackColor If MM(cleaner) = 4 Then C(cleaner).BackColor = BCOLOR(4).BackColor If MM(cleaner) = 5 Then C(cleaner).BackColor = BCOLOR(5).BackColor If MM(cleaner) = 6 Then C(cleaner).BackColor = BCOLOR(6).BackColor If MM(cleaner) = 7 Then C(cleaner).BackColor = BCOLOR(7).BackColor Else C(cleaner).BackColor = BLAKc.BackColor Next cleaner
17 59 'If lineflag = True Then ' ' lineflag = False Exit Function ' End Function Private Sub NEW_GAME_Click() HIS.Caption = "Hi Score : " + CStr(RS("hiscoref")) MainI = 4 For lk = 0 To 160 MM(lk) = 0 Next lk SCORE.Text = 0 LEVEL.Text = 1 MAINtimer.Enabled = True KeyDownC.Enabled = True If KeyDownC.Enabled Then KeyDownC.SetFocus If SND.Value = 1 Then j = sndplaysound(app.path + "\startgame.wav", SND_ASYNC Or SND_LOOP) End Sub Private Sub NEW_GAME_KeyPress(KeyAscii As Integer) If KeyAscii = 112 Or KeyAscii = 80 Then Call pousekey
18 60 End Sub Function pousekey() MAINtimer.Enabled = Not MAINtimer.Enabled KeyDownC.Enabled = Not KeyDownC.Enabled If KeyDownC.Enabled Then KeyDownC.SetFocus End Function Private Sub SCORE_KeyPress(KeyAscii As Integer) If KeyAscii = 112 Or KeyAscii = 80 Then Call pousekey End Sub Function PRIshape() For m = 1 To 4 A(m).BackColor = PINKc.BackColor A(m + 10).BackColor = PINKc.BackColor A(m + 20).BackColor = PINKc.BackColor A(m + 30).BackColor = PINKc.BackColor Next m If S(6) = 0 Then Exit Function Select Case PRi
19 61 Case 1 GoTo 1 Case 2 GoTo 2 Case 3 GoTo 3 Case 4 GoTo 4 Case 5 GoTo 5 Case 6 GoTo 6 Case 7 GoTo 7 End Select 1 A(2).BackColor = BCOLOR(S(6)).BackColor A(3).BackColor = BCOLOR(S(6)).BackColor A(11).BackColor = BCOLOR(S(6)).BackColor A(12).BackColor = BCOLOR(S(6)).BackColor Exit Function 2 A(1).BackColor = BCOLOR(S(6)).BackColor A(2).BackColor = BCOLOR(S(6)).BackColor A(12).BackColor = BCOLOR(S(6)).BackColor
20 62 A(13).BackColor = BCOLOR(S(6)).BackColor Exit Function 3 A(1).BackColor = BCOLOR(S(6)).BackColor A(11).BackColor = BCOLOR(S(6)).BackColor A(21).BackColor = BCOLOR(S(6)).BackColor A(22).BackColor = BCOLOR(S(6)).BackColor Exit Function 4 A(2).BackColor = BCOLOR(S(6)).BackColor A(12).BackColor = BCOLOR(S(6)).BackColor A(21).BackColor = BCOLOR(S(6)).BackColor A(22).BackColor = BCOLOR(S(6)).BackColor Exit Function 5 A(2).BackColor = BCOLOR(S(6)).BackColor A(11).BackColor = BCOLOR(S(6)).BackColor A(12).BackColor = BCOLOR(S(6)).BackColor A(13).BackColor = BCOLOR(S(6)).BackColor Exit Function 6
21 63 A(1).BackColor = BCOLOR(S(6)).BackColor A(2).BackColor = BCOLOR(S(6)).BackColor A(11).BackColor = BCOLOR(S(6)).BackColor A(12).BackColor = BCOLOR(S(6)).BackColor Exit Function 7 A(1).BackColor = BCOLOR(S(6)).BackColor A(2).BackColor = BCOLOR(S(6)).BackColor A(3).BackColor = BCOLOR(S(6)).BackColor A(4).BackColor = BCOLOR(S(6)).BackColor Exit Function End Function Private Sub SND_Click() If KeyDownC.Enabled Then KeyDownC.SetFocus End Sub
22 64 B. Kode program untuk Modules yg diberi nama ( PhisiM.bas ). Declare Function sndplaysound Lib "winmm.dll" Alias "sndplaysounda" (ByVal lpszsoundname As String, ByVal uflags As Long) As Long Global S(6) As Integer 'global s2(3) As Integer 'Global s3(3) As Integer 'Global s4(3) As Integer 'Global s5(3) As Integer 'Global s6(3) As Integer 'Global s7(3) As Integer Global MM(160) As Integer 'if 0 then null if 1 then blue if 2 red Global SELshape As Integer Global MainI As Integer Global KeepFLAG As Boolean Global rewflag As Boolean Global i As Integer Global row As Integer Global fillflag As Boolean Global FASTdownFLAG As Boolean Global ShColor As Integer Global PRi As Integer Global BEGflag As Boolean Global TEMPi As Integer
23 65 Global BEGflag1 As Boolean Global COLORt As Integer Function DEFshape() Select Case SELshape Case 1 'KIND a Select Case i Case 1 S(0) = 1 S(1) = 2 S(2) = 10 S(3) = 11 S(4) = 8 S(5) = 140 Case 2 S(1) = 1 S(2) = 11 S(3) = 12 S(4) = 8 S(5) = 140 Case 3
24 66 S(1) = 10 S(2) = 20 S(3) = 21 S(5) = 130 S(4) = 9 Case 4 S(0) = 1 S(1) = 11 S(2) = 20 S(3) = 21 S(4) = 9 S(5) = 130 Case 5 S(0) = 1 S(1) = 10 S(2) = 11 S(3) = 12 S(4) = 8 S(5) = 140 Case 6 S(1) = 1 S(2) = 10 S(3) = 11 S(4) = 9
25 67 S(5) = 140 Case 7 S(1) = 1 S(2) = 2 S(3) = 3 S(4) = 7 S(5) = 150 End Select Case 2 'KIND b Select Case i Case 1 S(1) = 10 S(2) = 11 S(3) = 21 S(4) = 9 S(5) = 130 Case 2 S(0) = 1 S(1) = 10 S(2) = 11 S(3) = 20 S(4) = 9
26 68 S(5) = 130 Case 3 S(1) = 1 S(2) = 2 S(3) = 10 S(4) = 8 S(5) = 140 Case 4 S(1) = 10 S(2) = 11 S(3) = 12 S(4) = 8 S(5) = 140 Case 5 S(1) = 10 S(2) = 11 S(3) = 20 S(4) = 9 S(5) = 130 Case 6 S(1) = 1
27 69 S(2) = 10 S(3) = 11 S(4) = 9 S(5) = 140 Case 7 S(1) = 10 S(2) = 20 S(3) = 30 S(4) = 10 S(5) = 120 End Select Case 3 'KIND c Select Case i Case 1 S(0) = 1 S(1) = 2 S(2) = 10 S(3) = 11 S(4) = 8 S(5) = 140 Case 2 S(1) = 1
28 70 S(2) = 11 S(3) = 12 S(4) = 8 S(5) = 140 Case 3 S(1) = 1 S(2) = 11 S(3) = 21 S(4) = 9 S(5) = 130 Case 4 S(1) = 1 S(2) = 10 S(3) = 20 S(4) = 9 S(5) = 130 Case 5 S(1) = 1 S(2) = 2 S(3) = 11 S(4) = 8 S(5) = 140
29 71 Case 6 S(1) = 1 S(2) = 10 S(3) = 11 S(4) = 9 S(5) = 140 Case 7 S(1) = 1 S(2) = 2 S(3) = 3 S(4) = 7 S(5) = 150 End Select Case 4 'KIND d Select Case i Case 1 S(1) = 10 S(2) = 11 S(3) = 21 S(4) = 9 S(5) = 130
30 72 Case 2 S(0) = 1 S(1) = 10 S(2) = 11 S(3) = 20 S(4) = 9 S(5) = 130 Case 3 S(0) = 2 S(1) = 10 S(2) = 11 S(3) = 12 S(4) = 8 S(5) = 140 Case 4 S(1) = 1 S(2) = 2 S(3) = 12 S(4) = 8 S(5) = 140 Case 5 S(0) = 1 S(1) = 10 S(2) = 11
31 73 S(3) = 21 S(4) = 9 S(5) = 130 Case 6 S(1) = 1 S(2) = 10 S(3) = 11 S(4) = 9 S(5) = 140 Case 7 S(1) = 10 S(2) = 20 S(3) = 30 S(4) = 10 S(5) = 120 End Select End Select Select Case i Case 1 S(6) = 1 Case 2 S(6) = 2 Case 3
32 74 S(6) = 3 Case 4 S(6) = 4 Case 5 S(6) = 5 Case 6 S(6) = 6 Case 7 S(6) = 7 End Select End Function
HELP - VB TIPS. ANIMATE AN IMAGE BOX Insert a module. In this module, create a global variable: Global x
HELP - VB TIPS Load an image to an image box from a certain folder If you use this method, won t work on N:\ To load an image to a image control Image1.Picture = LoadPicture("H:\MyVBfolder\stop.gif") Load
More informationProject : Version : Date : 11/04/2016 Author : Freeware, for evaluation and non-commercial use only Company : Comments:
Lampiran 1 Listing program dari seluruh sistem. /***************************************************** This program was produced by the CodeWizardAVR V2.04.9 Evaluation Automatic Program Generator Copyright
More informationHuman Factors Engineering Short Course Topic: A Simple Numeric Entry Keypad
Human Factors Engineering Short Course 2016 Creating User Interface Prototypes with Microsoft Visual Basic for Applications 3:55 pm 4:55 pm, Wednesday, July 27, 2016 Topic: A Simple Numeric Entry Keypad
More informationIS 320 Spring 96 Page 1 Exam 1. Please use your own paper to answer the following questions. Point values are shown in parentheses.
IS 320 Spring 96 Page 1 Please use your own paper to answer the following questions. Point values are shown in parentheses. 1. (10) Consider the following segment of code: If txtansicode.text < "0" Or
More informationFunction: function procedures and sub procedures share the same characteristics, with
Function: function procedures and sub procedures share the same characteristics, with one important difference- function procedures return a value (e.g., give a value back) to the caller, whereas sub procedures
More informationAn InputBox( ) function will display an input Box window where the user can enter a value or a text. The format is
InputBox( ) Function An InputBox( ) function will display an input Box window where the user can enter a value or a text. The format is A = InputBox ( Question or Phrase, Window Title, ) Example1: Integer:
More informationDATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6)
Technology & Information Management Instructor: Michael Kremer, Ph.D. Database Program: Microsoft Access Series DATABASE AUTOMATION USING VBA (ADVANCED MICROSOFT ACCESS, X405.6) AGENDA 3. Executing VBA
More informationPlease answer questions in the space provided. Question point values are shown in parentheses.
IS 320 Spring 99 Page 1 Please answer questions in the space provided. Question point values are shown in parentheses. 1. (15) Assume you have the following variable declarations and assignments: Dim A
More informationProgramming with visual Basic:
Programming with visual Basic: 1-Introdution to Visual Basics 2-Forms and Control tools. 3-Project explorer, properties and events. 4-make project, save it and its applications. 5- Files projects and exercises.
More informationMy first game. 'function which adds objects with bug tag to bugarray array. Saturday, November 23, :06 AM
My first game Saturday, November 23, 2013 5:06 AM Public Class Form1 Dim moveright As Boolean = False Dim moveup As Boolean = False Dim moveleft As Boolean = False Dim movedown As Boolean = False Dim score
More informationCMPT 110 MIDTERM OCTOBER 18, 2001
CMPT 110 MIDTERM OCTOBER 18, 2001 1 What will be displayed when the command button is clicked? 7% Level of difficulty 7 (out of 10) Assume there is a command button called cmdbutton Assume there is a picturebox
More informationVISUAL BASIC SERVER INTERFACE CODE. Visual Basic 6 Graphical Interface 103. Visual Basic Module rtsscomm.bas Code.115
APPENDIX E VISUAL BASIC SERVER INTERFACE CODE Page E.1: E.2: E.3: E.4: E.5: Visual Basic 6 Graphical Interface 103 Visual Basic Form gyrofront.frm Code.....104 Visual Basic Module mydatatypes.bas Code..114
More information2-26 Learn Visual Basic 6.0
2-26 Learn Visual Basic 6.0 cmdcompute Click Event: Private Sub cmdcompute_click() Dim Mean As Single Dim StdDev As Single txtinput.setfocus Make sure there are at least two values If NumValues < 2 Then
More informationRemainder Cordial Labeling of Graphs
Journal of Algorithms and Computation journal homepage: http://jac.ut.ac.ir Remainder Cordial Labeling of Graphs R. Ponraj 1, K. Annathurai and R. Kala 3 1 Department of Mathematics, Sri Paramakalyani
More informationIS 320 A/B Spring 97 Page 1 Exam 1
IS 320 A/B Spring 97 Page 1 Please use the paper supplied by the instructor to answer the questions. Question point values are shown in parentheses. 1. (18) What output is generated by the three MsgBox
More informationDownload the files from you will use these files to finish the following exercises.
Exercise 6 Download the files from http://www.peter-lo.com/teaching/x4-xt-cdp-0071-a/source6.zip, you will use these files to finish the following exercises. 1. This exercise will guide you how to create
More informationPROGRAM 1: SIMPLE CALCULATOR
PROGRAM 1: SIMPLE CALCULATOR Option Explicit Dim operand1 As Double, operand2 As Double Dim op1 As Double, op2 As Double Dim operator As String Dim cleardisplay As Boolean Private Sub Cmdclear_Click()
More informationAIM To analyze, design and develop code for Online Course Reservation System using Rational Rose software
Ex. No.1 Date: ONLINE COURSE RESERVATION AIM To analyze, design and develop code for Online Course Reservation System using Rational Rose software PROBLEM STATEMENT As the head of information systems for
More informationVisual Basic 6 Lecture 7. The List Box:
The List Box: The function of the List Box is to present a list of items where the user can click and select the items from the list or we can use the List Box control as a simple memory to save data.
More informationC:\MasterPageWeb\HAPR\docu\HAPR_VB6_version15sept06.rtf 19/10/08. HARP_VB projet en VB6
HARP_VB projet en VB6 Option Explicit Dim Value As Integer Dim i As Integer Dim il As Long Dim LL, L1S, L250µS, L500µS, L1mS, L2mS, L5mS, L10mS As Single Dim offsetdepart As Long Dim police(256, 8) As
More informationUniversity of Technology Laser & Optoelectronics Engineering Department Visual basic Lab. LostFocus Resize System event
Events Private Sub Form_Load() Load Close Unload Private Sub Form_Unload(Cancel As Integer) Cancel=True Cancel * Show Activate SetFocus Focus Deactivate SetFocus GotFocus CommandButton LostFocus Resize
More informationMr.Khaled Anwar ( )
The Rnd() function generates random numbers. Every time Rnd() is executed, it returns a different random fraction (greater than or equal to 0 and less than 1). If you end execution and run the program
More informationRelational Operators. > greater than < less than >= greater than or equal to <= less than or equal to <> not equal to = equal to
Relational Operators > greater than < less than >= greater than or equal to
More informationSimply Access Tips. Issue April 26 th, Welcome to the twelfth edition of Simply Access Tips for 2007.
Hi [FirstName], Simply Access Tips Issue 12 2007 April 26 th, 2007 Welcome to the twelfth edition of Simply Access Tips for 2007. Housekeeping as usual is at the end of the Newsletter so, if you need to
More informationRevision for Final Examination (Second Semester) Grade 9
Revision for Final Examination (Second Semester) Grade 9 Name: Date: Part 1: Answer the questions given below based on your knowledge about Visual Basic 2008: Question 1 What is the benefit of using Visual
More informationIS 320 A/B Winter 1998 Page 1 Exam 1
IS 320 A/B Winter 1998 Page 1 Use your own paper to answer the questions. You may do work on this document but transfer your answers to separate sheets of paper. Turn in this document as well as your answers
More informationCPS Plus Data Acquisition Software ActiveX interface
Overview CPS Plus ActiveX interface enables communication with devices connected via RS232 COM ports and the devices with keyboard emulation using ActiveX technology. Use of CPS Plus ActiveX interface
More informationPG-MSR207 manual swipe magnetic card Reader/Writer User s Guide
PG-MSR207 manual swipe magnetic card Reader/Writer User s Guide Ver.7.01 Table of the contents Introduction.....3 Hardware specifications......3 Accessories of PG-MSR207...4 Using the PG-MSR207 Software...4
More informationRespond to Data Entry Events
Respond to Data Entry Events Callahan Chapter 4 Understanding Form and Control Events Developer s Goal make data entry easy, fast, complete, accurate Many form- and control-level events occur as user works
More informationThe Control Properties
The Control Properties Figure Before writing an event procedure for the control to response to a user's input, you have to set certain properties for the control to determine its appearance and how it
More informationTutorial, Source code, Request Program Visual Basic
Tutorial, Source code, Request Program Visual Basic Oleh : Moh. A Azis Membuat Form Data Barang Program Persediaan Barang Form Data Barang digunakan untuk menyimpan data barang dan memberikan info mengenai
More informationUniversitas Sumatera Utara
Option Explicit DefLng A-Z '--------------------------------------------------------------------------------------------- #Const Test = False '---------------------------------------------------------------------------------------------
More informationREFERENCE MATERIALS. Assignment, Display, and Input Evaluates expression and assigns the result to the variable a.
a expression Assignment, Display, and Input Evaluates expression and assigns the result to the variable a. DISPLAY (expression) Displays the value of expression, followed by a space. INPUT () Accepts a
More informationต วอย างการสร างฟอร ม เมน การใช งาน
ต วอย างการสร างฟอร ม เมน การใช งาน Option Explicit Dim conn As New ADODB.Connection Dim rs As New ADODB.Recordset Dim Sql As String Private Sub Command6_Click() Form2.Hide Form3.Show Private Sub Command7_Click()
More informationVisual Basic for Applications
Visual Basic for Applications Programming Damiano SOMENZI School of Economics and Management Advanced Computer Skills damiano.somenzi@unibz.it Week 10 Outline 1 Algorithms Sorting Exercises: exchange values,
More informationS.2 Computer Literacy Question-Answer Book
S.2 C.L. Half-yearly Examination (2012-13) 1 12-13 S.2 C.L. Question- Answer Book Hong Kong Taoist Association Tang Hin Memorial Secondary School 2012-2013 Half-yearly Examination S.2 Computer Literacy
More informationTABLE OF CONTENTS ADVANCED VISUAL BASIC
TABLE OF CONTENTS ADVANCED VISUAL BASIC TABLE OF CONTENTS ADVANCED VISUAL BASIC...1 REVIEW OF IMPORTANT PROGRAMMING CONCEPTS...4 OVERVIEW...4 EXCERPT FROM WIKIPEDIA ARTICLE ON CAMELCASE...5 REVIEW QUESTIONS...6
More informationLAMPIRAN A : LISTING PROGRAM
LAMPIRAN A : LISTING PROGRAM 1. frmmenu.frm Dim CN As Connection Dim rshapus As Recordset Private Sub DfaHasil_Click() Call frmlap.cetak Private Sub Form_Load() Set CN = New ADODB.Connection CN.ConnectionString
More informationSébastien Mathier wwwexcel-pratiquecom/en While : Loops make it possible to repeat instructions a number of times, which can save a lot of time The following code puts sequential numbers into each of the
More informationContents Introduction Getting Started Visual Basic Form Configuration Entering the VB Code
Your comments and suggestions on the operation of this software are welcome. Please address them to: ICONICS 100 Foxborough Blvd. Foxborough, MA 02035 Tel: 508-543-8600 Fax: 508-543-1503 E-mail: support@iconics.com
More informationADVANCED ALGORITHMS TABLE OF CONTENTS
ADVANCED ALGORITHMS TABLE OF CONTENTS ADVANCED ALGORITHMS TABLE OF CONTENTS...1 SOLVING A LARGE PROBLEM BY SPLITTING IT INTO SEVERAL SMALLER SUB-PROBLEMS CASE STUDY: THE DOOMSDAY ALGORITHM... INTRODUCTION
More informationLearning VB.Net. Tutorial 19 Classes and Inheritance
Learning VB.Net Tutorial 19 Classes and Inheritance Hello everyone welcome to vb.net tutorials. These are going to be very basic tutorials about using the language to create simple applications, hope you
More informationDepartment of Computer and Mathematical Sciences. Lab 7: Selection
Unit 2: Visual Basic.NET, pages 1 of 11 Department of Computer and Mathematical Sciences CS 1408 Intro to Computer Science with Visual Basic.NET 7 Lab 7: Selection Objectives: The main objective of this
More informationComplete program to solve a 2 nd degree equation
Fundamentals of Computer Science 2010-2011 Laboratory 10 Functions and procedures (3) Objectives: To go deeply into the use of subprograms and passing parameters by reference To go deeply into the manipulation
More informationEnd Sub. Sub Kunci() Dim i As Integer For i = 0 To 4 Txtfield(i).Locked = True Next i grddatagrid.enabled = False End Sub
Source Aplikasi Sistem Informasi Akademik GENERAL Dim db As Connection Dim WithEvents adoprimaryrs1 As Recordset Dim WithEvents adoprimaryrs2 As Recordset Dim WithEvents rscaridata As Recordset Dim cekid
More informationSub Programs. To Solve a Problem, First Make It Simpler
Sub Programs To Solve a Problem, First Make It Simpler Top Down Design Top Down Design Start with overall goal. Break Goal into Sub Goals Break Sub Goals into Sub Sub Goals Until the Sub-Sub Sub-Sub Sub-Sub
More informationSave and Load Searches in Access VBA
Save and Load Searches in Access VBA How to allow your users to load and save form states in Access through VBA to provide cross-session saving and retrieval of search or other information. This article
More informationEGR1301_Linear_Equation_Solver_ docx. 1. Select Options 2. Select Add Ins. 3. Select Solver Add in and press OK.
1. Select Options 2. Select Add Ins 3. Select Solver Add in and press OK Page 1 of 13 4. Select Analysis ToolPak and press OK 5. Select Analysis ToolPak VBA and press OK Page 2 of 13 6. From Quick Access
More informationNOTES: Procedures (module 15)
Computer Science 110 NAME: NOTES: Procedures (module 15) Introduction to Procedures When you use a top-down, structured program design, you take a problem, analyze it to determine what the outcome should
More informationLISTING PROGRAM. 1. Form Login. Private Sub BATAL_Click() End End Sub
LISTING PROGRAM 1. Form Login Private Sub BATAL_Click() End Sub Bersih() USERNAME.Text = "" PASSWORD.Text = "" Private Sub Form_Load() Bersih Private Sub OK_Click() Sql = "select*from tbl_login where username='"
More informationLAMPIRAN FORM 1 Universitas Sumatera Universitas Utara
LAMPIRAN FORM 1 Private Sub Text2_KeyPress(KeyAscii As Integer) If KeyAscii = vbkeyreturn Then Set tbladministrator = New ADODB.Recordset With tbladministrator.open "SELECT * FROM Administrator WHERE userid
More informationOperating Software Instruction Manual for MCC Series of Motion Controllers
Operating Software Instruction Manual for MCC Series of Motion Controllers Control Panel Stand-alone Operation Command Reference Manual Host Controlled Operation Power-up Help System Operation Controlling
More informationDroidBasic Syntax Contents
DroidBasic Syntax Contents DroidBasic Syntax...1 First Edition...3 Conventions Used In This Book / Way Of Writing...3 DroidBasic-Syntax...3 Variable...4 Declaration...4 Dim...4 Public...4 Private...4 Static...4
More informationMIS 216 SPRING 2018 PROJECT 4
MIS 216 SPRING 2018 PROJECT 4 Subs / Functions Arrays / Classes 1. Start a new project a. Create a folder on your desktop name it yourinitialsproject3 as in tnjproject3. b. FILE NEW PROJECT c. Change the
More informationObjectives. Introduce the core C# language features class Main types variables basic input and output operators arrays control constructs comments
Basics Objectives Introduce the core C# language features class Main types variables basic input and output operators arrays control constructs comments 2 Class Keyword class used to define new type specify
More informationFinancial Functions (all with subtypes: Normal, Stairs, Points, Height, Hollow, Colors, Marks, No Border except where indicated):
Financial Charting in TeeChart Pro TeeChart Pro has always been at the cutting edge of Financial Charting and the ActiveX v6 makes this very clear; with three distinct financial series and fourteen dedicated
More informationIS 320 A-C Page 1 Spring 99 Exam 2
IS 320 A-C Page 1 Please use the space provided on the exam for your answers to the following questions. Note that question values are shown in parentheses. 1. (18) Consider the following user interface
More informationUNIT 1. Introduction to Microsoft.NET framework and Basics of VB.Net
UNIT 1 Introduction to Microsoft.NET framework and Basics of VB.Net 1 SYLLABUS 1.1 Overview of Microsoft.NET Framework 1.2 The.NET Framework components 1.3 The Common Language Runtime (CLR) Environment
More informationThe SudokuPuzzle Class
APPENDIX A The SudokuPuzzle Class Listing A-1 provides partial code for the SudokuPuzzle class that contains the logic to solve Sudoku puzzles (without the GUI code), as discussed throughout the book.
More information11-1 11-1.1 11-1.2 11-2 11-2.1 11-2.2 108 II 11-1 Timer 11-1.1 Windows 11-1 11-1 Visual Basic Animation Animation 11 109 Animation Animation RLE AVI AVI 11-2 Visual Basic Animation / Microsoft Windows
More informationPROJECT ELECTRONIC CONTROL GAS INJECTION SYSTEM
PROJECT ELECTRONIC CONTROL GAS INJECTION SYSTEM SOURCE CODE VISUAL BASIC Dim WR As Boolean Dim pw Dim data Dim oxg Public index1 Dim index2 Dim k Dim u Dim refd Dim datar1$(1000, 9) Dim c_data Dim A$(10)
More informationRecap. ANSI C Reserved Words C++ Multimedia Programming Lecture 2. Erwin M. Bakker Joachim Rijsdam
Multimedia Programming 2004 Lecture 2 Erwin M. Bakker Joachim Rijsdam Recap Learning C++ by example No groups: everybody should experience developing and programming in C++! Assignments will determine
More informationVisual Basic. The Integrated Development Environment. Menu Bar
Visual Basic Visual Basic is initiated by using the Programs option > Microsoft Visual Basic 6.0 > Visual Basic 6.0. Clicking the Visual Basic icon, we can view a copyright screen enlisting the details
More information1. Create your First VB.Net Program Hello World
1. Create your First VB.Net Program Hello World 1. Open Microsoft Visual Studio and start a new project by select File New Project. 2. Select Windows Forms Application and name it as HelloWorld. Copyright
More informationLISTING PROGRAM. 1. Menu Utama
LISTING PROGRAM 1. Menu Utama Dim rsupdate As Recordset Dim rscari As Recordset Dim strusername As String * 10 Dim Status As String * 1 Dim JumUser As Integer Public system_mon As String Public service_mon
More informationElseIf: Another Conditional Statement
If This, Then What? If color = true Then If thecolor = blue Then lblsuess.caption = blue fish lblsuess.caption = red fish lblsuess.caption = thenumber & & fish Take out a piece of paper. Write your name
More informationAP Computer Science Principles Exam Reference Sheet
AP Computer Science Principles Exam Reference Sheet July 2015 As AP Computer Science Principles does not designate any particular programming language, this reference sheet provides instructions and explanations
More information20. VB Programming Fundamentals Variables and Procedures
20. VB Programming Fundamentals Variables and Procedures 20.1 Variables and Constants VB, like other programming languages, uses variables for storing values. Variables have a name and a data type. Array
More informationHow to use JS Automation I/O driver
How to use JS Automation I/O driver 1 Introduction JS Automation I/O driver package provide the basic I/O system driver and Dll to link with programming language (such as Visual Basic Visual C++ C++ Builder
More informationBeginning Programming (Pascal) Lecture 75. Figure 1. type-declarations. simple-type. pointer-type. array-type. file-type. set-type.
-declarations -identifier = ; ; Figure 1. -declarations simple- pointer- array- file- set- record- Figure 2. simple- standard- subrange- enumerated- Figure 3. simple- standard- boolean char integer real
More informationVisual Basic Visual Basic
9-1 9-2 9-1.1 9-1.2 9-1.3 9-2.1 9-2.2 9-2.3 9-3 Visual Basic 9-3.1 Visual Basic 9-3.2 9-4 9-4.1 9-4.2 2 II 9-1 GoTo http://noi.stinfo.net/ xbqj/xbqj_12.htm structured programming 9-1 9-1 a goto b c goto
More informationUsing BasicX to Derive Acceleration From GARMIN GPS Text Data
Basic Express Application Note Using BasicX to Derive Acceleration From GARMIN GPS Text Data Introduction Global Positioning System (GPS) receivers are typically able to measure position, velocity and
More informationJAVA MOCK TEST JAVA MOCK TEST II
http://www.tutorialspoint.com JAVA MOCK TEST Copyright tutorialspoint.com This section presents you various set of Mock Tests related to Java Framework. You can download these sample mock tests at your
More informationFlow Control. CSC215 Lecture
Flow Control CSC215 Lecture Outline Blocks and compound statements Conditional statements if - statement if-else - statement switch - statement? : opertator Nested conditional statements Repetitive statements
More information5 When a program calls a function, in which type of data structure is memory allocated for the variables in that function?
1 The finally block of an exception handler is: -executed when an exception is thrown -always executed when the code leaves any part of the Try statement -always executed -always executed when the code
More informationComputing Science Unit 1
Computing Science Unit 1 Software Design and Development Programming Practical Tasks Business Information Technology and Enterprise Contents Input Validation Find Min Find Max Linear Search Count Occurrences
More informationHigher Computing Science Software Design and Development - Programming Summary Notes
Higher Computing Science Software Design and Development - Programming Summary Notes Design notations A design notation is the method we use to write down our program design. Pseudocode is written using
More informationThat means circular linked list is similar to the single linked list except that the last node points to the first node in the list.
Leaning Objective: In this Module you will be learning the following: Circular Linked Lists and it operations Introduction: Circular linked list is a sequence of elements in which every element has link
More informationPropose a mathematical formula to verify the authenticity of any product of the integers using a scale (9) and verified using computer
(9) Propose a mathematical formula to verify the authenticity of any product of the integers using a scale (9) and verified using computer. (9). Abstract This research aims to propose a mathematical formula
More informationQuick Reference Guide
SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD mikroelektronika Development tools - Books - Compilers Quick Reference Quick Reference Guide with EXAMPLES for Basic language This reference guide
More informationBeispiel Joystick. Code frm_joytest
Beispiel Joystick Code frm_joytest Option Explicit Private j_id, j_error, j_cbjc As Long Private j_caps As JOYCAPS Private j_info As JOYINFO Private j_infoex As JOYINFOEX Private j_run As Boolean Private
More informationLISTING PROGRAM. Form Splash
LISTING PROGRAM Form Splash Private Sub Form_Load() lblversion.caption = "Version " & App.Major & "." & App.Minor & "." & App.Revision lblproductname.caption = App.Title lblcopyright.caption = App.LegalCopyright
More informationThe following are required to duplicate the process outlined in this document.
Technical Note ClientAce WPF Project Example 1. Introduction Traditional Windows forms are being replaced by Windows Presentation Foundation 1 (WPF) forms. WPF forms are fundamentally different and designed
More informationMr. Giansante. Visual Basic. Adventure Game
Visual Basic Adventure Game August 2016 Difficulty Level: Beginner Intermediate Advanced Help References: Button Control MenuStrip Control Random Numbers Arrays Designing the Game Print the "Adventure
More informationSébastien Mathier wwwexcel-pratiquecom/en Variables : Variables make it possible to store all sorts of information Here's the first example : 'Display the value of the variable in a dialog box 'Declaring
More informationBasics of Java: Expressions & Statements. Nathaniel Osgood CMPT 858 February 15, 2011
Basics of Java: Expressions & Statements Nathaniel Osgood CMPT 858 February 15, 2011 Java as a Formal Language Java supports many constructs that serve different functions Class & Interface declarations
More information2. (16) Salesperson bonuses are paid based on a combination of total unit sales and the number of new accounts according to the following table:
IS 320 Exam 1 page 1 Please use the space provided on this exam to answer the questions. Clearly show your work for possible partial credit. Question point values are shown in parenthses. 1. (16) Given
More informationCSC Java Programming, Fall Java Data Types and Control Constructs
CSC 243 - Java Programming, Fall 2016 Java Data Types and Control Constructs Java Types In general, a type is collection of possible values Main categories of Java types: Primitive/built-in Object/Reference
More informationI101/B100 Problem Solving with Computers
I101/B100 Problem Solving with Computers By: Dr. Hossein Computer Science and Informatics IU South Bend 1 What do we need to learn in order to write computer programs? Fundamental programming constructs:
More informationStatements and Operators
Statements and Operators Old Content - visit altium.com/documentation Mod ifi ed by Rob Eva ns on Feb 15, 201 7 Parent page: EnableBasic Enable Basic Statements Do...Loop Conditional statement that repeats
More informationProcedures. This is a common situation -- there is some functionality that computers should have that the do not the solution is to write a procedure
Procedures Procedures are familiar in everyday life -- they are a standard process for achieving some objective. Procedures in computers are similar: They are a standard process of computing some result.
More informationFunctions and Procedures. Functions. Built In Functions. Built In Functions in VB FIT 100 FIT 100
Functions Functions and Procedures Similarities: Little mini-programs that are named and include a series of code statements (instructions) to be executed when called. Differences: Functions have a specific
More information2Practicals Visual Basic 6.0
2Practicals Visual Basic 6.0 Practical 1: 1. Navigation of Visual Basic Integrated Development Environment The Visual Basic IDE is made up of a number of components Menu Bar Tool Bar Project Explorer Properties
More informationUnit 4. Lesson 4.1. Managing Data. Data types. Introduction. Data type. Visual Basic 2008 Data types
Managing Data Unit 4 Managing Data Introduction Lesson 4.1 Data types We come across many types of information and data in our daily life. For example, we need to handle data such as name, address, money,
More informationCSC 112 :: Test #2 Study Guide with Answers April 25, 2012 Short Answer Questions
CSC 112 :: Test #2 Study Guide with Answers April 25, 2012 Short Answer Questions (1-6) Regarding the code for Lab #7: Private Const NUMLABELS As Integer = 5 Private lblelement(numlabels) As Label ' Array
More informationVBA Handout. References, tutorials, books. Code basics. Conditional statements. Dim myvar As <Type >
VBA Handout References, tutorials, books Excel and VBA tutorials Excel VBA Made Easy (Book) Excel 2013 Power Programming with VBA (online library reference) VBA for Modelers (Book on Amazon) Code basics
More informationNATIONAL DIPLOMA IN COMPUTER TECHNOLOGY
UNESCO-NIGERIA TECHNICAL & VOCATIONAL EDUCATION REVITALISATION PROJECT-PHASE II NATIONAL DIPLOMA IN COMPUTER TECHNOLOGY OOBASIC/VISUAL BASIC PROGRAMMING COURSE CODE: COM 211 YEAR I SEMESTER II PRACTICAL
More informationAngel International School - Manipay 1 st Term Examination November, 2015
Grade 10 Angel International School - Manipay 1 st Term Examination November, 2015 Information & Communication Technology Duration: 3.00 Hours Part 1 Choose the appropriate answer 1) Find the correct type
More informationChapter 4 The If Then Statement
The If Then Statement Conditional control structure, also called a decision structure Executes a set of statements when a condition is true The condition is a Boolean expression For example, the statement
More informationRandom numbers program
Fundamentals of Computer Science 2010-2011 Laboratory 11 Vectors (1) Objectives: Acquire abilities in the use of vectors (one-dimensional arrays) Get to know the generation of pseudo-random numbers Lower
More information