Increment?

Cyrus

Member
Joined
Jul 25, 2003
Messages
11
I wonder if there is any way to increment variables?

I dont want to use
Code:
x =x + 1
anymore :)

Is it a good idea (performance?) to write a function like
Code:
   Public Sub Inc(ByRef Data As Integer)
    Data = Data + 1
  End Sub

Thanks for help!
 
The compiler could optimise the call tin Inc() away so performance wouldnt be any different (hopefully).

Is there any reason why you dont want to do the x=x +1 thing.

How about the shorthand of x+=1 ?
 
Yeah, x += 1 is a good practice..
Why dont u use x = x+1?
Are u looking for something recursive?
 
im coming from VB6 and im new to .NET :)
this is what i was looking for!!!

Code:
x += 1

hehe, thank you!

by the way: do you know a good site where VB6 developers can learn about the .NET programming techniques?
 
Last edited by a moderator:
Back
Top