Microsoft Visual Basic 2005 BASICS

Slides:



Advertisements
Similar presentations
Chapter 3: Using Variables and Constants Programming with Microsoft Visual Basic 2005, Third Edition.
Advertisements

Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
An Introduction to Programming with C++ Fifth Edition Chapter 12 String Manipulation.
Comparing Numeric Values If Val(Text1.Text) = MaxPrice Then (Is the current numeric value stored in the Text property of Text1 equal to the value stored.
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.
Chapter Three Using Variables and Constants Programming with Microsoft Visual Basic th Edition.
Chapter 9 Introduction to ActionScript 3.0. Chapter 9 Lessons 1.Understand ActionScript Work with instances of movie clip symbols 3.Use code snippets.
Ping Zhang 10/08/2010.  You can get data from the user (input) and display information to the user (output).  However, you must include the library.
Chapter 8: String Manipulation
Chapter 9 Creating Formulas that Manipulate Text Microsoft Office Excel 2003.
Chapter 4 – The Building Blocks Data Types Literals Variables Constants.
Chapter 3: Using Variables and Constants
Programming with Microsoft Visual Basic th Edition CHAPTER THREE USING VARIABLES AND CONSTANTS.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Interest Calculator Application Introducing the For...Next Repetition Statements.
Chapter 5 Menus, Common Dialog Boxes, and Methods Programming in C#.NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
1 Chapter 3 – Variables, Input, and Output 3.1 Numbers 3.2 Strings 3.3 Input and Output.
Microsoft Visual Basic 2005 BASICS Lesson 4 Mathematical Operators.
Lab 01 Forms in excel Tahani ALdweesh Insert form into your project. 2. Change form’s properties. 3. Put controls on the form. 4. Change controls’
Visual Basic.NET BASICS Lesson 4 Mathematical Operators.
Chapter 2: Using Data.
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Microsoft Visual Basic 2005 CHAPTER 4 Variables and Arithmetic Operations.
Working with the VB IDE. Running a Program u Clicking the”start” tool begins the program u The “break” tool pauses a program in mid-execution u The “end”
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 3 Variables, Constants, Methods, and Calculations.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 24 The String Section.
Using Decimal Types. What are the data types that you can use? Decimal Number: Single -Is used for decimal values that will not exceed six or seven digits.
Recognizing PL/SQL Lexical Units. 2 home back first prev next last What Will I Learn? List and define the different types of lexical units available in.
Chapter 12: String Manipulation Introduction to Programming with C++ Fourth Edition.
Variables in Java x = 3;. What is a variable?  A variable is a placeholder in memory used by programmers to store information for a certain amount of.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter Three Using Variables and Constants.
1 Chapter 3 – Examples The examples from chapter 3, combining the data types, variables, expressions, assignments, functions and methods with Windows controls.
Strings See Chapter 2 u Review constants u Strings, concatenation and repetition 1.
Variables, Input, and Output. Challenge: ● Ask the user his or her name, and repeat that name to the user ● Pause video and try.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Tutorial 3: Using Variables and Constants1 Tutorial 3 Using Variables and Constants.
Chapter 4 Getting Started with VBA. Subroutines Subroutine is the logical section of code that performs a particular task. Subroutine is also called a.
1.2 Primitive Data Types and Variables
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Student Grades Application Introducing Two-Dimensional Arrays and RadioButton.
Variables and Expressions Programming Right from the Start with Visual Basic.NET 1/e 7.
Microsoft Visual Basic 2012 CHAPTER FOUR Variables and Arithmetic Operations.
Chapter 23 The String Section (String Manipulation) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Creation of Variables with Numeric, alphanumeric, date, picture, memo data types Constant - A quantity that does not change during the execution of a program.
Chapter 4: Variables, Constants, and Arithmetic Operators Introduction to Programming with C++ Fourth Edition.
Addison Wesley is an imprint of © 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Chapter 3 Variables and Calculations.
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.
Programming with Microsoft Visual Basic 2012 Chapter 3: Using Variables and Constants.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
Chapter 4 Strings and Screen I/O. Objectives Define strings and literals. Explain classes and objects. Use the string class to store strings. Perform.
Microsoft Visual Basic 2010 CHAPTER FOUR Variables and Arithmetic Operations.
Session 2 Basics of PHP.
String Methods Programming Guides.
Arithmetic operations and operators, converting data types and formatting programs for output. Year 11 Information Technology.
Chapter 6 JavaScript: Introduction to Scripting
Lexical Reference Variables in Graphics and List Box in Forms
Visual Basic 6 (VB6) Data Types, And Operators
Project 9 Creating Pop-up Windows, Adding Scrolling Messages, and Validating Forms.
Variables and Arithmetic Operations
Chapter 3: Using Variables and Constants
Introduction to Scripting
Section 3.2c Strings and Method Signatures
Microsoft Visual Basic 2005 BASICS
Microsoft Visual Basic 2005 BASICS
Variables and Arithmetic Operations
Microsoft Visual Basic 2005 BASICS
INPUT & OUTPUT scanf & printf.
WEB PROGRAMMING JavaScript.
T. Jumana Abu Shmais – AOU - Riyadh
Visual Basic Numbers Chapter 3.3 Prepared By: Deborah 1/15/2019.
Microsoft Visual Basic 2005 BASICS
Visual Basic Numbers Chapter 3.3 Prepared By: Deborah 7/9/2019.
Presentation transcript:

Microsoft Visual Basic 2005 BASICS yo Microsoft Visual Basic 2005 BASICS Lesson 7 Strings and Decimal Types

Objectives Declare string variables. Assign text to string variables. yo Objectives Declare string variables. Assign text to string variables. Concatenate strings. Use decimal data types. Use the Format function. Microsoft Visual Basic 2005 BASICS

Objectives (cont.) Use the Enabled property. yo Objectives (cont.) Use the Enabled property. Use the SelectionStart and SelectionLength properties. Microsoft Visual Basic 2005 BASICS

Declaring String Variables yo Declaring String Variables Text is often called alphanumeric data. Can include letters or numbers Data types that hold text are usually referred to as strings. When you declare a string, the resulting variable can hold a string of any practical length. Microsoft Visual Basic 2005 BASICS

Assigning Text to String Variables yo Assigning Text to String Variables Place the text in quotation marks. Hard-coded text is called a string literal. Like a numeric variable, a string variable can only hold one string. Each time you assign a string to a string variable, the existing data is replaced. Microsoft Visual Basic 2005 BASICS

Assigning Text to String Variables (cont.) Microsoft Visual Basic 2005 BASICS

Assigning Text to String Variables (cont.) Microsoft Visual Basic 2005 BASICS

Concatenation Concatenation Ampersand (&) yo Concatenation Concatenation Appends one string to the end of another Ampersand (&) You can concatenate more than two strings in one expression. You can also use concatenation when creating the text for a label. Microsoft Visual Basic 2005 BASICS

Concatenation (cont.) Microsoft Visual Basic 2005 BASICS

Concatenation (cont.) Microsoft Visual Basic 2005 BASICS

Concatenation (cont.) Microsoft Visual Basic 2005 BASICS

Concatenation (cont.) Microsoft Visual Basic 2005 BASICS

Using Decimal Types Single data type Double data type yo Using Decimal Types Single data type Used for decimal values that will not exceed 38 digits Double data type Used for decimal values with more than 38 digits Decimal data type Used to work with dollars and cents Microsoft Visual Basic 2005 BASICS

Using the Format Function yo Using the Format Function The Format function Allows you to apply custom formatting to a number before displaying the value The Format function can be used to format decimal values, phone numbers, and more. Microsoft Visual Basic 2005 BASICS

Using the Format Function (cont.) Microsoft Visual Basic 2005 BASICS

Using the Format Function (cont.) Microsoft Visual Basic 2005 BASICS

Using the Format Function (cont.) Microsoft Visual Basic 2005 BASICS

Using the Enabled Property yo Using the Enabled Property Enabled property Makes a control take on a grayed appearance that makes it inactive but still visible Objects that are inactive can be seen by the user, but will not respond to user actions. Microsoft Visual Basic 2005 BASICS

Using the Enabled Property (cont.) To disable an object, set the Enabled property to False. Microsoft Visual Basic 2005 BASICS

Using the SelectionStart and SelectionLength Properties yo Using the SelectionStart and SelectionLength Properties SelectionStart property Specifies the location where the insertion point will be inserted when the text box gets the focus SelectionLength property Specifies how many characters should be selected to the right of the cursor Microsoft Visual Basic 2005 BASICS

Using the SelectionStart and SelectionLength Properties (cont.) Microsoft Visual Basic 2005 BASICS

Summary Strings hold text or alphanumeric data. yo Summary Strings hold text or alphanumeric data. Visual Basic has a data type for strings. Text assigned to a string variable must be placed in quotation marks. You can use the assignment operator to assign text from a text box to a string variable or from a string variable to another string variable. Microsoft Visual Basic 2005 BASICS

yo Summary (cont.) Concatenation is the process of appending one string to the end of another. The ampersand (&) is the symbol used for concatenation. The Single, Double, and Decimal data types hold decimal data. The Decimal data type is specially designed for handling dollars and cents. Microsoft Visual Basic 2005 BASICS

yo Summary (cont.) The Format function uses a string of symbols to format decimal values, phone numbers, and more. The Enabled property is used to make a control inactive or active. The SelectionStart and SelectionLength properties and the Len function can be used together to highlight the text in a text box. Microsoft Visual Basic 2005 BASICS