Solved

Is ther an Uutoincrement operator

Posted on 2000-05-15
6
152 Views
Last Modified: 2010-05-02
Coming from the C++ world I  find it strange that there is not an auto increment operator "++" which would be extremely benficial when handling variables with long names.

I was wondering if there is an undocument feature, to enable this.
0
Comment
Question by:SteveHurst
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 18

Accepted Solution

by:
deighton earned 10 total points
ID: 2809949
You could declare a sub

Public Sub inc(ByRef x)

    x = x + 1

End Sub

but then you need to

call inc(c)

inc(c) won't work!
0
 

Expert Comment

by:sergedornseiffer
ID: 2809982
sorry to correct you deighton but you you remove the call and then run the line like following

int c

he will do the same than

call inc(c) but it's less code

This is 'new' since VB4



0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2810692
Genau....
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 1

Expert Comment

by:j3877
ID: 2811321
I don't think that byref axually passes it by reference... I think it just makes a copy of the variable, and sends a referance to the copy to the function... perhaps I'm wrong here...
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2812243
Yep, you are. Byref actually passes it by reference. Honest.
0
 
LVL 10

Expert Comment

by:caraf_g
ID: 2836615
Steve, although I understand your disappointment with VB's failure to offer such functionality, giving deighton a "B" for his answer is not really fair: "don't shoot the messenger"...
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question