i've the following code and I want to call in the first function the ParserHelper method without instantiating an object (Form1 f=new Form1() ), how to do that?? The declaration of ParserHelper is as follows:
public String ParserHelper (String fileName, String num, String headers)
I tried making it static and then calling it but it gave me errors. So how shud i do it correctly??
Code:namespace HL7Convert { /// <summary> /// Summary description for Converter. /// </summary> class HL7Convert { class HL7Viewer { public String Parser(String fName, String fNum, String header) { Form1 f=new Form1(); return (f.ParserHelper(fName,fNum, header)); } } public String HL7 (String fileName, String fileNumber, String headers) { HL7Viewer c = new HL7Viewer(); return c.Parser(fileName, fileNumber, headers); } public static void Main() { String text; HL7Convert ct= new HL7Convert(); text=ct.HL7("test.txt","324", "st tt "); Console.WriteLine(text); Console.ReadLine(); } } }




Reply With Quote