ch10 - Microsoft Visual Basic 2008: Reloaded Third Edition...

Info iconThis preview shows pages 1–14. Sign up to view the full content.

View Full Document Right Arrow Icon
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter Ten Structures and Sequential Access Files
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Microsoft Visual Basic 2008: Reloaded, Third Edition 2 Objectives After studying this chapter, you should be able to: Create a structure Declare and use a structure variable Create an array of structure variables Write information to a sequential access file Align the text written to a sequential access file
Background image of page 2
Microsoft Visual Basic 2008: Reloaded, Third Edition 3 Objectives (continued) Read information from a sequential access file Determine whether a file exists Delete a file while an application is running Code the FormClosing event Prevent a form from closing
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Microsoft Visual Basic 2008: Reloaded, Third Edition 4 Structures Structure statement : used to create your own data type User-defined data type (or structure ): data types created by using the Structure statement Member variables : variables defined within a structure Structure can include member variables of: Any standard data types Other structure types Usually declared in the form’s Declarations section
Background image of page 4
Microsoft Visual Basic 2008: Reloaded, Third Edition 5 Structures (continued) Figure 10-1: How to create a structure (user-defined data type)
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Microsoft Visual Basic 2008: Reloaded, Third Edition 6 Declaring a Structure Variable Structure variables: variables declared using a structure Figure 10-2: How to declare a structure variable
Background image of page 6
Microsoft Visual Basic 2008: Reloaded, Third Edition 7 Declaring a Structure Variable (continued) Refer to an entire structure in code using its name Refer to a member variable using the structure name with the dot operator and the member variable name Member variables can be used like any other variables Structures are used to group related items into one unit
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Microsoft Visual Basic 2008: Reloaded, Third Edition 8 Declaring a Structure Variable (continued) Figure 10-3: How to use a member variable
Background image of page 8
Microsoft Visual Basic 2008: Reloaded, Third Edition 9 Passing a Structure Variable to a Procedure Sample application without using a structure: Figure 10-4: Sample run of the Willow Pools application
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Microsoft Visual Basic 2008: Reloaded, Third Edition 10 Figure 10-5: Code for the Willow Pools application (without a structure)
Background image of page 10
Microsoft Visual Basic 2008: Reloaded, Third Edition 11 Figure 10-6: Code for the Willow Pools application (with a structure)
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Microsoft Visual Basic 2008: Reloaded, Third Edition 12 Figure 10-6: Code for the Willow Pools application (with a structure – continued)
Background image of page 12
Microsoft Visual Basic 2008: Reloaded, Third Edition 13 Passing a Structure Variable to a Procedure (continued) Sample application using a structure: Less code to pass a structure variable to a procedure Stores all of the data in a single unit
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 14
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 46

ch10 - Microsoft Visual Basic 2008: Reloaded Third Edition...

This preview shows document pages 1 - 14. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online