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

Vbscript variables, A variable is convenient placeholder which refers to a ...

A variable is convenient placeholder which refers to a computer memory location where you can store program information which may change when your script is running. For instance,

Find the total cost, Case: Design a web page that contains the VBScript uti...

Case: Design a web page that contains the VBScript utilized for calculating subtotals, taxes, discounts & totals as well as code utilized to validate use

program that compares interest rates between two banks, 'This program comp...

'This program compares interest rates between two banks and determines the best bank PublicClassForm1 PrivateSub Button1_Click(sender AsSystem.Object, e AsSystem.EventArgs) H

Adding events in visual basic , Adding Events in VB   For adding the e...

Adding Events in VB   For adding the events in VB, first double click on the command button with the caption hello. The Private Sub command1_Click () and End Sub would be

Do loops, You can employ Do...Loop statements to run a block of statements ...

You can employ Do...Loop statements to run a block of statements indefinite number of times. The statements are repeated either whilst a condition is True or till a condition becom

Creating an order entry and editing application , Assume you are creating a...

Assume you are creating an order entry and editing application for a book store. An order consists of a product, quantity, total price, payment type including Credit/Debit card acc

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.

Help, i need code for assignment problem of operational research in vb

i need code for assignment problem of operational research in vb

Software that is rude - basics of gui design, Software That Is Rude: T...

Software That Is Rude: The software warns the user for making the mistakes. The Message boxes pop up representing the mistake and the user will have to click the OK or CANCEL

Use of wm_size message - class wizard, Use of WM_SIZE Message: Wheneve...

Use of WM_SIZE Message: Whenever the WM_SIZE message is handled and the graphical objects on the output window will also change consequently to the output window. The functi

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