?
Solved

Visual Basic 6

Posted on 2000-01-27
7
Medium Priority
?
170 Views
Last Modified: 2013-11-25
What are return types?
I know one type is boolean.
Please give examples of other return types?
0
Comment
Question by:chrisha
7 Comments
 
LVL 1

Expert Comment

by:jamauss
ID: 2393567
If you are talking about variable types the amount is endless. But among the most used are

Integer
Boolean
Long
Double
String
Currency
Variant
Static

Is that what you are looking for?
0
 

Expert Comment

by:woottond
ID: 2393573
A return type is the type of object returned by a procedure. Therefore a return type could be any object that vb has already defined ie integer, string, char, boolean, long... or some other object that you have defined.
Hope this answers your question,
che,
.././David
0
 
LVL 9

Expert Comment

by:Ruchi
ID: 2393611
Return types can be explicitly state in the Function procedure header using either the As keyword or a type declaration character. i.e. you could write the definition of Area to return a single ....

private function area(s1 as single, s2 as single) as single

if using boolean,

 private function test() as boolean.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
LVL 6

Expert Comment

by:st_steve
ID: 2393745
In addition to what jamauss said....."single" is also a variable type...don't know if this is what you want though.....these are variable types
0
 
LVL 6

Expert Comment

by:st_steve
ID: 2393757
In addition to what jamauss said....."single" is also a variable type...don't know if this is what you want though.....these are variable types you can also have "byte" and other things. you can check the declaration of variable types by typing:

(dim "variable_name" as) followed by a space. VB should display all the valid types automatically.

e.g. dim abc as  (notice the space at the end)
0
 
LVL 1

Accepted Solution

by:
paul_tsekov earned 15 total points
ID: 2394337
Hi, VBfan




A return type is the type of the value that some function returns:

Private Function MyFunc(Param1 As Long, Param2 as String, ......) As Boolean

  MyFunc=True
.....
.....
  MyFunc=False
......
......
End Function

The type of the function in this case is Boolean

So if you have the variable
Dim Flag As Boolean

You can write:
  Flag=MyFunc(30024, "John Eagles", ....)

The return value can be any of the types, that Visual Basic supports:

Boolean
Integer
Single
Double
Long
Double
String
Currency
Variant
Static

 and so on...

       Pavel Tsekov
   email : paul_tsekov@yahoo.com
0
 
LVL 9

Expert Comment

by:Ruchi
ID: 2525765
Chrisha: Where are you? Please say something so we could be of any help to you.
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

599 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question