CodeWidgets.com Online Source Code Library -ASP, ASP.NET, VB, VB.Net,
Microsoft® Access, Javascript, VBScript, Website Design, Web Applications,
Custom Programming Services Available.
|
|
ASP, ASP.NET, VB, VB.Net,
Microsoft® Access, Javascript, VBScript,
Website Design, Web Applications |
|
|
Shopping Cart
(0) Items $0.00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Website Stats to Date
|
|
Pages Viewed 4,401,732
|
|
Visitors
1,206,536
|
|
Widgets Viewed
3,009,755
|
| Since January 1/2003 |
| |
Active Users: 22
|
|
|
|
|
|
 |
|
|
| |
| Widget
#CS0055 |
Create a function that returns multiple values.Create a function that returns multiple values. |
|
|
|
|
|
| Widget Info
|
VB 6.0, VB.NET
Using Structures or Types
'VB 6.0 Create a Type to store your values in
Public Type vbTwoDates
m_StartDate As Date
m_EndDate As Date
End Type
'Function to return the multiple values
Function GetDates(ByVal dtValue As Date) As vbTwoDates
'Pass values to the Members of the GetDates function declared as Type vbTwoDates
GetDates.m_StartDate = dtValue - 3
GetDates.m_EndDate = dtValue + 3
End Function
Public Sub ShowDates()
'declare a variable of the Type vbTwoDates
Dim dtTwoDays As vbTwoDates
'Fill the variable declared as vbTwoDates using the function
dtTwoDays = GetDates(Date())
'display the values
MsgBox dtTwoDays.m_StartDate & " to " & dtTwoDays.m_EndDate
End Sub
'VB.NET Create a Structure to store your values in
Public Structure
vbTwoDates
Public m_StartDate As
System.DateTime
Public m_EndDate As
System.DateTime
End Structure
'Function to return the multiple values
Function GetDates(ByVal
dtValue As System.DateTime) As
vbTwoDates
'Pass values to the Members of the GetDates function
declared as Type vbTwoDates
Dim Duration As
System.TimeSpan
Duration = New System.TimeSpan(3, 0, 0, 0, 0)
GetDates.m_StartDate = dtValue.Subtract(Duration)
GetDates.m_EndDate = dtValue.Add(Duration)
End Function
Public Sub
ShowDates()
'declare a variable of the Type vbTwoDates
Dim dtTwoDays As
vbTwoDates
'Fill the variable declared as vbTwoDates using the
function
dtTwoDays = GetDates(System.DateTime.Today)
'display the values
MsgBox(dtTwoDays.m_StartDate.ToString & " to " &
dtTwoDays.m_EndDate.ToString)
End Sub |
|
| Licensing |
| Format:
Plug & Play Code |
| Copy the Source Code Above.. |
| Licencing Terms:
No Restrictions |
Re-Distribution Permitted
This source code is provided to you "as is" without warranty
CLICK HERE FOR TERMS OF USE
Copyright 2002-2006 Comrie Software Solutions |
|
| Related Widgets |
|
|
| ShoppingCart Empty |
|
|
|
| Featured Widgets |
| WebStore |
| Online Store Application
Template (ASP.NET) |
| More... |
|
| ShoppingCart |
| WebUserControl (ASP.NET) |
| More... |
|
| Calendar Reports |
| (Monthly View) |
| For Microsoft® Access |
| More... |
|
Online Voting/Survey
Web-App |
 |
|
More... |
|
|
|
|
|
 .. this is one site that believes in Customer Service. I had questions, I had answers quickly. No "wait for days", No "buy this and
find out". Just courteous and HELPFUL answers.
It is refreshing to find a site that really cares about their products and
stands behind them!
And their products perform as they promote them. John L. |
 When I received my ASP.NET E-Commerce application it was for the purpose of marketing my software inventory via the internet. It took a minimal amount of time to launch it and offers host of traffic tracking options for further market study and analysis. Overall an excellent product.
Richard G.
|
|
|
|
|
|
|
|
|