IT. Expert System.




The Function statement declares the name, arguments, and code that form the body of a Function procedure.

This statement has the following form:

[Public [Default] | Private] Function name [(arglist)]
   [name = expression]
   [Exit Function] 
   [name = expression]
End Function 
Parameter Description
Public (optional) A keyword that specifies that the constant is available to all procedures in all scripts
Default (optional) A keyword that is used only with the Public keyword in a Class block to indicate that the Function procedure is the default method for the class.

An error occurs if more than one Default procedure is specified in a class.
Private (optional) A keyword that specifies that the constant is only available within the script where the declaration is made
name (required) Specifies the name of the function

Note: name must follow the standard variable naming conventions
arglist Specifies a list of variables representing arguments that are passed to the Function procedure when it is called

This argument has the following syntax and parts:
[ByVal | ByRefvarname[( )]

ByVal - Indicates that the argument is passed by value

ByRef - Indicates that the argument is passed by reference

(if both ByVal and ByRef are omitted, the default is ByRef)

varname - Specifies the name of the variable representing the argument; follows standard variable naming conventions

Note: Commas separate multiple variables
statements Any group of statements to be executed within the body of the Function procedure
expression (optional) Specifies the return value of the Function


The following example shows the basic use of this statement:

Dim retValue

' Call the function with and without the "Call" keyword
Call DisplaySum(1, 2)
DisplaySum 3, 4

' Omit the "Call" keyword to access
' the function's return value
retValue = DisplaySum(5, 6)
MsgBox "retValue:  " & retValue

Function DisplaySum(value1, value2)
    Dim total

    total = value1 + value2

    DisplaySum = total
End Function

This produces the following result (each line in a separate pop-up message box):


Miscellaneous Information

Supported in Version: 1.0


Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)





Java Script








Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 175 / 159171161. Delta: 0.00363 с