Mark Dixon, SoCCE SOFT 131Page 1 03 – Debugging & Graphics.

Slides:



Advertisements
Similar presentations
RAPTOR Syntax and Semantics By Lt Col Schorsch
Advertisements

Mark Dixon, SoCCE SOFT 131Page 1 22 – Visual BASIC 2005.
Mark Dixon, SoCCE SOFT 136Page 1 05 – Conditional Execution.
Mark Dixon, SoCCE SOFT 136Page 1 02 – Software Development Life-Cycle.
Mark Dixon Page 1 05 – Conditional Execution. Mark Dixon Page 2 Admin: Test (next week) In class test –teaching week 6 50 minutes short answer (5 - 6.
Mark Dixon, SoCCE SOFT 131Page 1 07 – Iterative Execution.
Mark Dixon, SoCCE SOFT 131Page 1 04 – Information Processing: Expressions, Operators & Functions.
Mark Dixon, SoCCE SOFT 131Page 1 06 – Iteration. Mark Dixon, SoCCE SOFT 131Page 2 Session Aims & Objectives Aims –Revise Variables and Conditional execution.
Mark Dixon, SoCCE SOFT 131Page 1 SOFT – Module Introduction & Overview.
Mark Dixon, SoCCE SOFT 131Page 1 20 – Web applications: HTML and Client-side code.
Mark Dixon, SoCCE SOFT 131Page 1 03 – User Interface Design, and Sound and Graphics.
Mark Dixon Page 1 02 – Dynamic HTML (client-side scripting)
Mark Dixon, SoCCE SOFT 131Page 1 06 – Iteration. Mark Dixon, SoCCE SOFT 131Page 2 Session Aims & Objectives Aims –To introduce the main concepts involved.
Mark Dixon, SoCCE SOFT 131Page 1 04 – Information Processing: Data-types, Variables, Operators & Functions.
Mark Dixon, SoCCE SOFT 131Page 1 02 – Software Development Lifecycle, & User Interface Design.
Mark Dixon, SoCCE SOFT 131Page 1 10 – Variable Scope, and Arrays of Structures.
Mark Dixon, SoCCE SOFT 131Page 1 08 – Iterative Execution.
Mark Dixon, SoCCE SOFT 131Page 1 05 – Conditional Execution.
Mark Dixon, SoCCE SOFT 131Page 1 04 – Conditional Execution.
Mark Dixon, SoCCE SOFT 131Page 1 12 – Enumerated Data-Types & Pass-by-reference.
Mark Dixon, SoCCE SOFT 131Page 1 13 – Control Arrays & Container Controls.
Mark Dixon, SoCCE SOFT 131Page 1 11 – Arrays of Structures & Modules.
Mark Dixon, SoCCE SOFT 131Page 1 03 – Debugging, Sound, and Graphics.
Mark Dixon, SoCCE SOFT 131Page 1 SOFT – Module Introduction & Overview.
Mark Dixon, SoCCE SOFT 131Page 1 02 – Software Development Lifecycle, & User Interface Design.
Mark Dixon, SoCCE SOFT 131Page 1 05 – Information Processing: Data-types, Variables, Operators & Functions.
1 Integrated Development Environment Building Your First Project (A Step-By-Step Approach)
Chapter 3 Working with Symbols and Interactivity.
Mark Dixon Page 1 10 – Iterative Execution. Mark Dixon Page 2 Questions: Variables Write a line of code to declare a variable called h Write a line of.
COMP Bitmapped and Vector Graphics Pages Using Qwizdom.
Multimedia ! Graphics ! Animation ! Sound Tip Of the Day 4 Tip of the Day: When using graphic methods at Form Load, the AutoRedraw property of the container.
Objective Understand concepts used to create digital graphics. Course Weight : 15% Part Three : Concepts of Digital Graphics.
Mark Dixon Page 1 09 – Arrays. Mark Dixon Page 2 Questions: Loops What is the value of t, after this code executes? t = 0 For x = 4 To 6 t = t + x Next.
M Dixon 1 04 – Data Types & Debugging. Questions: Expressions a)What is the result of: 7 + Int(8.245) b)Write an expression to: put a random number into.
Mark Dixon, SoCCE SOFT 136Page 1 9 – Procedures. Mark Dixon, SoCCE SOFT 136Page 2 Session Aims & Objectives Aims –To introduce the main concepts involved.
Mark Dixon 1 05 – Conditional Execution. Mark Dixon 2 Admin: Test (next week) In class test –teaching week 6 50 minutes short answer (5 - 6 words) currently.
Mark Dixon, SoCCE SOFT 131Page 1 02 – Dynamic HTML (client-side scripting)
MAT Meyer Week 2 Programming VB: ‘basics’ Review & preview: Events, variables, statements, etc. Images, Control arrays, For/Next Assignment: read.
Mark Dixon 1 11 – Array Variables. Mark Dixon 2 Questions: Loops What is the value of t, after this code executes? t = 0 For x = 4 To 6 t = t + x Next.
Image Representation. Objectives  Bitmaps: resolution, colour depth and simple bitmap file calculations.  Vector graphics: drawing list – objects and.
Mark Dixon, SoCCE SOFT 136Page 1 SOFT – Module Introduction & Overview.
Mark Dixon, SoCCE SOFT 131Page 1 05 – Variables. Mark Dixon, SoCCE SOFT 131Page 2 Admin: Test (next week) In class test –teaching week 6 –university week.
Chapter Two Creating a First Project in Visual Basic.
Mark Dixon Page 1 03 – Dynamic HTML (client-side scripting)
M Dixon 1 03 – Dynamic HTML (client-side scripting)
Visual Basic Programming
Mark Dixon Page 1 04 – Information Processing: Expressions, Operators & Functions.
Chapter 2 P. 1 Introducing more controls (on the Toolbox) (Fig. 2.1) - Text box - Frame - Option button - Check box - Image Example P. 44 Figure 2.2 Message.
Mark Dixon, SoCCE SOFT 131Page 1 04 – Conditional Execution.
Graphics An image is made up of tiny dots called pixels (“picture elements”) The resolution determines the.
Standard Grade Programming using VB 1 Programming Visual Basic.
Mark Dixon, SoCCE SOFT 131Page 1 04 – Information Processing: Expressions, Operators & Functions.
Mark Dixon, SoCCE SOFT 131Page 1 02 – Dynamic HTML (client-side scripting)
Practical Programming COMP153-08S Week 5 Lecture 1: Screen Design Subroutines and Functions.
Visual Basic Programming Introduction VB is one of the High level language VB has evolved from the BASIC language. BASIC stands for Beginners All-purpose.
Mark Dixon, SoCCE SOFT 131Page 1 16 – Visual BASIC 6.0.
Mark Dixon Page 1 04 – Information Processing: Expressions, Operators & Functions.
Mark Dixon Page 1 04 – Information Processing: Expressions, Operators & Functions.
Mark Dixon 1 9 – Case Study. Mark Dixon 2 Session Aims and Objectives Aims –To give an overview of the development of a web-page from initial idea to.
Mark Dixon, SoCCE SOFT 131Page 1 18 – Enumerated Data Types and Arrays of Structures.
M Dixon 1 02 – Dynamic HTML (client-side scripting)
Mark Dixon Page 1 04 – Conditional Execution. Mark Dixon Page 2 Questions: Expressions a)What is the result of: 10 * Int( ) b)How many functions.
Mark Dixon, SoCCE SOFT 131Page 1 17 – Procedures.
Mark Dixon Page 1 03 – Information Processing: Expressions, Operators & Functions.
Debugging tools in Flash CIS 126. Debugging Flash provides several tools for testing ActionScript in your SWF files. –The Debugger, lets you find errors.
TOOLBOX. The Toolbox Intrinsic Controls - always included in the Toolbox ActiveX Controls - separate files with ocx file extension Insertable Objects.
AVCE ICT – Unit 7 - Programming Session 12 - Debugging.
Mark Dixon Page 1 09 – Iterative Execution. Mark Dixon Page 2 Questions: Variables Write a line of VBScript code to declare a variable called h Write.
Mark Dixon Page 1 03 – Information Processing: Expressions, Operators & Functions.
Mark Dixon, SoCCE SOFT 131Page 1 03 – Conditional Execution.
Presentation transcript:

Mark Dixon, SoCCE SOFT 131Page 1 03 – Debugging & Graphics

Mark Dixon, SoCCE SOFT 131Page 2 Session Aims & Objectives Aims –tidy up from last session –introduce you to testing and debugging process –introduce you to graphics Objectives, by end of this week’s sessions, you should be able to: –Test program –Identify and correct simple logical and syntax errors –put bitmap (raster) graphics into you applications –draw simple vector graphics

Mark Dixon, SoCCE SOFT 131Page 3 Example 2-6: Address Book

Mark Dixon, SoCCE SOFT 131Page 4 Testing & Debugging: Errors 3 error types : –syntax: computer unable to understand your instructions (program does not execute), e.g. variable not defined (probably most common) –run-time: program can't execute instruction and exits (future lecture) device not available –logical: program executes but does not not match specification (do what was intended), e.g. clicking on button does nothing, when you thought you attached code to it clicking on blue button changes colour to red (when it should change to blue) Music Player

Mark Dixon, SoCCE SOFT 131Page 5 Computer –just symbol matching –No intelligence Example 1: Hello Errors Sub Command1_Cluck LabelL.Caption = "Hello" End Sub L instead of 1: causes syntax error (variable not defined) u instead of i: causes logical error (Command1 button does nothing)

Mark Dixon, SoCCE SOFT 131Page 6 Exercise 1: Errors The following is from exercise 1 (v1), –Spot the errors (you should find 6), and –decide whether they are syntax or logical Private Sub btnBlue_Cluck() lblResult.BackColor = vbRed End Sub Private Sub btnRed_lick() lblResult.BackColor vbRed End Sub Private Sub lb1Result_DblClick() lblResult.BackColour = vbWhite End Sub

Mark Dixon, SoCCE SOFT 131Page 7 Verification & Validation Verification: –'Are we building the product right?' –Does software match software requirements specification? Validation: –'Are we building the right product?' –Does the software requirements specification meet the user requirements?

Mark Dixon, SoCCE SOFT 131Page 8 Debugging: Testing Functional Decomposition –break it into logical chunks Incremental Development –type a bit –test it Testing –test all/most combinations Regression Testing –repeat all previous tests

Mark Dixon, SoCCE SOFT 131Page 9 Types of Graphics: Raster Raster graphics – made of dots (pixels – picture elements) –suitable for complex, static pictures (e.g. photos) –difficult to change programmatically –loses quality when enlarged

Mark Dixon, SoCCE SOFT 131Page 10 Types of Graphics: Vector Vector graphics – made of objects (lines, circles, etc.) –suitable for simple, dynamic pictures (diagrams) –No loss of quality when enlarged

Mark Dixon, SoCCE SOFT 131Page 11 Picture Control Methods (vector graphics) –Line: draws a straight line between 2 points –Circle: draws a circle –PSet: draws a dot (point) –Cls: clears (screen) drawing area Properties –Picture: allows display of bitmap (raster graphic) as background

Mark Dixon, SoCCE SOFT 131Page 12 Graphics: Grid System the origin (position 0,0) is at top left –in mathematics it is always bottom left

Mark Dixon, SoCCE SOFT 131Page 13 Example 2: Shapes Form and Picture Box control support graphics methods: picDisplayArea.Line (500, 200)-(1900, 800) picDisplayArea.Line -(2600, 600) picDisplayArea.Line -Step(-600, -400) picDisplayArea.PSet (1500, 1000) picDisplayArea.Circle (700, 900), 300 Shapes

Mark Dixon, SoCCE SOFT 131Page 14 Example 3: StickMan Enabled property (true or false) StickMan

Mark Dixon, SoCCE SOFT 131Page 15 Example 4: Face Face

Mark Dixon, SoCCE SOFT 131Page 16 Example 5: Picture Viewer –LoadPicture function: picDisplay.Picture = LoadPicture("C:\Cat.jpg") –Pattern property (of file list)

Mark Dixon, SoCCE SOFT 131Page 17 Example 6: Music Player v3 V3 Option Explicit Private Sub drvMain_Change() dirMain.Path = drvMain.Drive End Sub Private Sub dirMain_Change() filMain.Path = dirMain.Path End Sub Private Sub filMain_Click() mmcMain.Command = "Close" mmcMain.FileName = filMain.Path & "\" & filMain.FileName mmcMain.Command = "Open" pgbMain.Max = mmcMain.Length pgbMain.Value = 0 End Sub Private Sub mmcMain_StatusUpdate() pgbMain.Value = mmcMain.Position End Sub Private Sub mmcMain_Done(NotifyCode As Integer) filMain.ListIndex = filMain.ListIndex + 1 mmcMain.Command = "Play" End Sub