Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / August 2003



Tip: Looking for answers? Try searching our database.

Returning default value

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Su Man - 27 Aug 2003 13:07 GMT
I have a function IsModified which returns Boolean.

By default is it possible to return the value as True. (like how we specify
default value for parameters Optional Flag as Boolean = True )

Something like below.

Public function IsModified() as Boolean = True

End Sub
Jens Neuhalfen - 27 Aug 2003 13:37 GMT
Hi,

 Public function IsModified  () as Boolean
    IsModified = true

    ...
    if 4711>x then IsModified=false
 End Sub

Jens

> I have a function IsModified which returns Boolean.
>
[quoted text clipped - 6 lines]
>
> End Sub
Adrian Forbes - MVP - 27 Aug 2003 16:52 GMT
Store the value of IsModified in a private var;

private m_IsModified as boolean

Private Sub Class_Initialize()
   m_IsModified = true
End Sub

Public function IsModified() as Boolean
   IsModified = m_IsModified
End Sub

Now if no work is done then IsModified will return true.  
If a method is called that means you want to return false
then update m_IsModified to False.

>-----Original Message-----
>I have a function IsModified which returns Boolean.
[quoted text clipped - 9 lines]
>
>.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.