Download presentation
Presentation is loading. Please wait.
Published byPaul Davidson Modified over 9 years ago
1
Visual Basic.net Functions
2
Function (Defined) A procedure that returns a value when called
3
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
4
Ucase Function Converts lower and upper case string characters to all upper case. UCASE(txtName.Text) ‘ converting to upper
5
Lcase Function Converts all upper and lower case characters to all lower case LCASE(txtName.Text) ‘ converts to lower
6
LEN Function Returns the number of characters in a string Len(“Tampa”) = 5 ‘ returned a value of 5
7
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”)
8
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”)
9
LOF Function Returns a length of file in data bytes LOF(#1) ‘ returns the length of file #1
10
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
11
RGB Function Returns the Red, Green, Blue value of a Color Syntax(RedValue, GreenValue, BlueValue)
12
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
13
ISNumeric Function Returns true if value of expression is Numeric Used primarily for data validation IsNumeric(txtNum1.Text) ‘ checks for numeric value
14
VAL Function The Val() function converts string characters to numeric values Example: Val(txtNumber.text)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.