| View previous topic :: View next topic |
| Author |
Message |
uber.munkee
Joined: Sun Jul 26, 2009 3:27 am Posts: 3 Location: The Sprawl
|
Posted: Mon Apr 05, 2010 4:15 pm Post subject: Coding Academy n00b |
|
|
Hi all,
I've tried a few times to really get stuck in to the Coding Academy projects but I can't get past the first one. I follow the tutorial to the letter but having never coded before I'm not sure what I'm doing wrong.
This is my code:
using System;
using System.IO;
namespace ToDoList
{
class MainClass
{
public static void Main (string[] args)
{
var contents = File.ReadAllText("todo.txt");
foreach (var arg in args) {
Console.WriteLine(arg);
}
}
}
This is as far as I get. If I try this on my own distro, when I press F8 it comes up with an error
Expected '}' (CS1513)
When I try it running the LiveCD and I press F8 I get
Parsing error(CS8025)
Would be grateful for any advice. |
|
| Back to top |
|
 |
towy71 Moderator

Joined: Wed Apr 06, 2005 3:11 pm Posts: 4169 Location: wild West Wales
|
Posted: Mon Apr 05, 2010 4:51 pm Post subject: |
|
|
count the number of opening brackets and closing brackets, they always have to be in pairs  _________________ still looking for that door into summer |
|
| Back to top |
|
 |
Ram LXF regular

Joined: Thu Apr 07, 2005 10:44 pm Posts: 1550 Location: Guisborough
|
Posted: Mon Apr 05, 2010 9:20 pm Post subject: |
|
|
As towy say's { come in pairs
Try this code.
| Code: |
using System;
using System.IO;
namespace ToDoList
{
class MainClass
{
public static void Main (string[] args)
{
var contents = File.ReadAllText("todo.txt");
foreach (var arg in args) {
Console.WriteLine(arg);
}
}
}
}
|
Normally, if you have a syntax error in your code when using MonoDevelop you'll have a red wriggly line under it. _________________
Ubuntu LXDE 12.04 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
|
|
| Back to top |
|
 |
| View previous topic :: View next topic |
|