Edmer wrote:
Could you please check what is wrong with the following code:

*--- start here ---
PROCEDURE Main
  try
    ? "Base try 0"
    try
     ? "Trying 1"
     ? "Throwing 1"
     throw(1)
    catch
...

because it throws me the following compile time errors:

TRY5.PRG(2) Error E0020  Incomplete statement or unbalanced delimiters
TRY5.PRG(4) Error E0020  Incomplete statement or unbalanced delimiters
TRY5.PRG(8) Error E0020  Incomplete statement or unbalanced delimiters
TRY5.PRG(12) Error E0020  Incomplete statement or unbalanced delimiters
TRY5.PRG(14) Error E0030  Syntax error: "syntax error at 'END'"
TRY5.PRG(16) Error E0020  Incomplete statement or unbalanced delimiters
TRY5.PRG(19) Error E0020  Incomplete statement or unbalanced delimiters
TRY5.PRG(21) Error E0030  Syntax error: "syntax error at 'END'"

Hi,


#include "hbcompat.ch" is missing. TRY/CATCH is implemented as BEGIN/END SEQUENCE extension in Harbour. The correct xharbour => harbour syntax mapping is:
   #xcommand TRY  => BEGIN SEQUENCE WITH {|oErr| Break( oErr )}
   #xcommand CATCH [<!oErr!>] => RECOVER [USING <oErr>] <-oErr->
   #xcommand FINALLY => ALWAYS


Best regards,
Mindaugas

_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to