S
steve smith
Hi I have just downloaded the Borland C# Builder and the Micorsoft
..Net framework SDK v1.1 from the borland webist, and i am trying to
get a simple program to run, however I keep getting errors, any ideas
why this might be happening?
Program i am running is:
namespace ExamProblem
{
using System;
using System.IO;
using System.Collections;
class Start
{
[STAThread]
static void Main(string[] args)
{
Parser.ParseFile("c:/input.txt", "c:/output.txt");
}
}
class Parser
{
System.IO.TextReader r = System.IO.File.OpenText(@"C:\input.txt");
int x;
string s = r. ReadToEnd();
string[] mySplit = new string[3000];
/* char[] splitter = {' '};
arInfo = s.Split(splitter); */
string[] mySplit = s.Split(' ');
for(int x = 0; x < mySplit.Length; x++)
{
Console.WriteLine(mySplit[x] + "<br>");
}
r.Close();
}
}
Errors i get are:
[C# Error] sage.cs(30): Invalid token 'for' in class, struct, or
interface member declaration
[C# Error] sage.cs(30): Invalid token '<' in class, struct, or
interface member declaration
[C# Error] sage.cs(30): Invalid token ';' in class, struct, or
interface member declaration
[C# Error] sage.cs(30): Invalid token '++' in class, struct, or
interface member declaration
etc, any ideas what this mite be? Thanks.
..Net framework SDK v1.1 from the borland webist, and i am trying to
get a simple program to run, however I keep getting errors, any ideas
why this might be happening?
Program i am running is:
namespace ExamProblem
{
using System;
using System.IO;
using System.Collections;
class Start
{
[STAThread]
static void Main(string[] args)
{
Parser.ParseFile("c:/input.txt", "c:/output.txt");
}
}
class Parser
{
System.IO.TextReader r = System.IO.File.OpenText(@"C:\input.txt");
int x;
string s = r. ReadToEnd();
string[] mySplit = new string[3000];
/* char[] splitter = {' '};
arInfo = s.Split(splitter); */
string[] mySplit = s.Split(' ');
for(int x = 0; x < mySplit.Length; x++)
{
Console.WriteLine(mySplit[x] + "<br>");
}
r.Close();
}
}
Errors i get are:
[C# Error] sage.cs(30): Invalid token 'for' in class, struct, or
interface member declaration
[C# Error] sage.cs(30): Invalid token '<' in class, struct, or
interface member declaration
[C# Error] sage.cs(30): Invalid token ';' in class, struct, or
interface member declaration
[C# Error] sage.cs(30): Invalid token '++' in class, struct, or
interface member declaration
etc, any ideas what this mite be? Thanks.