SlideShare uma empresa Scribd logo
1 de 27
Electroteam__@hotmail.com
Interesting Education
Electro-Team
Visual Basic 2010
Functions II
This Slides Will Cover
1. The Right Function.
2. The Left Function.
3. The Trim Function.
4. The Ltrim & Rtrim Function.
5. The InStr function.
6. The Ucase and the Lcase Functions.
7. The Abs Function.
8. The Exp function..
9. The Fix Function.
10. The Int Function.
11. The Rnd( ) Function.
12. The Round Function.
Open new project and add 2 Labels, 1 Textbox and 1 Button
1. The Right Function
The format is:-
Microsoft.Visualbasic.Right ("Phrase", n)
Example
Microsoft.Visualbasic.Right (“Hello World", 5)=World
Label1
Text = Right Function
Font = 18 , Bold
Format  Center in FormHorizontally
Label2
Text = …………
Font = 16 , Bold
Button1
Text = Go
Font = 14 , Bold
Form1
Text = Right Function Ex.
Start Position = Center Screen
Button1 Code
Private Sub Button1_Click
Label2.Text = Microsoft.VisualBasic.Right(TextBox1.Text, 5)
End Sub
2. The Left Function
The format is:-
Microsoft.Visualbasic.Left ("Phrase", n)
Modify Previous Program code ..
Private Sub Button1_Click
Label2.Text = Microsoft.VisualBasic.Left(TextBox1.Text, 5)
End Sub
Run Time
3. The Trim Function
The format is:-
Trim("Phrase")
Example:
Trim (" Visual Basic ") = Visual basic
Modify Previous Program code ..
Private Sub Button1_Click
Label2.Text = Trim(TextBox1.Text)
End Sub
Run Time
4. The Ltrim & Rtrim Function
The Ltrim Function
The format is:
Ltrim("Phrase")
Example:-
Ltrim (" Visual Basic")= Visual basic
The Rtrim Function
The format is:
Rtrim("Phrase")
Example
Rtrim ("Visual Basic ") = Visual Basic
5. The InStr function
The format is:
Instr (n, original phase, embedded phrase)
Where n is the position where the Instr function will
begin to look for the embedded phrase.
Private Sub Button1_Click
Label2.Text = InStr(1, TextBox1.Text, "Egypt")
End Sub
Run Time
Modify Button1 code
Label2.Text = InStr(1, TextBox1.Text, "t")
Modify Button1 code
Label2.Text = InStr(5, TextBox1.Text, "t")
And note the difference
6. The Ucase and the Lcase Functions
The Ucase function converts all the characters of a string
to capital letters.
The Lcase function converts all the characters of a string
to small letters.
The format is:-
Microsoft.VisualBasic.UCase(Phrase)
Microsoft.VisualBasic.LCase(Phrase)
7. The Abs Function
Return the absolute value of a given number.
The syntax is
Math. Abs (number)
The Math keyword here indicates that the Abs
function belong to the Math class.
Run Time
Private Sub Button1_Click
Label2.Text = Math.Abs(Val(TextBox1.Text))
End Sub
8. The Exp function
The Exp of a number x is the exponential value
of x………., i.e. e^x
Exp(1)=e=2.71828182
The syntax is:
Math.Exp (number)
9. The Fix Function
The Fix function truncate the decimal part of a
positive number and returns the largest integer
smaller than the number.
The syntax is:
Fix(number)
Private Sub Button1_Click
Label2.Text = Fix(Val(TextBox1.Text))
End Sub
10. The Int Function
Example:-
Int(2.4)=2, Int(6.9)=6 , Int(-5.7)=-6
(XI) The Log Function
Example:-
Log(10)=2.302585
11. The Rnd( ) Function
The Rnd function returns a random value
between 0 and 1.
The traditional usage of this function is to covert
its result to integer value …using the formula.
Int(Rnd() * 10)
Modify Previous Program code ..
Private Sub Button1_Click()
Label2.Text = Int(Rnd() * 10)
End Sub
Run Time
12. The Round Function
The Round function is the function that rounds
up a number to a certain number of decimal
places. The Format is Round (n, m) which means
to round a number n to m decimal places. For
Example:-
Math.Round (7.2567, 2) =7.26
Run Time
Produced by
Electro-Team
Electroteam__@hotmail.com

Mais conteúdo relacionado

Semelhante a Function 2

Functions 1
Functions 1Functions 1
Functions 1Spy Seat
 
Tutorials on Macro
Tutorials on MacroTutorials on Macro
Tutorials on MacroAnurag Deb
 
Autocad excel vba
Autocad excel vbaAutocad excel vba
Autocad excel vbarjg_vijay
 
VERSIONS AND FUNCTIONS OF MS EXCEL
VERSIONS AND FUNCTIONS OF MS EXCELVERSIONS AND FUNCTIONS OF MS EXCEL
VERSIONS AND FUNCTIONS OF MS EXCELIMRAN WASTA
 
Basic Functions - Excel 2013 Tutorial
Basic Functions - Excel 2013 TutorialBasic Functions - Excel 2013 Tutorial
Basic Functions - Excel 2013 TutorialSpreadsheetTrainer
 
MS Project - Lesson #1B - Basics of Project Scheduling - Part 2Obj.docx
MS Project - Lesson #1B - Basics of Project Scheduling - Part 2Obj.docxMS Project - Lesson #1B - Basics of Project Scheduling - Part 2Obj.docx
MS Project - Lesson #1B - Basics of Project Scheduling - Part 2Obj.docxrosemarybdodson23141
 
Useful macros and functions for excel
Useful macros and functions for excelUseful macros and functions for excel
Useful macros and functions for excelNihar Ranjan Paital
 
Functional programming and Elm
Functional programming and ElmFunctional programming and Elm
Functional programming and ElmFangda Wang
 
Chapter 16-spreadsheet1 questions and answer
Chapter 16-spreadsheet1  questions and answerChapter 16-spreadsheet1  questions and answer
Chapter 16-spreadsheet1 questions and answerRaajTech
 
Succeeding in Business with Microsoft Excel 2010 A Problem Solving Approach 1...
Succeeding in Business with Microsoft Excel 2010 A Problem Solving Approach 1...Succeeding in Business with Microsoft Excel 2010 A Problem Solving Approach 1...
Succeeding in Business with Microsoft Excel 2010 A Problem Solving Approach 1...KeithRomeros
 
Create formsexcel
Create formsexcelCreate formsexcel
Create formsexcelRavi Gajul
 
Although people may be very accustomed to reading and understanding .docx
Although people may be very accustomed to reading and understanding .docxAlthough people may be very accustomed to reading and understanding .docx
Although people may be very accustomed to reading and understanding .docxmilissaccm
 

Semelhante a Function 2 (20)

Functions 1
Functions 1Functions 1
Functions 1
 
Tutorials on Macro
Tutorials on MacroTutorials on Macro
Tutorials on Macro
 
Ms excel
Ms excelMs excel
Ms excel
 
Autocad excel vba
Autocad excel vbaAutocad excel vba
Autocad excel vba
 
VERSIONS AND FUNCTIONS OF MS EXCEL
VERSIONS AND FUNCTIONS OF MS EXCELVERSIONS AND FUNCTIONS OF MS EXCEL
VERSIONS AND FUNCTIONS OF MS EXCEL
 
Ict project pdf
Ict project pdfIct project pdf
Ict project pdf
 
Basic Functions - Excel 2013 Tutorial
Basic Functions - Excel 2013 TutorialBasic Functions - Excel 2013 Tutorial
Basic Functions - Excel 2013 Tutorial
 
Visualbasic tutorial
Visualbasic tutorialVisualbasic tutorial
Visualbasic tutorial
 
MS Project - Lesson #1B - Basics of Project Scheduling - Part 2Obj.docx
MS Project - Lesson #1B - Basics of Project Scheduling - Part 2Obj.docxMS Project - Lesson #1B - Basics of Project Scheduling - Part 2Obj.docx
MS Project - Lesson #1B - Basics of Project Scheduling - Part 2Obj.docx
 
Excel300
Excel300Excel300
Excel300
 
pyton Notes6
 pyton Notes6 pyton Notes6
pyton Notes6
 
Useful macros and functions for excel
Useful macros and functions for excelUseful macros and functions for excel
Useful macros and functions for excel
 
Functional programming and Elm
Functional programming and ElmFunctional programming and Elm
Functional programming and Elm
 
Chapter 16-spreadsheet1 questions and answer
Chapter 16-spreadsheet1  questions and answerChapter 16-spreadsheet1  questions and answer
Chapter 16-spreadsheet1 questions and answer
 
Succeeding in Business with Microsoft Excel 2010 A Problem Solving Approach 1...
Succeeding in Business with Microsoft Excel 2010 A Problem Solving Approach 1...Succeeding in Business with Microsoft Excel 2010 A Problem Solving Approach 1...
Succeeding in Business with Microsoft Excel 2010 A Problem Solving Approach 1...
 
Python Lecture 4
Python Lecture 4Python Lecture 4
Python Lecture 4
 
Mmc manual
Mmc manualMmc manual
Mmc manual
 
Vba introduction
Vba introductionVba introduction
Vba introduction
 
Create formsexcel
Create formsexcelCreate formsexcel
Create formsexcel
 
Although people may be very accustomed to reading and understanding .docx
Although people may be very accustomed to reading and understanding .docxAlthough people may be very accustomed to reading and understanding .docx
Although people may be very accustomed to reading and understanding .docx
 

Mais de Spy Seat

Software Design
Software DesignSoftware Design
Software DesignSpy Seat
 
Visual Basic 6 Data Base
Visual Basic 6 Data BaseVisual Basic 6 Data Base
Visual Basic 6 Data BaseSpy Seat
 
Visual Basic ADO
Visual Basic ADOVisual Basic ADO
Visual Basic ADOSpy Seat
 
Visual basic 6
Visual basic 6Visual basic 6
Visual basic 6Spy Seat
 
Create Contacts program with VB.Net
Create Contacts program with VB.NetCreate Contacts program with VB.Net
Create Contacts program with VB.NetSpy Seat
 
Create Your first website
Create Your first websiteCreate Your first website
Create Your first websiteSpy Seat
 
How Computer work
How Computer workHow Computer work
How Computer workSpy Seat
 
visual basic 6 Add Merlin
visual basic 6 Add Merlin visual basic 6 Add Merlin
visual basic 6 Add Merlin Spy Seat
 
My Bachelor project slides
My Bachelor project slides My Bachelor project slides
My Bachelor project slides Spy Seat
 
Difference between asp and php
Difference between asp and phpDifference between asp and php
Difference between asp and phpSpy Seat
 
Error handling
Error handlingError handling
Error handlingSpy Seat
 
I/O PHP Files and classes
I/O PHP Files and classesI/O PHP Files and classes
I/O PHP Files and classesSpy Seat
 
Php session 3 Important topics
Php session 3 Important topicsPhp session 3 Important topics
Php session 3 Important topicsSpy Seat
 
Notify progresscontrol
Notify progresscontrolNotify progresscontrol
Notify progresscontrolSpy Seat
 
Listbox+checkedlistbox
Listbox+checkedlistboxListbox+checkedlistbox
Listbox+checkedlistboxSpy Seat
 
If then vs select case
If then vs select caseIf then vs select case
If then vs select caseSpy Seat
 
If then vb2010
If then vb2010If then vb2010
If then vb2010Spy Seat
 
Date & time picker
Date & time pickerDate & time picker
Date & time pickerSpy Seat
 

Mais de Spy Seat (20)

Software Design
Software DesignSoftware Design
Software Design
 
Visual Basic 6 Data Base
Visual Basic 6 Data BaseVisual Basic 6 Data Base
Visual Basic 6 Data Base
 
Visual Basic ADO
Visual Basic ADOVisual Basic ADO
Visual Basic ADO
 
Visual basic 6
Visual basic 6Visual basic 6
Visual basic 6
 
Create Contacts program with VB.Net
Create Contacts program with VB.NetCreate Contacts program with VB.Net
Create Contacts program with VB.Net
 
Create Your first website
Create Your first websiteCreate Your first website
Create Your first website
 
How Computer work
How Computer workHow Computer work
How Computer work
 
visual basic 6 Add Merlin
visual basic 6 Add Merlin visual basic 6 Add Merlin
visual basic 6 Add Merlin
 
My Bachelor project slides
My Bachelor project slides My Bachelor project slides
My Bachelor project slides
 
Difference between asp and php
Difference between asp and phpDifference between asp and php
Difference between asp and php
 
Error handling
Error handlingError handling
Error handling
 
I/O PHP Files and classes
I/O PHP Files and classesI/O PHP Files and classes
I/O PHP Files and classes
 
Php session 3 Important topics
Php session 3 Important topicsPhp session 3 Important topics
Php session 3 Important topics
 
Notify progresscontrol
Notify progresscontrolNotify progresscontrol
Notify progresscontrol
 
Listbox+checkedlistbox
Listbox+checkedlistboxListbox+checkedlistbox
Listbox+checkedlistbox
 
If then vs select case
If then vs select caseIf then vs select case
If then vs select case
 
If then vb2010
If then vb2010If then vb2010
If then vb2010
 
For next
For nextFor next
For next
 
Date & time picker
Date & time pickerDate & time picker
Date & time picker
 
Combo box
Combo boxCombo box
Combo box
 

Último

Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 

Último (20)

Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 

Function 2

  • 2. This Slides Will Cover 1. The Right Function. 2. The Left Function. 3. The Trim Function. 4. The Ltrim & Rtrim Function. 5. The InStr function. 6. The Ucase and the Lcase Functions. 7. The Abs Function. 8. The Exp function.. 9. The Fix Function. 10. The Int Function. 11. The Rnd( ) Function. 12. The Round Function.
  • 3. Open new project and add 2 Labels, 1 Textbox and 1 Button
  • 4. 1. The Right Function The format is:- Microsoft.Visualbasic.Right ("Phrase", n) Example Microsoft.Visualbasic.Right (“Hello World", 5)=World
  • 5. Label1 Text = Right Function Font = 18 , Bold Format Center in FormHorizontally Label2 Text = ………… Font = 16 , Bold Button1 Text = Go Font = 14 , Bold Form1 Text = Right Function Ex. Start Position = Center Screen
  • 6.
  • 7. Button1 Code Private Sub Button1_Click Label2.Text = Microsoft.VisualBasic.Right(TextBox1.Text, 5) End Sub
  • 8. 2. The Left Function The format is:- Microsoft.Visualbasic.Left ("Phrase", n) Modify Previous Program code .. Private Sub Button1_Click Label2.Text = Microsoft.VisualBasic.Left(TextBox1.Text, 5) End Sub
  • 10. 3. The Trim Function The format is:- Trim("Phrase") Example: Trim (" Visual Basic ") = Visual basic Modify Previous Program code .. Private Sub Button1_Click Label2.Text = Trim(TextBox1.Text) End Sub
  • 12. 4. The Ltrim & Rtrim Function The Ltrim Function The format is: Ltrim("Phrase") Example:- Ltrim (" Visual Basic")= Visual basic The Rtrim Function The format is: Rtrim("Phrase") Example Rtrim ("Visual Basic ") = Visual Basic
  • 13. 5. The InStr function The format is: Instr (n, original phase, embedded phrase) Where n is the position where the Instr function will begin to look for the embedded phrase. Private Sub Button1_Click Label2.Text = InStr(1, TextBox1.Text, "Egypt") End Sub
  • 15. Modify Button1 code Label2.Text = InStr(1, TextBox1.Text, "t") Modify Button1 code Label2.Text = InStr(5, TextBox1.Text, "t") And note the difference
  • 16. 6. The Ucase and the Lcase Functions The Ucase function converts all the characters of a string to capital letters. The Lcase function converts all the characters of a string to small letters. The format is:- Microsoft.VisualBasic.UCase(Phrase) Microsoft.VisualBasic.LCase(Phrase)
  • 17. 7. The Abs Function Return the absolute value of a given number. The syntax is Math. Abs (number) The Math keyword here indicates that the Abs function belong to the Math class.
  • 18. Run Time Private Sub Button1_Click Label2.Text = Math.Abs(Val(TextBox1.Text)) End Sub
  • 19. 8. The Exp function The Exp of a number x is the exponential value of x………., i.e. e^x Exp(1)=e=2.71828182 The syntax is: Math.Exp (number)
  • 20. 9. The Fix Function The Fix function truncate the decimal part of a positive number and returns the largest integer smaller than the number. The syntax is: Fix(number)
  • 21. Private Sub Button1_Click Label2.Text = Fix(Val(TextBox1.Text)) End Sub
  • 22. 10. The Int Function Example:- Int(2.4)=2, Int(6.9)=6 , Int(-5.7)=-6 (XI) The Log Function Example:- Log(10)=2.302585
  • 23. 11. The Rnd( ) Function The Rnd function returns a random value between 0 and 1. The traditional usage of this function is to covert its result to integer value …using the formula. Int(Rnd() * 10) Modify Previous Program code .. Private Sub Button1_Click() Label2.Text = Int(Rnd() * 10) End Sub
  • 25. 12. The Round Function The Round function is the function that rounds up a number to a certain number of decimal places. The Format is Round (n, m) which means to round a number n to m decimal places. For Example:- Math.Round (7.2567, 2) =7.26