| View previous topic :: View next topic |
| Author |
Message |
hedknox
Joined: Sun Jan 28, 2007 12:42 pm Posts: 3
|
Posted: Sun Jan 28, 2007 1:23 pm Post subject: Mono Tutorial - LXF 88 page 97 |
|
|
I've been following the Mono tutorial pretty well so far. I had a problem with the Console.Write call but resolved it when I specified System.Console.Write instead since the tutorial moved from using system to using system.IO.........but thats all beside the point
I'm at the Big Finale stage in the second tutorial LXF 88 page 97. When I replace my existing Main() with the code as specified I get an error at line 21, the last line which is just a closing brace
ie {
The error description is "Expecting `;'(CS1002)" for the file Main.cs
Any ideas what I'm doing wrong here? I'm running Fedora Core 6 on a dell laptop which i built specifically for the tutorial and i've installed all the packages required.
Incidentally FC6 is running way slow on this, Ubuntu ran v quick. |
|
| Back to top |
|
 |
lis

Joined: Thu Nov 30, 2006 1:50 pm Posts: 57 Location: Noord Holland, the Netherlands
|
Posted: Mon Jan 29, 2007 7:08 pm Post subject: |
|
|
If you put all of the code (of the app) here, we might be able to reproduce the errorMessage and give it a try to resolve it.
But at first glance it sounds like a typo.
Lis |
|
| Back to top |
|
 |
hedknox
Joined: Sun Jan 28, 2007 12:42 pm Posts: 3
|
Posted: Wed Jan 31, 2007 10:34 pm Post subject: |
|
|
Heres the code, i'm sure it's just some typo but am brand new to this so it's not obvious to me,.......
// project created on 1/20/2007 at 1:55 AM
using System.IO;
namespace Pipeknot
{
class Pipeknot
{
public static void Main(string[] args)
{
if (args.Length == 0){
string[] files = Directory.GetFiles("/home/rherron","*.txt",
SearchOption.AllDirectories);
File.WriteAllLines("filecache.pipeknot",files);
} else {
string[]cache=File.ReadAllLines("filecache.pipeknot");
foreach(string file in cache){
if (file.Contains(args[0])){
System.Console.Write(File.ReadAllText(file));
}
}
} |
|
| Back to top |
|
 |
hedknox
Joined: Sun Jan 28, 2007 12:42 pm Posts: 3
|
Posted: Wed Jan 31, 2007 10:49 pm Post subject: |
|
|
| Ooops,... I did a quick brace count, added three more in, and guess what,...it worked |
|
| Back to top |
|
 |
Hudzilla Site admin

Joined: Mon Apr 04, 2005 12:52 pm Posts: 265 Location: LXF Towers
|
Posted: Wed Jan 31, 2007 11:47 pm Post subject: |
|
|
Looks like you fixed your own problem - well done!
As a side note, try having "using System;" and "using System.IO;" in the same script, one per line - that will let you go back to using Console.Write rather than System.Console.Write, as well as having the File and Directory classes. |
|
| Back to top |
|
 |
| View previous topic :: View next topic |
|