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

File system controls, FILE SYSTEM CONTROLS There are 3 file system cont...

FILE SYSTEM CONTROLS There are 3 file system controls as shown in figure. The drive list box, directory list box & the file list box. The drive list box control is used to exhi

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

i need code for assignment problem of operational research in vb

Develop a web page for accepting information regarding stock, Develop a web...

Develop a web page that is used for accepting information regarding stocks. Make sure the form carry out the possible validations. The simple instance code below merely illustrates

Change calculator, how do i create a change calculator that gives the denom...

how do i create a change calculator that gives the denominations of coins for an amount of change up to .99 cents

Restricting the vocabulary - visual interface design, Restricting The Vocab...

Restricting The Vocabulary: The properly formed vocabulary is like an inverted pyramid. All easy to learn communication system follow this pattern. The canonical vocabulary in

Question, #question.algorithemtofindwhetheragivennumberisprime/not.

#question.algorithemtofindwhetheragivennumberisprime/not.

Files in a visual basic project, FILES IN A VB PROJECT The project file...

FILES IN A VB PROJECT The project file has the.vbp extension. The form in which we draw has the .frm extension; .mod denotes the module file; .cls denotes the class file; .res

Tab order - dialog, Tab Order: The tab order stands for the order in w...

Tab Order: The tab order stands for the order in which the controls receive focus when the user clicks the tab key. The CTRL + D can be used to set the tab order of controls.

XML with database, write a XML with database with book details( book id, au...

write a XML with database with book details( book id, author ,subject, published year, vendor,price, language )

For next loop - vbscript, You can employ For...Next statements to run a blo...

You can employ For...Next statements to run a block of statements a specific number of times. For loops, employ a counter variable whose value is increased or decreased with each r

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