News:

;) This forum is the property of Proton software developers

Main Menu

To learn from my mistakes

Started by Dompie, Jun 30, 2021, 03:53 PM

Previous topic - Next topic

Dompie

After a day of troubleshooting, I discovered that the statement HRSOUT "Stupid", (yes, with a comma!) generates errors in very different places than where the error was made. In my situation I got three errors in an include file that is absolutely correct.
After I found (pfffff) and removed the comma in the main program, it compiled flawlessly.
By the way, in the first Dongle free version (3.7.5.5) this comma is not a problem, but from version 4.0.0.x you get an error message.
Perhaps this post will help others to find a problem faster.

Johan

@Les: is a slightly more accurate error message possible?

Here a 3-liner demo:Device 18F26K22
Xtal = 8
HRSOut "Stupid",
Result: ERROR [Line 1]: Item '_PP_FIL' not found
Remove the comma and the program compiles correct.

top204

With the new compilers, I am in the process of making a single comma a line continuation, as well as ",_".

The error message will normally be "Item xxxx not found", because the parser will look on the next line for the next parameter. However, if there is no line below the command, the item is the underlying file segment, such as _PP_FIL".

The Hrsout commands can now use the single comma, and the Print command, as well as Flash memory data tables.


Dompie

Thanks Les, saves a lot of time troubleshooting such a pesty comma

Johan

Dompie

I've been thinking and I believe that with a comma (also) as a line continuation character my problem of finding the error faster remains (maybe it will get even bigger).
But yeah I also have no idea how the compiler could better detect my error. Actually I would like something like: "Line 3 : Statement not complete" or "Line 3 : comma ignored" and so the wrong line is found immediately.
An even simpler solution is that I don't make such mistakes anymore :-)

Johan
BTW I rarely use line continuation.

pjdenyer

#4
I am getting this problem - ERROR [Line 1]: Item '_PP_FIL' not found.

My situtation is with image data where I am using ',_' at the end of each line and nothing on the last line.
My Data is store as $xxxx, $xxxx ...... $xzxx, $xxxx,_ etc..

I have also tried using the {...} method and it does not work either.

Now with an image of 80 x 50 bytes (560 chars per line) the program complies OK
but with an image of 160 x 120 (1120 chars per line) the complie fails with the above error.

Is there a limit of how many charcters can be on one line?

top204

#5
1000 character per line is the limit in the Positron compilers.

It is something I have been meaning to get into for many years now and extend it, but other things have always come in to move it further down the list of "must do" items. It would mean a major overhaul of the compiler's parser and symbol handling lists and arrays, so I will not do it on an whim, because I could easily break it for something that is rarely encountered by users. I thought I had placed an error message for it, but it must be getting bypassed by the pre-processor before the compiler can give the error.

Having huge lines of data is not recommended because the data items cannot be viewed correctly and are not in the format they will be in the program's operation. I always try to format the data in a way that the values can be represented in the mind's eye, as they will be used in the program's operation. i.e. A screen image as a block of data X items by Y items etc...

pjdenyer

#6
Hi Les, thanks for the update, I have reduced the number of chars per line and it now works.

I normally store my images as width (words) x height (lines), but large images go off the page, live and learn.