Increment?

Cyrus

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

I don't want to use
Visual Basic:
x =x + 1
anymore :)

Is it a good idea (performance?) to write a function like
Visual Basic:
   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 wouldn't be any different (hopefully).

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

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

Visual Basic:
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:
Back
Top