Game Development Community

Chapter two Hello world program

by Christos Tzeremes · in Torque Game Engine · 09/27/2004 (1:11 pm) · 5 replies

Hey guys. Im new to the forums and I got this book because I was getting started with a project using the torque engine. I have no previous knowledge of programming but I am learning as fast as I can. I bought this book to help me out (along with some others) and I have some questions.

In chapter two I wrote down exactly the program it says in the book but when I run it it doesn't print Hello World. I know this is a small program but I dont want to start off on the wrong foot.

I typed

Function main()
//--------------------------------------------------------------
// Entry point for the program
//--------------------------------------------------------------
{
print("Hello World");
}

And the error message in the console log Im getting says this

HelloWorld.cs
Compiling CH2/HelloWorld.cs...
CH2/HelloWorld.cs Line: 8 - Syntax error.
>>> Advanced script error report. Line 15.
>>> Some error context, with ## on sides of error halt:
//==============================================================



Function main(##)##

//--------------------------------------------------------------
>>> Error report complete.


Does anyone know what is wrong? Or is it my stupidity? Thanks for any help.

About the author

Recent Threads


#1
09/27/2004 (1:24 pm)
Ok ok ok...i got it....function should be lower case....hahaha...im such a noob...haha
#2
09/27/2004 (1:24 pm)
What is on lines 8 and 15? The code you posted has only 7 lines.

In the book, the code is longer (there are additional comments), but even that doesn't have 15 lines. Line 8 in that is the "function main()" statement.
#3
09/27/2004 (1:25 pm)
Yeah I left out the opening comments...sorry. I didnt realize I had to put the whole thing in. Please excuse my mistake.
#4
09/27/2004 (1:28 pm)
Well, strictly speaking, you don't need the additional comments, but including them is a good habit to get into.
#5
09/27/2004 (1:34 pm)
Ok ill remember that in the future. Thanks