The following warnings occurred:
Warning [2] Undefined array key 0 - Line: 1677 - File: showthread.php PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/showthread.php 1677 errorHandler->error_callback
/showthread.php 916 buildtree




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Save bug (*solved*)
#14
Darkstar Wrote:
Darkstar Wrote:I have not tried to SAVE with 11 chars.
The original BASIC does not accept the command but comes up with: F Invalid file name, 0:1.

The compiled BASIC accepts the command but truncates the last letter when saved to tape but
I do hope that this does not lead to a buffer overflow of sorts.
Yes, it always truncates to 10 Chars, to be compatible with original Sinclair BASIC, but ZXB could, in fact, allow any length.
The problem is, the more compatible with the original ROM, the more code I have to copy in the asm library (so your program will take more memory).
Darkstar Wrote:When saving with an empty string the original gives error message F while the compiled basic just
falls through to the next executable statement giving no clue at all.

Code:
ERROR_Ok EQU -1 ERROR_SubscriptWrong EQU 2 ERROR_OutOfMemory EQU 3 ERROR_OutOfScreen EQU 4 ERROR_NumberTooBig EQU 5 ERROR_InvalidArg EQU 9 ERROR_IntOutOfRange EQU 10 ERROR_InvalidColour EQU 19 ERROR_BreakIntoProgram EQU 20 ERROR_TapeLoadingErr EQU 26
I've added ERROR_InvalidFileName EQU 14
The program will fail silently, as you said, when saving an empty string, but ERR_NR system variable will be set. And the error will be triggered if you exit to BASIC with that code set (try it, download latest version, 1.3.0s986).
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)