Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Coding Academy n00b

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming
View previous topic :: View next topic  
Author Message
uber.munkee



Joined: Sun Jul 26, 2009 3:27 am
Posts: 3
Location: The Sprawl

PostPosted: Mon Apr 05, 2010 4:15 pm    Post subject: Coding Academy n00b Reply with quote

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
View user's profile Send private message
towy71
Moderator


Joined: Wed Apr 06, 2005 3:11 pm
Posts: 4262
Location: wild West Wales

PostPosted: Mon Apr 05, 2010 4:51 pm    Post subject: Reply with quote

count the number of opening brackets and closing brackets, they always have to be in pairs Wink Rolling Eyes
_________________
still looking for that door into summer
Back to top
View user's profile Send private message
Ram
LXF regular


Joined: Thu Apr 07, 2005 10:44 pm
Posts: 1674
Location: Guisborough

PostPosted: Mon Apr 05, 2010 9:20 pm    Post subject: Reply with quote

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.
_________________

lubuntu LXDE 13.10 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
Back to top
View user's profile Send private message MSN Messenger
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast