| NedoPC Project | NedoPC Forum | NedoPC Group |

Sprinter SDK Documentation


[PREV] : LESSON 1 : [NEXT]

Let's create a simple program in RW1 language. Open 'Sprinter SDK Editor' and type the following text:

 robot "Hello" 
 author "NedoPC" 

 main() 
 { 
  say "HELLO, WORLD!" 
 } 
You can see how simple our Robot program structure is. First, the keyword ROBOT is followed by the program name; then the keyword AUTHOR specifies the name of the program creator. Then, as the last item, the 'main' function body definition is given. The function definition must be placed between curly-braces ( '{' and '}' ).

Some important points:

  • 'main' function must precede any other function definition;
  • 'main' function is actually a loop function, this is, it will restart itself after reaching its final statement;
  • There must be NO SPACES between 'main' and the parenthesis.
  • Strings for the 'say' command should be uppercase, as the current compiler version the used font has no lowercase support;
  • Always add a blank line at the end of the program, otherwise, the compiler could miss and not process it.

Ok, we will now SAVE the source, let's say in projects\hello\hello.rw1, and COMPILE (F8) it. In case the compilation succeeds, we will see a message saying so, and we'll then be able to RUN (F9) the robot (in the RW1 language, PROGRAMS are called ROBOTS).

When successfully run, a console window will open and run the SPRINT emulator, which, in turn will run our compiled program in EXE format (in this case, HELLO.EXE). While at the emulator, we will see the line "HELLO WORLD!", meaning that our robot worked fine.

Once we confirmed that our work of art performed correctly, we can EXIT the SPRINT emulator (F10). Once closed, a little ad of Sprinter will pop up. Click on it to open a browser pointing to Peters Plus website the Sprinter computer manufacturer. If you do not like or want this to happen, please contact us.

[ ONLINE HELP ]


Rambler's Top100
^ Go Up
© 2002-2008 NedoPC.org