How to return more than one value from a function?
Answer Posted / ravivarman_r
Public Type Income
Wages As Currency
Dividends As Currency
Other As Currency
Total As Currency
End TypeYou can now use this structure as the return
type for a function. In a real situation, the function
would look up your database tables to get the values, but
the return values would be assigned like this:
Function GetIncome() As Income
GetIncome.Wages = 950
GetIncome.Dividends = 570
GetIncome.Other = 52
GetIncome.Total = GetIncome.Wages +
GetIncome.Dividends + GetIncome.Other
End FunctionTo use the function, you could type into
the Immediate Window:
GetIncome().Wages
Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
What is varchar data type in sql?
How do I start sql from command line?
what are local and global variables and their differences? : Sql dba
Under what condition it is possible to have a page level lock and row lock at the same time for a query? : Transact sql
what are the difference between clustered and a non-clustered index? : Sql dba
What is break?
What is minus?
How do you copy a table in sql?
What is sql select statement?
Which is better varchar or nvarchar?
Which data dictionary views have the information on the triggers that are available in the database?
what is the use of set statement in tsql? : Transact sql
What are two statement types in sql?
What are commit, rollback, and savepoint?
Is keyword pl sql?