Hello World
by Louise Cline · in Torque Game Engine · 06/19/2006 (10:16 am) · 5 replies
I am new to programming. I am trying to get the Hello World to work but it keeps giving me the following message:
//-------------------------- 6/19/2006 -- 13:14:25 -----
HelloWorld.cs
Compiling CH2/HelloWorld.cs...
CH2/HelloWorld.cs Line: 12 - Syntax error.
>>> Advanced script error report. Line 23.
>>> Some error context, with ## on sides of error halt:
// ----------------------------------------------------
{
^Print(Hello World)##
##
}
>>> Error report complete.
Executing CH2/HelloWorld.cs.
CH2/HelloWorld.cs Line: 12 - Syntax error.
>>> Advanced script error report. Line 23.
>>> Some error context, with ## on sides of error halt:
// ----------------------------------------------------
{
^Print(Hello World)##
##
}
>>> Error report complete.
CH2/run.cs (30): Unable to find function main
It then puts a HelloWorld.cs.bak file, not a cs.dso file.
Can anyone offer any insight?
//-------------------------- 6/19/2006 -- 13:14:25 -----
HelloWorld.cs
Compiling CH2/HelloWorld.cs...
CH2/HelloWorld.cs Line: 12 - Syntax error.
>>> Advanced script error report. Line 23.
>>> Some error context, with ## on sides of error halt:
// ----------------------------------------------------
{
^Print(Hello World)##
##
}
>>> Error report complete.
Executing CH2/HelloWorld.cs.
CH2/HelloWorld.cs Line: 12 - Syntax error.
>>> Advanced script error report. Line 23.
>>> Some error context, with ## on sides of error halt:
// ----------------------------------------------------
{
^Print(Hello World)##
##
}
>>> Error report complete.
CH2/run.cs (30): Unable to find function main
It then puts a HelloWorld.cs.bak file, not a cs.dso file.
Can anyone offer any insight?
#2
I am now getting this error.
//-------------------------- 6/19/2006 -- 13:32:38 -----
HelloWorld.cs
Compiling CH2/HelloWorld.cs...
CH2/HelloWorld.cs Line: 12 - Syntax error.
>>> Advanced script error report. Line 23.
>>> Some error context, with ## on sides of error halt:
// ----------------------------------------------------
{
^"Print("Hello ##W##orld");"
}
>>> Error report complete.
Executing CH2/HelloWorld.cs.
CH2/HelloWorld.cs Line: 12 - Syntax error.
>>> Advanced script error report. Line 23.
>>> Some error context, with ## on sides of error halt:
// ----------------------------------------------------
{
^"Print("Hello ##W##orld");"
}
>>> Error report complete.
CH2/run.cs (30): Unable to find function main
This is my Hello World cs file if it helps.
// ========================================================================
// HelloWorld.cs
//
// This module is a program that prints a simple greeting on the screen.
// ========================================================================
function main()
// ----------------------------------------------------
// Entry point for the program.
// ----------------------------------------------------
{
"Print("Hello World");"
}
06/19/2006 (10:35 am)
Thanks Tom,I am now getting this error.
//-------------------------- 6/19/2006 -- 13:32:38 -----
HelloWorld.cs
Compiling CH2/HelloWorld.cs...
CH2/HelloWorld.cs Line: 12 - Syntax error.
>>> Advanced script error report. Line 23.
>>> Some error context, with ## on sides of error halt:
// ----------------------------------------------------
{
^"Print("Hello ##W##orld");"
}
>>> Error report complete.
Executing CH2/HelloWorld.cs.
CH2/HelloWorld.cs Line: 12 - Syntax error.
>>> Advanced script error report. Line 23.
>>> Some error context, with ## on sides of error halt:
// ----------------------------------------------------
{
^"Print("Hello ##W##orld");"
}
>>> Error report complete.
CH2/run.cs (30): Unable to find function main
This is my Hello World cs file if it helps.
// ========================================================================
// HelloWorld.cs
//
// This module is a program that prints a simple greeting on the screen.
// ========================================================================
function main()
// ----------------------------------------------------
// Entry point for the program.
// ----------------------------------------------------
{
"Print("Hello World");"
}
#3
On console, type:
06/19/2006 (10:39 am)
Try this:function main()
// ----------------------------------------------------
// Entry point for the program.
// ----------------------------------------------------
{
echo("Hello World");
}On console, type:
main();
#4
Or follow Gustavo's advice. :)
06/19/2006 (10:53 am)
You should remove the "" from around the print() function too.Or follow Gustavo's advice. :)
#5
Thanks for the help,
06/19/2006 (11:00 am)
I uninstalled and reinstalled the program. I then Copied and pasted the HelloWorld.cs off of the cd. This seemed to work.Thanks for the help,
Torque Owner Tom Bushby
- Tom.