home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2001 November / Gamestar_34_2001-11_cd1.bin / PATCHE / colobotpatch17e.exe / english / help / cbot / errmode.txt < prev    next >
Text File  |  2001-07-27  |  1KB  |  34 lines

  1. \b;Instruction \c;errmode\n;
  2. The \c;errmode();\n; instruction allows you to chose if the program should stop when an error occurs in one of the following instructions: \c;\l;goto\u cbot\goto;\n;, \c;\l;move\u cbot\move;\n;, \c;\l;grab\u cbot\grab;\n;, \c;\l;drop\u cbot\drop;\n;, etc.
  3.  
  4. \b;For specialists
  5. Syntaxª:
  6. \s;\c;errmode ( mode );\n;
  7.  
  8. Normally the program is stopped when an error occurs. If you use the instruction \c;errmode(0);\n; at the beginning of the program, the instructions listed above return a value different from zero if the instruction could not be performed.
  9.  
  10. \t;mode: \c;\l;float\u cbot\float;\n; (\c;1\n; per default)
  11. Error treatment mode.
  12. \c;0\n; -> continues program execution and returns a non zero value
  13. \c;1\n; -> stops the program (default behavior)
  14.  
  15. Exemple 1ª:
  16. \s;\c;errmode(0);
  17. \s;while ( goto(pos) != 0 )
  18. \s;{
  19. \s;    wait(2);
  20. \s;}
  21. \n;
  22. Exemple 2ª:
  23. \s;\c;errmode(0);
  24. \s;int err;
  25. \s;err = goto(pos);
  26. \s;if ( err != 0 )
  27. \s;{
  28. \s;    \n;goto did not perform correctly ...\c;
  29. \s;    \n;take some appropriate action ...\c;
  30. \s;}
  31. \n;
  32. \t;See also
  33. \l;Programming\u cbot;, \l;types\u cbot\type; and \l;categories\u cbot\category;.
  34.