Link to home
Start Free TrialLog in
Avatar of campbe07
campbe07

asked on

newbie strugglin with a collection

Public Structure mystruct
      Dim nums as collection
End Structure

Dim a as mystruct
a.nums = new collection
dim x as integer, y as integer

x=1
y=5
Do while x<= 6
     a.nums.add(y)
     x = x+1
    y = y * 2
Loop

I'm tryin to find the value of a.nums.item(3).  Please help
Avatar of Dabas
Dabas
Flag of Australia image

Hi campbe07,
I do not see what the problem is
a.nums.item(3) gives a value of 20, when I run your program. Where exactly is your problem?

Dabas
ASKER CERTIFIED SOLUTION
Avatar of Arthur_Wood
Arthur_Wood
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
by the way, for future note, this is, BY NO STRETCH OF THE IMAGNINATION, a 500 point question, and Yes, I meant to YELL.  This is barely a 20 point question - it is so basic and fundamental.

Just because you have 'unlimited' points, does not mean that you show throw them around like confetti.  The Unlimited points has lead to a horrible distortion of the points system - it is Gresham's law, all over again.

AW
What is Gresham's law?
Dabas>> Google it- basically, it is a law of economics, that says "Bad money drives out the Good" - when paper money is plentiful, hard currency disappears (people tend to horde it, since hard currency has 'real value, where paper money has values purely based on trust).  That is what leads to inflation, and in the extreme case, Hyper-inflation.  That is what has happened to the points system, with the introduction of the Premium membership, which carries with it UNLIMITED points, so people start offering 500 points for a very basic, beginner level question - after all, points have no value when you have an unlimited supply, so what 'difference' does it make if I offer 20 points or 500 since I have an unlimited supply, 20 is the same as 500, or 5000 (if 5000 points could be offered for a question).

Dabas>> here is the wikipedia link:

http://en.wikipedia.org/wiki/Gresham's_Law

AW
Thanks

Point taken. Although I do not often see 25 pt questions offered at 500.
This is campbe07's first question anyhow.

As to the introduction of the Premium membership "inflating" the points system, I am not sure if it has.
There are non Premium membership members that ask 50 point questions that require a 500 point answer.
And I have seen you spending a considerable amount of your time answering them nevertheless.
In the end, from the owners of experts-exchange point of view, I assume the system as is now, brings them in the most $$$$. That probably is what is important to me.
I do prefer to answer 500 poiint questions to get to my monthly 3000 (do not have much time for EE nowadays). Once I am over the 3000 and have time to spare, I do not really care how much points was allocated to the question
From my point of view, the search engine provides me a very resourceful reference to answer many questions. I look at the title and contents of the search results, very seldom at the point value given. In the pre-Premium membership times the value of the search engine was less, as there were less questions and answers.

From a fairness point of view, you are absolutely right! Life is not fair, that is a fact.

Dabas