Visual Basic 2008 Programming: Business Applications with a Design Perspective
Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9
Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14 Appendix A Appendix B Appendix C Home
Loading
Last change: February 13 2016 18:48:19.

 Chapter in PDF

Table of Contents

Chapter 4: Data, Operations, and Built-In Functions
Last change: February 13 2016 18:47:36.
<<PreviousNext>>

Using Functions

You can use functions in any expressions in the same the way you use a constant or variable. Here are some examples, assuming all variables involved have been properly declared and assigned with proper values:

TheWidth = Math.Abs (X1 – X2) ‘width of a rectangle GrossPay = CDbl (HourRate) * CDbl(HoursWorked) ‘compute gross pay ‘ Compute total time under the learning curve model TotalTime = InitTime * Units ^ _ (1R + Math.Log(LearningRate) / Math.Log (2R)) Sample = Sqrt(100R * Rnd()) ‘square root of 100 times a random number MsgBox(“Today is “ & Today) ‘ Display today

Last change: February 13 2016 18:47:38.
<<PreviousNext>>