Visual Basic.net Functions. Function (Defined) A procedure that returns a value when called.

Slides:



Advertisements
Similar presentations
Visual Basic Statements Chapter 5. Relational Operators  OperationSymbol  Equal  =  Less than  <  Greater than  >  Not equal   Less than.
Advertisements

Computer Science & Engineering 2111 Text Functions 1CSE 2111 Lecture-Text Functions.
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. ACCESS 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 12 – Building.
There is a String type in VB Data TypePrefix Stringstr Dim strFirstName As String strFirstName = “Homer” strFirstName = “” String A String variable can.
String Variables Visual Basic for Applications 4.
Input Validation Check the values entered into a text box before beginning any calculations Validation is a form of ‘self-protection’, rejecting bad data.
Input and Message Boxes. InputBox() Function An input box is a dialog box that opens and waits for the user to enter information. Syntax: InputBox(prompt[,title][,default])
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.
CSC110 Fall Chapter 5: Decision Visual Basic.NET.
Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 1 Lab3 Check Boxes,Option Buttons Frame Control Frame Control MsgBox, InputBox Functions Day7.
McGraw-Hill/Irwin Programming in Visual Basic 6.0 © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Update Edition Chapter 4 Decisions and Conditions.
Input Validation Check the values entered into a text box before beginning any calculations Validation is a form of ‘self-protection’, rejecting bad data.
Repeating Program Instructions Chapter Microsoft Visual Basic.NET: Reloaded 1.
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.
On to… string operations & functions. Concatenation (&) §When we want to combine two character strings into one new (longer) string, we can concatenate.
Chapter 5 new The Do…Loop Statement
Saving and Loading Simple Text Files A sequential file stores characters one after the other like songs on a cassette tape. New characters are added to.
© 1999, by Que Education and Training, Chapter 5, pages of Introduction to Computer Programming with Visual Basic 6: A Problem-Solving Approach.
CS0004: Introduction to Programming Input and Output.
A453 Exemplar Password Program using VBA
Intrinsic Functions Pre-coded Functions Used to improve developer productivity Broad Range of Activities Math calculations Time/Date functions String.
Break Processing Please use speaker notes for additional information!
Chapter 4 P 1 Decisions and Conditions Control statements - seqeuncing - selection - repetition (picture later) - abstraction (procedure calls)
Manipulation Masterclass By the VB Gods. In this masterclass, we will learn how to use some of the string manipulation function such as Len, Right, Left,
VBA Lab 2 I ns.Samia Al-blwi. Visual Basic Grammar Object: Visual Basic is an object-oriented language. This means that all the items in Excel are thought.
© 2016 Cengage Learning®. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part. Android Boot Camp.
Microsoft Visual Basic 2008: Reloaded Third Edition Chapter Five More on the Selection Structure.
University of Toronto at Scarborough © Andria Hunter, Kersti Wain-Bantin CSCA01 VBA-2 1 Lecture Outline Mathematical Expressions String Concatenation Built-in.
Chapter Six: Working With Arrays in Visual Basic.
Visual Basic.net Textbox & Label Controls. Textbox Naming convention (txt) Primary use (user input) Can except numeric and character values.
Input Validation Check the values entered into a text box before beginning any calculations Validation is a form of ‘self-protection’, rejecting bad data.
Chapter 8 - Visual Basic Schneider
OV Copyright © 2011 Element K Content LLC. All rights reserved.  Determine the Dialog Box Type  Capture User Input Creating an Interactive Worksheet.
Copyright © 2001 by Wiley. All rights reserved. Chapter 6: Using Arrays Control Arrays List Arrays Finding Items in Arrays Multiple Forms 2-Dimensional.
1 Scripting Languages VBScript - Recognized mainly by Internet Explorer only - Netscape does have a plug-in JavaScript - Recognized by Internet Explorer.
Chapter 7 - Lists, loops and printing w List boxes and combo boxes several types can add items at design time or during run time user select from predefined.
ME 142 Engineering Computation I Input, Output & Documentation.
Validation final steps Stopping gaps being entered in an input.
Visual Basic I/O Programs (ProjRead1, ProjRead2, ProjWrite1, ProjPay) Please use speaker notes for additional information!
Tutorial 3: Using Variables and Constants1 Tutorial 3 Using Variables and Constants.
CMPF114 Computer Literacy Chapter 3 The Visual Basic Environment 1.
Chapter 4 Getting Started with VBA. Subroutines Subroutine is the logical section of code that performs a particular task. Subroutine is also called a.
CECS 5020 Computers in Education Visual Basic Variables and Constants.
© 2006 Lawrenceville Press Slide 1 Chapter 6 The Post-Test Do…Loop Statement  Loop structure that executes a set of statements as long as a condition.
Controlling Program Flow with Looping Structures
HNDIT Rapid Application Development
© by Pearson Education, Inc. All Rights Reserved.-Edited By Maysoon Al-Duwais 2.
Variables and Expressions Programming Right from the Start with Visual Basic.NET 1/e 7.
Visual Basic. The Close Method The Close method is used to close a form. To close a form use the keyword Me to refer to the form. Me.Close()
Visual Basic Review LBS 126. VB programming Project Form 1Form 2Form 3 Text boxButton Picture box Objects Text box Button Objects.
Flow chart of the program Start Input a password Is it greater than 6 characters No Is it greater than 6 characters Is it greater than 12 characters yes.
Knowledge Base. Defining a Variable Dim statement Dim intXX As Integer Public in a Module Public dblNN As Double.
Creation of Variables with Numeric, alphanumeric, date, picture, memo data types Constant - A quantity that does not change during the execution of a program.
ME 142 Engineering Computation I Interacting with Spreadsheets.
Visual Basic.Net. Software to Install Visual Studio 2005 Professional Edition (Requires Windows XP Pro) MSDN Library for Visual Studio 2005 Available.
MsgBox, Input Box Functions Check boxes, radio button MsgBox, Input Box Functions Lab 3 3 Ismail M. Romi: PPU- IT Dept.
1 VB-06-String Manipulation Mar 03, 2002 String Function VISUAL BASIC.
Custom Dialog Box Alternatives And Dealing with FileNames Joanna Wyrobek.
CSC 162 Visual Basic I Programming. String Functions LTrim( string ) –Removes leading spaces from the left side of string RTrim( string ) –Removes trailing.
Chapter 6 Controlling Program Flow with Looping Structures.
© 2010 Lawrenceville Press Slide 1 Chapter 5 The Do…Loop Statement  Loop structure that executes a set of statements as long as a condition is true. 
1 Displaying Dialog Boxes Kashef Mughal. 2 Midterm Stats Here we go  Average was  Low was 116  High was 184  Mid Quarter Grade - check any.
Access VBA Programming for Beginners - Class 3 -
Chapter 5 The Do…Loop Statement
VBScript Session 6 Dani Vainstein.
Control Structures Part B - Message and Input Boxes
Additional Topics in VB.NET
Color Box Button - Gray Type : object Type : object Type : object
Option: Option: Question: Option: Permanently visible
Presentation transcript:

Visual Basic.net Functions

Function (Defined) A procedure that returns a value when called

Predefined Functions Lcase Ucase IsNumeric Len MsgBox InputBox LOF RGB Val Fixed Currency Percent EOF *note This is just a sample of pre-defined functions

Ucase Function Converts lower and upper case string characters to all upper case. UCASE(txtName.Text) ‘ converting to upper

Lcase Function Converts all upper and lower case characters to all lower case LCASE(txtName.Text) ‘ converts to lower

LEN Function Returns the number of characters in a string Len(“Tampa”) = 5 ‘ returned a value of 5

Message Box Function Displays a dialog box with a message, buttons, and an optional icon Syntax: MsgBox (“Message String” [ buttons, icon], [, caption]) Example: MsgBox (“Hello World”, vbOKOnly, vbInformation, “Hello World”)

Input Box Function Displays a dialog box with a text box, returns values input by the user Syntax: InputBox(“Prompt” [, “Caption”] [, Default] [, Xpos] [, Y Pos]) Example: InputBox (“How many do you want”, “Order”)

LOF Function Returns a length of file in data bytes LOF(#1) ‘ returns the length of file #1

EOF Function Returns a true value when end of file is reached EOF(#1) ‘ returns a true value when at the ‘ EOF of file #1

RGB Function Returns the Red, Green, Blue value of a Color Syntax(RedValue, GreenValue, BlueValue)

MID Function Returns a string from start position to end of string or specified number of characters Syntax: Mid(String, StartPosition [ NumberofCharacters]) Example: Mid(“Help me please!”, 2, 5) = elp m ‘ returns 5 characters

ISNumeric Function Returns true if value of expression is Numeric Used primarily for data validation IsNumeric(txtNum1.Text) ‘ checks for numeric value

VAL Function The Val() function converts string characters to numeric values Example: Val(txtNumber.text)