Hi Gurus,

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
     ? "Catching 1"
     ? "Throwing 2, should be deferred until finally 1 is finished."
     throw(2)
    finally
     ? "Finally 1"
    end
    ? "Oops 1"
  catch
    ? "Catching 2"
    ? "Returning, should be deferred until finally 2 is finished."
  finally
    ? "Finally 2"
  end
  ? "Oops 2"
RETURN
*--- stop here ---

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'"


By the way, Is it ok to just use throw like throw() - without any arguments?

Thanks,
Ed

-- 
View this message in context: 
http://www.nabble.com/What-is-wrong-with-the-following-code-tp17550739p17550739.html
Sent from the Harbour - Dev mailing list archive at Nabble.com.

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

Reply via email to