13.07.2015 Views

Turbo Basic

Turbo Basic

Turbo Basic

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ERL, ERR/unctionsFunctionSyntaxRemarksDifferencesSee AlsoExampleERL and ERR return the line and error code of the most recenterror.y = ERLy = ERRERL returns the line number of the most recent error. If the erroroccurs in a statement without a line number, ERL returns the numberof the nearest numbered line, working backward toward thebeginning of the program. If there are no numbered lines b~tweenthe point of the error and the start of the program, ERL retumsO.ERR returns the number of the most recent run-time error. Testit in error-trapping subroutines to execute code appropriate to thetype of error that occurred.Note: The ERL, RESUME, and RESUME NEXT statementscause the compiler to generate a 4-byte pointer for each statementin a program. Therefore, programmers concerned with the size oftheir generated code should take note. Using RESUME [Line #]generates a single jump .instruction. ERL is normally used fordebugging purposes so it is probably of little concern.The rules concerning which side of a relational operator a line numbercompared to ERL should be on are not applicable to <strong>Turbo</strong><strong>Basic</strong>. This is because <strong>Turbo</strong> <strong>Basic</strong> does not have a RENUMinstruction. Also, the result of Interpretive BASIC's ERL when anerror occurs during the execution of a DIRECT MODE statementis not applicable in <strong>Turbo</strong> <strong>Basic</strong>.ERADRERRORON ERROR' set up a run-time error handlingON ERROR GOTO TrapDIM X%(10)FOR 1% = 1 TO 1040 READ X%(I%)PRINT X%(I%):NEXT 1%I, Read X ten times, with only 7 data items,returns out-of-data error200<strong>Turbo</strong> <strong>Basic</strong> Owner's Handbook

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!