Solved

Generic Classes question

Posted on 2007-04-07
1
195 Views
Last Modified: 2013-11-07
Hi experts,
I wanted to build a sorted list structure something like the generic SortedList class in C# but I am not able to change the value of an element after Add()ing it (since it is readonly property). I need to read the value, sum it and write back, as I do not know its final value when I Add() it to the structure.
Is there a way to over come this limitation?
0
Comment
Question by:novknow
1 Comment
 
LVL 5

Accepted Solution

by:
Yttribium earned 500 total points
ID: 18872131
How are you using the sorted list, do you have an example?

When I did:

SortedList SL = new SortedList();
SL.Add("Obj1", 1);      
SL.Add("Obj2", 2);
SL.Add("Obj3", 3);
SL.Add("Obj4", 4);
SL["Obj1"] = 2;
MessageBox.Show(SL["Obj1"].ToString());

I didn't get a problem, probably I misunderstand your usage.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

746 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

11 Experts available now in Live!

Get 1:1 Help Now