Solved

Is ther an Uutoincrement operator

Posted on 2000-05-15
6
149 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
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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

773 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