ERROR('');

northernernortherner Member Posts: 67
Can anybody tell me what
ERROR('');

is used for? I see it in standard code occasionally and have no idea what it's there for! An example is in Report 6 - Trial Balance, in the MakeExcelInfo() function:
ExcelBuf.CreateBook;
ExcelBuf.CreateSheet(Text002,Text001,COMPANYNAME,USERID);
ExcelBuf.GiveUserControl;
ERROR('');

Thanks

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    This statement terminates execution, without giving a message to the user.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • northernernortherner Member Posts: 67
    Why use that rather than, for example,
    Exit
    

    or
    CurrReport.Quit
    

    ?
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    ERROR will rollback the current transaction. Don't know if that makes sense in your case.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    ERROR also rolls back any changes made so far in the database.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • ta5ta5 Member Posts: 1,164
    It's only used in very special situations. Normally you want to give an error message to the users.
    Regards
    Thomas
Sign In or Register to comment.