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

Use serialize function in document class to implement file, USE OF SERIALIZ...

USE OF SERIALIZE FUNCTION IN DOCUMENT CLASS TO IMPLEMENT FILE void CStoreDoc::Serialize(CArchive& ar) { if (ar.IsStoring()) { // TODO: add storing code here }

Vbscript error object clear method, Methods: VBScript Err Object ...

Methods: VBScript Err Object Clear Method Clears every property settings. Raise Method Generate a run-time error.

Aim - control statement, Aim: To exhibit what is the day when the seco...

Aim: To exhibit what is the day when the second command button is clicked and to clear the screen when the first command button is clicked. The functioning of this program is

Intrinsic controls, INTRINSIC CONTROLS   The Intrinsic controls are th...

INTRINSIC CONTROLS   The Intrinsic controls are the built-in controls. Few of the controls are Combo box, Check box, Command Button, Label etc. The controls have properties re

Vb script, We will discuss scripting language; called VB Script. VBScript i...

We will discuss scripting language; called VB Script. VBScript is Microsoft's scripting language. It enables us to write programs which enhance the power of Web pages by letting us

Dialog based application, Dialog Based Application: (A) Dialog Based ...

Dialog Based Application: (A) Dialog Based Application to demonstrate Animate Control: 1. Build a dialog based application. 2. Design the dialog as shown. 3. Place

Kitchen mock, How to pull ordered menu from a cash till to database or disp...

How to pull ordered menu from a cash till to database or display on a computer screen

How to include list box control in visual basic project, How to Include Lis...

How to Include List Box control in your project A list box is used for representing the users with a data. You can prefer the data from the list box for data entry. No editing

Create an application, 1. Create a new solution file named Ch03HandsOnProje...

1. Create a new solution file named Ch03HandsOnProject1. 2. Rename the form and set the filename of the form to frmMain and frmMain.vb, respectively. 3. Set the appropriate p

Match Game, I would like someone to look at my code and tell me why it''s n...

I would like someone to look at my code and tell me why it''s not working

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