Visual Basic 6 Programming Decide how many variables you need by looking at this form. There is one textbox for input and there are 3 labels for output,

Slides:



Advertisements
Similar presentations
Variables, Constants &Computation T o i n s e r t y o u r c o m p a n y l o g o o n t h i s s l i d e F r o m t h e I n s e r t M n u e l e c t P i c.
Advertisements

Driving Test 1 Marking Scheme Focus on five areas to pass driving test 1.
VB Code Statements 3 types of VB statement The Remark statement, known as comments, are used for project documentation only Begin with an apostrophe Not.
To type the VB code behind the command button (named cmdPush), Double-Click on the Push Me (caption) command button As a result the Visual Basic Code Window.
Copyright © 2001 by Wiley. All rights reserved. Chapter 3: Variables, Assignment Statements, and Arithmetic Variables Assignment Statements Arithmetic.
VB DATATYPES, VARIABLES, CONSTANTS & CALCULATIONS.
Adding Controls to User Forms. Adding Controls A user form isn’t much use without some controls We’re going to add controls and write code for them Note.
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
Intrinsic Functions Pre-coded Functions Used to improve developer productivity Broad Range of Activities Math calculations Time/Date functions String.
CS0004: Introduction to Programming Variables – Strings.
Basic Controls & Properties Chapter 2. Overview u VB-IDE u Basic Controls  Command Button  Label  Text Box  Picture Box u Program Editor  Setting.
 Application – another name for a program.  Interface – is what appears on the screen when the application is running.  Program Code – is instructions.
3 - Variables Lingma Acheson Department of Computer and Information Science, IUPUI CSCI N331 VB.NET Programming.
Microsoft Visual Basic 2005 CHAPTER 4 Variables and Arithmetic Operations.
Chapter 4 Variables and constants. 4.1 Variables -Use of variables is good programming style -easier to modify -easier for a programmer to understand.
Programming Test #1 Solutions. Multiple Choice 1. B) the grammar of the coding language 2. C) String 3. A) Single 4. C) 2Burgers4Me 5. B) Design Time.
Fundamentals of GUI Programming. Objectives: At the end of the session, you should be able to: describe the guidelines that are used for creating user-friendly.
Visual Basic.net Textbox & Label Controls. Textbox Naming convention (txt) Primary use (user input) Can except numeric and character values.
University of Sunderland CIF 102/FIF102 Fundamentals of DatabasesUnit 15 Programming in Microsoft Access using VBA Using VBA to add functionality.
Class 3 Remote Instruction Computer Math EDU 556 Programming for Instruction Dr. Steve Broskoske This is an audio PowerCast. Make sure your volume is.
Data Types and Variables. Data Type! Computers are all about Data! Data can be in the form of Text Dates Sounds Pictures.
CSC 157 (Blum)1 Hello World. CSC 157 (Blum)2 Start/Programs/Microsoft Visual Studio.NET 2003/Microsoft Visual Studio.NET 2003.
Variables & Function Calls. Overview u Variables  Programmer Defined & Intrinsic  Data Types  Calculation issues u Using Functions  The val() function.
1 Advanced Computer Programming Lab Calculator Project.
Chapter 4 Variables and constants. 4.1 Variables -Use of variables is good programming style -easier to modify -easier for a programmer to understand.
VAT Calculator program Controls Properties Code Results.
Pay Example (PFirst98) Please use speaker notes for additional information!
Lesson 4 Mathematical Operators! October 6, 2009.
CECS 5020 Computers in Education Visual Basic Variables and Constants.
Slide 1 Controls v Control naming convention –Label: lblName –Command Button: cmdName –Text Box: txtName.
Calculator Program Explained by Arafa Hamed. First Designing The Interface Ask yourself how many places are there that will be used to input numbers?
مقدمة في البرمجة Lecture 7. Write VB.net project using the for loop to calculate : 1- the sum of numbers from 1 to (A) numbers. 2- the sum of Odd numbers.
Visual Basic Review LBS 126. VB programming Project Form 1Form 2Form 3 Text boxButton Picture box Objects Text box Button Objects.
Microsoft Visual Basic 2012 CHAPTER FOUR Variables and Arithmetic Operations.
Sorry, the pen lost control. Anyway, you need to download both the.vbp and the.frm for each project. I looked at PrCalc, I did not look at inventory.
More Visual Basic!. Creating a Standalone Program A standalone program will allow you to make a program file that can be run like other Windows programs,
Data and variables in Visual Basic. Annoucement Lecture on Thursday 7:30PM C106 Visual Basic download: 
Knowledge Base. Defining a Variable Dim statement Dim intXX As Integer Public in a Module Public dblNN As Double.
I am using Visual Basic 6 for this class. If you want to use a different version, please contact me. Thanks!
Microsoft Visual C# 2010 Fourth Edition Chapter 3 Using GUI Objects and the Visual Studio IDE.
Making Interactive Programs with Visual Basic .NET
Chapter 4.  Variables – named memory location that stores a value.  Variables allows the use of meaningful names which makes the code easier to read.
Slide 1 Chapter 3 Variables  A variable is a name for a value stored in memory.  Variables are used in programs so that values can be represented with.
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.
© 2006 Lawrenceville Press Slide 1 Chapter 4 Variables  A variable is a name for a value stored in memory.  Variables are created using a declaration.
Visual Basic Declaring Variables Dim x as Integer = 0 In the statement above, x is being declared as an Integer (whole number) and is initialised.
Slide 1 Chapter 3 Variables  A variable is a name for a value stored in memory.  Variables are created using a declaration statement. For example: Dim.
Lesson 4 Mathematical Operators! September 29, 2008 (Pages 62-65)
Microsoft Visual Basic 2010 CHAPTER FOUR Variables and Arithmetic Operations.
Visual Basic Fundamental Concepts
Egyptian Language School Computer Department
A variable is a name for a value stored in memory.
Variables and Arithmetic Operations
Variables, Expressions, and IO
Variables and Arithmetic Operations
Microsoft Visual Basic 2005 BASICS
Visual Basic..
Department Array in Visual Basic
Number and String Operations
Please use speaker notes for additional information!
Visual Basic Programming Chapter Four Notes Working with Variables, Constants, Data Types, and Expressions GROUPBOX CONTROL The _____________________________________.
Visual Basic: Week 5 Review User defined functions
Additional Topics in VB.NET
Introduction to Programming
To understand what arrays are and how to use them
Introduction to Visual Basic 2010
Visual Basic Numbers Chapter 3.3 Prepared By: Deborah 7/9/2019.
4d – Program Design Lingma Acheson CSCI N331 VB .NET Programming
Presentation transcript:

Visual Basic 6 Programming Decide how many variables you need by looking at this form. There is one textbox for input and there are 3 labels for output, so you need 4 variables in all Textbox names should start with txt Labels names should start with lbl Command button names should start with cmd

Visual Basic 6 Programming Numeric variables should start with sgl (for single)‏ Text variables should start with str (for string)‏ TxtPrice will have a corresponding variable sglPrice LblGST will have a corresponding variable sglGST LblPST will have a corresponding variable sglPST LblTotal will have a corresponding variable sglTotal Variable & Object Naming Conventions

Visual Basic 6 Programming Variables section Dim sglPrice as single 'this is to store the price Dim sglGST as single Dim sglPST as single Dim sglTotal as single Use an apostrophe to make comments: 'This is a comment it will appear green Variables are locations in the computer memory Objects on the form (textboxes etc) are what the user interacts with.

Visual Basic 6 Programming INPUT section This is where the input the user types into a textbox is passed onto the variable In order to convert text from the textbox into a number, you use the val() function: SglPrice = val(txtPrice.text)‏ strName = txtName.text strName = “Joe” ‘Notice the double quotes around Joe DO NOT use val if you are assigning a value to a text variable (string variable)! Notice the variable getting assigned a value is always on the left side of the = sign

Visual Basic 6 Programming Calculation section should only use variables (just like in math!)‏ There are 3 calculations in this case sglGST = sglPrice * 0.05 sglPST = sglPrice * 0.05 sglTotal = sglPrice + sglGST + sglPST Again, notice that the variable being assigned a value MUST be on the left side of the = sign. DON’T use OBJECTS in this section (txt or lbl)

Visual Basic 6 Programming OUPUT Section You will now have to output the 3 output variables to the 3 corresponding labels lblGST.caption = sglGST lblPST.caption = sglPST lblTotal.caption = sglTotal

TxtPrice LblTotal LblPST LblGST This program responds to the change event. When the user types in something into the textbox, the program executes.

Visual Basic 6 Programming Reminders Textboxes have a text property Labels, Command buttons, and Forms have a caption property