Function procedures - vbscript, Visual Basic Programming

Assignment Help:

This is a series of VBScript statements enclosed through the Function & End Function statements. A Function procedure is same to a Sub procedure, however can also return a value. This can take arguments (variables, constants or expressions which are passed to it by a calling process). If a Function procedure has no arguments, its Function statement has to comprise an empty set of parentheses (). A Function returns a value through assigning a value to its name in one or more statements of the process. The return type of a Function is always a Variant.

In the given example, the Celsius function calculates degrees Celsius from degrees Fahrenheit. While the function is called from the ConvertTemp Sub procedure, a variable having the argument value is passed to the function. The result of calculation is returned to the calling process and displayed in a message box.

Sub ConvertTemp()

temp = InputBox("Please enter the temperature in degrees F.", 1)

MsgBox "The temperature is " & Celsius(temp) & " degrees C."

End Sub

Function Celsius(fDegrees)

Celsius = (fDegrees - 32) * 5 / 9

End Function


Related Discussions:- Function procedures - vbscript

Loan program, need help with logic part of loan program

need help with logic part of loan program

Architecture of win 32 program, ARCHITECTURE OF WIN 32 PROGRAM   ...

ARCHITECTURE OF WIN 32 PROGRAM   Figure: working of Win 3 program The hardware events in the figure are the mouse associated events like the mouse move, left

Option explicit declaration - data types, Option Explicit Declaration: ...

Option Explicit Declaration: If the option explicit is used essentially then all the variables will have to be declared. Or else an error will be reported saying that the vari

Student record management system, i need your help in designing and coding ...

i need your help in designing and coding a student record management system

Hungarian notation, Hungarian Notation: The Hungarian Notation was inv...

Hungarian Notation: The Hungarian Notation was invented by Charles Simonyi from Microsoft. It is a naming convention. It is a reminder of the type of a variable. The Handles h

Modeless dialog, MODELESS DIALOG The Dialog boxes are either modal or m...

MODELESS DIALOG The Dialog boxes are either modal or modeless. The modal dialog box should be closed (Unloaded or hidden) before you can continue the working with the rest of t

Introduction to visual c++ programming, INTRODUCTION to VISUAL C++ PROGRAMM...

INTRODUCTION to VISUAL C++ PROGRAMMING This section introduces you to develop the applications using VC++. The Single document interface (SDI), multiple document interface (MDI

Vb script basics, This section will discuss the fundamentals of VBScript an...

This section will discuss the fundamentals of VBScript and define concepts such as datatypes, loops and others. VBScript Data Types VBScript contain only one data type called

Explain dtd elements and dtd attributes, Problem 1. Describe the concep...

Problem 1. Describe the concept of exception in .Net environment 2. Explain the process of adding, updating and deleting records with an example 3. Explain DTD elements a

Mfc classes, THE MFC CLASSES The CDocument, CWinAppCFrameWnd and CView ...

THE MFC CLASSES The CDocument, CWinAppCFrameWnd and CView are derived from the CObject and they give the majority of the structure and functionality.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd