Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question About Classes 1

Status
Not open for further replies.

Edge118

Programmer
Jun 15, 2004
104
US
Code:
Public Month As String

Public Day As String

Public Year As String

Public Hour As String

Public Minute As String

Public Second As String

Public isAM As Boolean

Public Function Display() As String
    Dim NowString As String
    NowString = "Hi"

End Function

How do I return a string in my class's Display function? I was trying Return NowString but that didn't work.

Thanks for the help!

"Pin me. Perl me."

Regards,

Chris
 
To return the string, you need to set the function equal to it. For example:

Public Function Display() As String
Dim NowString As String
NowString = "Hi"

Display = NowString
End Function

~rudejohn

************
RudeJohn
************
 
Edge118,
Why do you use names of the standard VB functions for your public variables?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top