Click here to Skip to main content
15,914,066 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to implement a ReceiveCallback function??? Pin
Stefan Troschuetz3-Oct-06 21:14
Stefan Troschuetz3-Oct-06 21:14 
GeneralRe: How to implement a ReceiveCallback function??? Pin
CTaylor894-Oct-06 8:45
CTaylor894-Oct-06 8:45 
AnswerRe: remoting in c# Pin
LongRange.Shooter4-Oct-06 7:13
LongRange.Shooter4-Oct-06 7:13 
QuestionUnit Testing Pin
Jamie Nordmeyer3-Oct-06 12:56
Jamie Nordmeyer3-Oct-06 12:56 
AnswerRe: Unit Testing Pin
LongRange.Shooter4-Oct-06 7:15
LongRange.Shooter4-Oct-06 7:15 
GeneralRe: Unit Testing Pin
Jamie Nordmeyer4-Oct-06 7:17
Jamie Nordmeyer4-Oct-06 7:17 
QuestionPath of a current process? Pin
sundar1563-Oct-06 12:47
sundar1563-Oct-06 12:47 
AnswerRe: Path of a current process? Pin
User 66583-Oct-06 13:03
User 66583-Oct-06 13:03 
Questionbold and italic Pin
mostafasafy3-Oct-06 10:09
mostafasafy3-Oct-06 10:09 
AnswerRe: bold and italic Pin
Nader Elshehabi3-Oct-06 10:25
Nader Elshehabi3-Oct-06 10:25 
QuestionMODI Error Pin
smarttom993-Oct-06 9:30
smarttom993-Oct-06 9:30 
AnswerRe: MODI Error Pin
Nader Elshehabi3-Oct-06 9:39
Nader Elshehabi3-Oct-06 9:39 
QuestionWriting redirected output from an unmanaged executable to a windows form control Pin
erikash3-Oct-06 7:54
erikash3-Oct-06 7:54 
AnswerRe: Writing redirected output from an unmanaged executable to a windows form control Pin
led mike3-Oct-06 8:39
led mike3-Oct-06 8:39 
GeneralRe: Writing redirected output from an unmanaged executable to a windows form control Pin
erikash3-Oct-06 9:30
erikash3-Oct-06 9:30 
QuestionRe: Writing redirected output from an unmanaged executable to a windows form control Pin
erikash3-Oct-06 11:40
erikash3-Oct-06 11:40 
QuestionObject array question Pin
T.Willey3-Oct-06 7:21
T.Willey3-Oct-06 7:21 
I am sorting an array of object arrays (string,int). It will work fine is the string is only one character long, but if it is two it will error. I'm not sure why or how it errors. I have done some testing, but still don't understand how to fix it. Any help is appreciated. Thanks in advance.

private object[,] SortByFirst (object[,] RevAr) {
object[,] NewAr = new object[3,2];
for (int i = 0; i < (RevAr.Length / 2); ++i) {
int NewArLoc = (RevAr.Length / 2);
--NewArLoc;
string TestStr = RevAr[i,0].ToString();
for (int j = 0; j < (RevAr.Length / 2); ++j) {
if (i != j) {
string tempStr = RevAr[j,0].ToString();
int intTest = string.Compare(TestStr, tempStr, true);
if (TestStr.Length < tempStr.Length || (intTest < 0 && tempStr != "")) {
--NewArLoc;
}
}
}
NewAr[NewArLoc,0] = RevAr[i,0];
NewAr[NewArLoc,1] = RevAr[i,1];
}
//MessageBox.Show (NewAr[0,0].ToString() + NewAr[0,1].ToString() + "\n" + NewAr[1,0].ToString() + NewAr[1,1].ToString() + "\n" + NewAr[2,0].ToString() + NewAr[2,1].ToString());
//MessageBox.Show (NewAr[2,0].ToString());
return NewAr;
}

The inital array could look like
{ {"A",0} {"C",6} {"B",12} }
This array would work, and would be returned like
{ {"A",0} {"B",12} {"C",6} }

ps. I don't know how to post code correctly still, so sorry for the way my post looks.

Tim
AnswerRe: Object array question Pin
Guffa3-Oct-06 8:41
Guffa3-Oct-06 8:41 
GeneralRe: Object array question Pin
T.Willey3-Oct-06 9:13
T.Willey3-Oct-06 9:13 
AnswerRe: Object array question Pin
Guffa3-Oct-06 9:47
Guffa3-Oct-06 9:47 
GeneralRe: Object array question Pin
T.Willey3-Oct-06 9:59
T.Willey3-Oct-06 9:59 
GeneralRe: Object array question Pin
T.Willey3-Oct-06 12:01
T.Willey3-Oct-06 12:01 
AnswerRe: Object array question Pin
Guffa3-Oct-06 12:29
Guffa3-Oct-06 12:29 
GeneralRe: Object array question Pin
T.Willey3-Oct-06 13:08
T.Willey3-Oct-06 13:08 
QuestionRestore value on exit Pin
peterchen3-Oct-06 6:46
peterchen3-Oct-06 6:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.