Saturday, January 11, 2014

Program – Saving Text Of Error Lines

Now that two minor problems found during testing have been corrected, the next step in changing the program loading process is to handle lines with errors when loading the program.  This is accomplished by saving the text of the line with an error in the line information array (which also contains the offset into the program code, the code size, and error index if any of the line).

When a line has an error, the text of the line is stored in the new text variable in the line information for the line.  This variable is cleared when a line does not have an error.  Now, when the text of a line is requested (by the edit box when processing a program change signal), if the line has an error, this text is returned instead of recreating the code for the line (since there is no code for the line).

When a line is changed or inserted and the line has an error, a program change signal is no longer emitted.  Only the edit box changes and it already has the text of lines inserted with an error.  However, when a line is appended, a program change signal is always emitted regardless of whether it has an error (lines will only be appended during loading and the edit box will need the text for all lines including those with errors).

The program changed slot of the edit box class was modified to no longer check for lines with errors (by checking if the line text string was null) because the program unit attached no longer sends signals for lines with errors (if the change originated from the edit box).

[commit 4a110b2735]

No comments:

Post a Comment

All comments and feedback welcomed, whether positive or negative.
(Anonymous comments are allowed, but comments with URL links or unrelated comments will be removed.)