1 / 13

Visual Basic - Intrinsic Functions

Visual Basic - Intrinsic Functions. Intrinsic Functions. Pre-coded Functions Used to improve developer productivity Broad Range of Activities Math calculations Time/Date functions String formatting Many more. Intrinsic Functions. Functions ALWAYS return a value

kerry
Download Presentation

Visual Basic - Intrinsic Functions

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Visual Basic - Intrinsic Functions

  2. Intrinsic Functions • Pre-coded Functions • Used to improve developer productivity • Broad Range of Activities • Math calculations • Time/Date functions • String formatting • Many more

  3. Intrinsic Functions • Functions ALWAYS return a value • You MUST do something with the value that is returned • Right hand side of an assignment statement • Part of an Output Statement

  4. Examples of Intrinsic Functions

  5. Examples of Intrinsic Functions

  6. More Intrinsic Functions • InputBox • Prompts the user for keyboard input • Input is returned to the program for processing • Syntax: Result = InputBox (prompt, [title]) • Example: strInput = InputBox (“Enter Input”, “Input”) strName = InputBox (“What is your name”)

  7. One More Intrinsic Function • MsgBox • Displays a message in a dialog box • Syntax MsgBox (prompt) • Example: MsgBox (“Hello World”) MsgBox (“The Result is “ & Result)

  8. Example • Create an application that adds items to a sales receipt one at a time using an input text box and a button. Each time the button is pressed, the new item price should be added to a list box control which acts as a receipt. The program should also contain output labels for subtotal, sales tax and total that should be updated when an item is added to the receipt. (Ensure that the prices are numeric and that the output is formatted to currency)

  9. TOE Chart

  10. Interface

  11. Code • Variables • Subtotal • Tax • Total • What Data Types? • Where to Declare?

  12. Add to Receipt Button • Read in Data from Text Box • Convert to Number • CDbl • Val • Input into ListBox • Formatted as Currency • Update Subtotal, Tax, Total & Displays

  13. Convert to Number Format to Currency Format to Currency

More Related