Aug 16, 2003 #1 C 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!
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!
Aug 16, 2003 #2 Robby Moderator Joined Nov 17, 2002 Messages 3,461 Location Montreal, Ca. User Rank *Expert* I dont see it as a good idea. why not do this... x +=1
Aug 16, 2003 #3 PlausiblyDamp Administrator Joined Sep 4, 2002 Messages 6,155 Location Lancashire, UK User Rank *Expert* 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 ?
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 ?
Aug 16, 2003 #4 C cloud Member Joined Aug 14, 2003 Messages 12 Yeah, x += 1 is a good practice.. Why dont u use x = x+1? Are u looking for something recursive?
Aug 16, 2003 #5 C Cyrus Member Joined Jul 25, 2003 Messages 11 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: Aug 16, 2003
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?