?
Solved

Is ther an Uutoincrement operator

Posted on 2000-05-15
6
Medium Priority
?
154 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 30 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
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…
Suggested Courses
Course of the Month14 days, 5 hours left to enroll

800 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