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


Please Help Members By Posting Answers For Below Questions

what are local and global variables and their differences? : Sql dba

712


What is crud diagram?

677


How to select the Nth maximum salary from Table Emp in Oracle SQL Plus ?

812


What is cross join sql?

678


What is a data manipulation language?

745






What is data types in sql?

705


Explain what is a view?

795


Is it possible to link two groups inside a cross products after the cross products group has been created?

769


What does trigger mean in slang?

733


What is the purpose of a secondary key?

679


How to pronounce postgresql?

761


What are primary key and foreign key and how they work?

743


Which is better varchar or nvarchar?

732


How can get second highest salary in sql?

688


What is recursive join in sql?

752