Solved

Is ther an Uutoincrement operator

Posted on 2000-05-15
6
146 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

706 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now