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

C#

 
GeneralRe: Sorting Array of objects [modified] Pin
Robert Rohde23-May-06 7:43
Robert Rohde23-May-06 7:43 
GeneralRe: Sorting Array of objects [modified] Pin
Rizwan Rathore23-May-06 14:29
Rizwan Rathore23-May-06 14:29 
GeneralRe: Sorting Array of objects [modified] Pin
Robert Rohde23-May-06 19:44
Robert Rohde23-May-06 19:44 
GeneralRe: Sorting Array of objects [modified] Pin
Rizwan Rathore23-May-06 22:09
Rizwan Rathore23-May-06 22:09 
GeneralRe: Sorting Array of objects [modified] Pin
Robert Rohde23-May-06 22:24
Robert Rohde23-May-06 22:24 
GeneralRe: Sorting Array of objects [modified] Pin
Rizwan Rathore23-May-06 23:05
Rizwan Rathore23-May-06 23:05 
GeneralRe: Sorting Array of objects [modified] Pin
Robert Rohde23-May-06 23:13
Robert Rohde23-May-06 23:13 
GeneralRe: Sorting Array of objects [modified] Pin
Rizwan Rathore23-May-06 23:40
Rizwan Rathore23-May-06 23:40 
public class Terminology : IComparable
{                
        private string term;
	private int df;
	private int qTf;
	private double qWeight;
	private ArrayList tf = new ArrayList();
	private ArrayList position= new ArrayList();
	private ArrayList docID= new ArrayList();
	private static int Count;

        public int CompareTo(object obj)
	{
		Terminology w = (Terminology) obj;
		return( w.term.CompareTo( w.term ));
	}

//only method in this class other than properties and constructors 
        public void incDF()
	{
		df++;
	}
}


now moving to TextMiner class

public class TextMiner : System.Windows.Forms.Form , IComparable
{
const int WORDS = 20000;
public Terminology[] word = new Terminology[WORDS];
public void Indexer()
{
Array.Sort(word);
}
private string strValue = "term";
public int CompareTo(object obj)
{
	Terminology w = (Terminology) obj;
	return( strValue.CompareTo( w.term ));
}
}



it gives this exception
An unhandled exception of type 'System.NullReferenceException' occurred in 2ndAssignment.exe

Additional information: Object reference not set to an instance of an object.

and on this statement

for(int j = 0; j < Terminology.count-1; j++)
{
	sw.Write(j+1 +"\t"+word[j].term.PadRight(20,' '));
}


and the exceptions comes when the value of j is 0....m really confused Frown | :(
looking forward for help
Regards,

-- modified at 5:43 Wednesday 24th May, 2006
GeneralRe: Sorting Array of objects [modified] Pin
Robert Rohde24-May-06 0:12
Robert Rohde24-May-06 0:12 
GeneralRe: Sorting Array of objects [modified] Pin
Rizwan Rathore24-May-06 0:54
Rizwan Rathore24-May-06 0:54 
AnswerRe: Sorting Array of objects Pin
BoneSoft23-May-06 4:20
BoneSoft23-May-06 4:20 
GeneralRe: Sorting Array of objects Pin
Rizwan Rathore23-May-06 14:11
Rizwan Rathore23-May-06 14:11 
GeneralRe: Sorting Array of objects Pin
BoneSoft23-May-06 15:10
BoneSoft23-May-06 15:10 
GeneralRe: Sorting Array of objects Pin
Robert Rohde23-May-06 19:42
Robert Rohde23-May-06 19:42 
GeneralRe: Sorting Array of objects Pin
BoneSoft24-May-06 1:31
BoneSoft24-May-06 1:31 
GeneralRe: Sorting Array of objects Pin
Rizwan Rathore23-May-06 21:13
Rizwan Rathore23-May-06 21:13 
QuestionNovell GroupWise Pin
NewbieDude22-May-06 23:32
NewbieDude22-May-06 23:32 
QuestionListView.ShowGroups=TRUE [modified] Pin
Greeky22-May-06 23:21
Greeky22-May-06 23:21 
QuestionProblems with HDC Pin
__makaveli__22-May-06 23:16
__makaveli__22-May-06 23:16 
QuestionHow to view a Flash file in C# Pin
nps_ltv22-May-06 23:12
nps_ltv22-May-06 23:12 
AnswerRe: How to view a Flash file in C# Pin
Saqib Mehmood23-May-06 1:57
Saqib Mehmood23-May-06 1:57 
GeneralRe: How to view a Flash file in C# Pin
nps_ltv25-May-06 0:22
nps_ltv25-May-06 0:22 
GeneralRe: How to view a Flash file in C# Pin
Saqib Mehmood25-May-06 0:40
Saqib Mehmood25-May-06 0:40 
Questionset tile ,author name to image in c# Pin
sreesiri22-May-06 23:00
sreesiri22-May-06 23:00 
AnswerRe: set tile ,author name to image in c# Pin
stancrm22-May-06 23:27
stancrm22-May-06 23:27 

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.