Chapter 3 - Visual Basic Schneider. Private Sub cmdEvaluate_Click() Dim n As Single, root As Single n = 6.76 root = Sqr(n) picResults.Print root; Int(n);

Slides:



Advertisements
Similar presentations
Computer Science & Engineering 2111 Text Functions 1CSE 2111 Lecture-Text Functions.
Advertisements

Chapter 3. Expressions and Interactivity CSC125 Introduction to C++
Input Dialog Box An input dialog box can be used to obtain a single item of input from the user Presents a window (dialog box) requesting input Syntax:
Fundamentals of Programming in Visual Basic
VB Built-in Functions School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 5, Monday 2/10/03)
Built-In Functions.
Introduction to Oracle9i: SQL1 Selected Single-Row Functions.
Introduction to Computing Dr. Nadeem A Khan. Lecture 14.
Introduction to Computing Dr. Nadeem A Khan. Lecture 6.
Chapter seven review. What is the output of: Private Sub cmdButton_Click() Dim i As Integer, a(1 To 4) As integer Open "DATA.TXT" For Input As #1 For.
Chapter 6: Using VB.NET Supplied Classes Visual Basic.NET Programming: From Problem Analysis to Program Design.
Chapter 4 - Visual Basic Schneider1 Chapter 4 General Procedures.
Fundamentals of Programming in Visual Basic
On to… string operations & functions. Concatenation (&) §When we want to combine two character strings into one new (longer) string, we can concatenate.
Function.
Section 3.6 BUILT-IN FUNCTIONS involving numbers & strings.
Chapter 31 Fundamentals of Programming in Visual Basic (Continue VI) String Properties and Methods: "Visual".Length is 6. "Visual".ToUpper is VISUAL. "123.
Programming Practice in Visual Basic The Initial Visual Basic Screen Toolbox Project Explorer window Properties window Form Menu bar Description pane.
Fundamentals of Programming in Visual Basic
1.
Database Management Review for Final (Part 1) School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 15, Wednesday 4/30/2003)
Strings PART II STRING$ AND SPACE$. Create strings of specified number String$ creates string of specified character Space$ creates string of spaces Example:
CS0004: Introduction to Programming Input and Output.
Tutorial 11 Using and Writing Visual Basic for Applications Code
COMPUTER PROGRAMMING I Objective 7.04 Apply Built-in String Functions (3%)
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 9 More About Strings.
1 Chapter 3 – Variables, Input, and Output 3.1 Numbers 3.2 Strings 3.3 Input and Output.
CSC 162 Visual Basic I Programming. Randomizing and Formatting Randomizing Formatting –User-Defined Formats –Named Numeric Formats.
Chapter 10 Selected Single-Row Functions Oracle 10g: SQL.
Do Loop with Interest Please see speaker notes for additional information!
Definition Various stream manipulators can be used to specify the kinds of formatting to be performed during stream-I/O operations. Stream manipulators.
Oracle 11g: SQL Chapter 10 Selected Single-Row Functions.
String Manipulation. Java String class  The String class represents character strings “Tammy Bailey”  All strings (arrays of characters) in Java programs.
An Introduction to Java Programming and Object-Oriented Application Development Chapter 7 Characters, Strings, and Formatting.
Input and Output. Announcements  Exam Next Wednesday –Next Monday: Review session.  Invited talk: –7:30 PM,Tuesday, Oct 28th. –Prof. Katherine Socha.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Screen Scraping Application Introducing String Processing.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 24 The String Section.
Numbers continued The Integer Data Type Multiple Declarations Parentheses Three Types of Errors.
Working with Forms and Regular Expressions Validating a Web Form with JavaScript.
Chapter 8 - Visual Basic Schneider
Variable, Constants and Calculations Dr Mohammad Nabil Almunawar.
Introduction to Programming Fundamentals of Programming in Visual Basic.
Hungarian Notation A must in this course Every object used MUST be renamed including the form(s) using the following rules Form  frmFormName E.g. frmTemperature.
Chapter 3 - Visual Basic Schneider Numeric Variables Used to store numbers Value is assigned by a statement of the form: numVar = expression The variable.
Introduction to Computing Dr. Nadeem A Khan. Lecture 9.
HNDIT Rapid Application Development
Introducing Java Chapter 3 Review. Why Program in Java? Java, is an object-oriented programming language. OOP languages evolved out of the need to better.
Chapter 4 - Visual Basic Schneider1 Chapter 4 General Procedures.
Chapter 23 The String Section (String Manipulation) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Chapter 6: Using VB.NET Supplied Classes Visual Basic.NET Programming: From Problem Analysis to Program Design.
Formatting in VB Please see speaker notes for additional information!
1 VB-06-String Manipulation Mar 03, 2002 String Function VISUAL BASIC.
Fundamentals of Programming in Visual Basic
Chapter 4 - Visual Basic Schneider
Chapter 7: Strings and Characters
Fundamentals of Programming in Visual Basic
CIS16 Application Development and Programming using Visual Basic.net
CEV208 Computer Programming
Sub Procedures and Functions
Visual Basic Numbers Chapter 3.3 Prepared By: Deborah 1/15/2019.
Prepared By: Deborah Becker
VBScript Session 10.
Microsoft Visual Basic 2005: Reloaded Second Edition
Topics Basic String Operations String Slicing
Topics Basic String Operations String Slicing
Visual Basic Numbers Chapter 3.3 Prepared By: Deborah 7/9/2019.
Topics Basic String Operations String Slicing
What We Want To Do User enters: Mary Smith
Presentation transcript:

Chapter 3 - Visual Basic Schneider

Private Sub cmdEvaluate_Click() Dim n As Single, root As Single n = 6.76 root = Sqr(n) picResults.Print root; Int(n); Round(n,1) End Sub Output: Chapter 3 - Visual Basic Schneider

Function: Left(“Penguin”, 4) Purpose: Returns the number of characters specified, starting at the beginning of the string Chapter 3 - Visual Basic Schneider

Function: Right(“Gotham City”, 4) Purpose: Returns the number of characters specified from the end of the string Chapter 3 - Visual Basic Schneider

Function: Mid(“Commissioner”, 4, 3) Purpose: Returns the substring starting at the position indicated by the first number and continuing for the length specified by the second number Chapter 3 - Visual Basic Schneider

Function: UCase(“Yes”) Purpose: Converts any lowercase letters in a string to uppercase Chapter 3 - Visual Basic Schneider

Function: InStr(“John Smith”, “m”) Purpose: Searches for the first occurrence of one string in another and gives the position at which the string is found Chapter 3 - Visual Basic Schneider

Function: Len(“John Smith”) Purpose: Returns the number of characters in the string. Chapter 3 - Visual Basic Schneider

picBoard.print len(left(“welcome”,3)) picBoard.print UCase(left(“welcome”,3)) Chapter 3 - Visual Basic Schneider

 The format functions provide detailed control of how numbers, dates, and strings are displayed.  Examples ◦ FormatNumber ( , 1) 12,345.7 ◦ FormatCurrency ( , 2) $12, ◦ FormatPercent (.185, 2) 18.50% ◦ FormatNumber (1 + Sqr(2), 3) Chapter 3 - Visual Basic Schneider

 Format (expr, Purpose: The value of this function is the value of expr right justified in a field of n spaces, where n is the number symbols. Chapter 3 - Visual Basic Schneider

Format(12345, Format(123, 123 Format(“123.4”, Chapter 3 - Visual Basic Schneider

FormatDateTime (“ ”, vbLongDate) Output: Monday, September 15, 2004 Chapter 3 - Visual Basic Schneider

 Returns a random number from 0 to 1. (excluding 1). Example: picBox.Print Rnd Output: Displays a random number from 0 to 1 (0 included and 1 excluded). Example: picBox.Print Rnd +5 Output: Displays a random number from 5 to 6 (5 included and 6 excluded). Chapter 3 - Visual Basic Schneider

Example: picBox.Print Int(Rnd) Output: Displays 0. Example: picBox.Print Int(Rnd +5) Output: Displays 5. Example: picBox.Print Int(Rnd) +5 Output: Displays 5. Chapter 3 - Visual Basic Schneider

Example: picBox.Print Int(5*Rnd) Output: Displays a random Integer from 0 to 4 (0 and 4 included). OR Output: Displays a random Integer from 0 to 5 (0 included and 5 excluded) Example: picBox.Print Int(5*Rnd) +2 Output: Displays a random Integer from 2 to 6 (2 and 6 included). Chapter 3 - Visual Basic Schneider