Cyrus Posted August 16, 2003 Posted August 16, 2003 I wonder if there is any way to increment variables? I don't want to use x =x + 1 anymore :) Is it a good idea (performance?) to write a function like Public Sub Inc(ByRef Data As Integer) Data = Data + 1 End Sub Thanks for help! Quote
Moderators Robby Posted August 16, 2003 Moderators Posted August 16, 2003 I don't see it as a good idea. why not do this... x +=1 Quote Visit...Bassic Software
Administrators PlausiblyDamp Posted August 16, 2003 Administrators Posted August 16, 2003 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 ? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
cloud Posted August 16, 2003 Posted August 16, 2003 Yeah, x += 1 is a good practice.. Why don't u use x = x+1? Are u looking for something recursive? Quote
Cyrus Posted August 16, 2003 Author Posted August 16, 2003 (edited) i'm coming from VB6 and i'm new to .NET :) this is what i was looking for!!! x += 1 hehe, thank you! by the way: do you know a good site where VB6 developers can learn about the .NET programming techniques? Edited August 16, 2003 by Cyrus Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.