[Mono-list] hello.cs

Everaldo Canuto everaldo_canuto@yahoo.com.br
Mon, 11 Oct 2004 15:08:20 -0300 (ART)


--0-1817433888-1097518100=:38094
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Line 6 has sintax error:
 

>      public class Hello

>      }

 

the corret is:

>      public class Hello

>      {

 

Your braces are inverted :)

 

Everaldo.

 
 


Amrit Kohli <amrit@wayne.edu> wrote:

Hello,

 

I am new to the mono development platform.  I found an article that illustrates how to write a simple “hello world” type of program in C#.  However, on my system (a windows 2000 box), the simple program does not compile.  Here is what the simple program looks like:

 

using System;

 

namespace HelloNameSpace

{

      public class Hello

      }

            static void Main(string[] args)

            {

                  Console.WriteLine("What we think, we become.");

            }

      }

}

 

The compiler gives me the following error message:

 

syntax error, got token `CLOSE_BRACE', expecting OPEN_BRACE COLON

hello.cs(6) error CS8025: Parsing error

Compilation failed: 1 error(s), 0 warnings

 

I am using mono v1.0.2 for windows.

 

What am I missing?

 

Thanks,

 

Amrit

----

Amrit Kohli

amrit@wayne.edu

 


		
---------------------------------
Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora!
--0-1817433888-1097518100=:38094
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

<DIV>Line 6 has sintax error:</DIV>
<DIV>&nbsp;</DIV>
<DIV>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public class Hello</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">the corret is:</SPAN></FONT></P><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public class Hello</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</SPAN></FONT></P></SPAN></FONT>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">Your braces are inverted :)</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">Everaldo.</SPAN></FONT></P></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR><BR><B><I>Amrit Kohli &lt;amrit@wayne.edu&gt;</I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<META content="Microsoft Word 10 (filtered)" name=Generator>
<STYLE>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:10.0pt;
	font-family:"Courier New";}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;}
p.Quotation, li.Quotation, div.Quotation
	{margin-top:6.0pt;
	margin-right:.7in;
	margin-bottom:6.0pt;
	margin-left:.7in;
	font-size:10.0pt;
	font-family:"Courier New";}
span.EmailStyle18
	{font-family:"Courier New";
	color:windowtext;
	font-weight:normal;
	font-style:normal;
	text-decoration:none none;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
	{page:Section1;}
-->
</STYLE>

<DIV class=Section1>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">Hello,</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">I am new to the mono development platform.&nbsp; I found an article that illustrates how to write a simple “hello world” type of program in C#.&nbsp; However, on my system (a windows 2000 box), the simple program does not compile.&nbsp; Here is what the simple program looks like:</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">using System;</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">namespace HelloNameSpace</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">{</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public class Hello</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; static void </SPAN></FONT>Main(string[] args)</P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Console.WriteLine("What we think, we become.");</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">}</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">The compiler gives me the following error message:</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">syntax error, got token `CLOSE_BRACE', expecting OPEN_BRACE COLON</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">hello.cs(6) error CS8025: Parsing error</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">Compilation failed: 1 error(s), 0 warnings</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">I am using mono v1.0.2 for windows.</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">What am I missing?</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">Thanks,</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt"></SPAN></FONT>&nbsp;</P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">Amrit</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">----</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">Amrit Kohli</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt">amrit@wayne.edu</SPAN></FONT></P>
<P class=MsoNormal><FONT face="Courier New" size=2><SPAN style="FONT-SIZE: 10pt"></SPAN></FONT>&nbsp;</P></DIV></BLOCKQUOTE><p>
		<hr size=1><a href="http://br.rd.yahoo.com/mail/taglines/*http://br.acesso.yahoo.com/">Yahoo! Acesso Grátis</a> - Internet rápida e grátis. Instale o discador agora!
--0-1817433888-1097518100=:38094--