I managed to fix dim(54 so that it isn't buggy when reading the last database entry (or last line in a program). Pretty much, here is what dim(54 does...
Because it is easier to understand, I will use the example of reading a line in a program. Newlines are the token 3Fh or 63 in decimal. Setting the line byte as 63 will thus let you read lines in a program. If you try to read line 1, you will get the first line, 2 reads the second, et cetera. Before, since it wasn't exactly designed to read lines in programs, it needed a line token at the end of the file. Also, there was no protection against reading past the file.
Now, the command is fixed up so that if you try to read past the file, you get the last line
and you do not need to waste a byte by putting a line token at the end.
In case anybody is curious:
41 is the space token (so you can read between spaces). This is useful if you need to separate words in a sentence
63 is the newline token. Useful for reading lines in a program
88 is the token for X which is useful for equations, maybe
For others, you can use
dim(66, to get the value for a token