home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2001 November / Gamestar_34_2001-11_cd1.bin / PATCHE / colobotpatch17e.exe / english / help / cbot / extern.txt < prev    next >
Text File  |  2001-09-05  |  728b  |  31 lines

  1. \b;Instruction \c;extern\n;
  2. The instruction \c;extern\n; determines which is the procedure which acts as main program. Declared procedure will have its name in the list of programs, below to the left of the window.
  3. \c;
  4. \s;extern void object::Boum( )
  5. \s;{
  6. \s;    while ( true )
  7. \s;    {
  8. \s;        fire(1);
  9. \s;        turn(10);
  10. \s;    }
  11. \s;}
  12. \n;
  13. If the program use other procedures, only main procedure must be preceded with \c;extern\n;.
  14. \c;
  15. \s;extern void object::Square( )
  16. \s;{
  17. \s;    for ( int i=0 ; i<4 ; i++ )
  18. \s;    {
  19. \s;        Line(10);
  20. \s;    }
  21. \s;}
  22. \s;
  23. \s;void object::Line(float dist)
  24. \s;{
  25. \s;    move(dist);
  26. \s;    turn(90);
  27. \s;}
  28. \n;
  29. \t;See also
  30. \l;Programming\u cbot;, \l;types\u cbot\type; and \l;categories\u cbot\category;.
  31.