Compiler Warning

Started by Rolf Brandt, June 30, 2015, 06:44:33 AM

Previous topic - Next topic

Rolf Brandt

Since yesterday I am receiving a warning:

BLOCK/SCANNED STATEMENTS NOT ALLOWED HERE.

FireFly opens another form in the editor (not always the same) and places the cursor at the beginning of the code. I had made no changes to the code. Any idea what causes this or where I could look for the error?

Rolf
Rolf Brandt
http://www.rbsoft.eu
http://www.taxifreeware.com
I cook with wine, sometimes I even add it to the food.
(W. C. Fields)

Wilko Verweij

Dear Rolf,
have you tried opening the file in the PB-editor? Sometimes helps for this kind of error.
Wilko

Paul Squires

Hi Rolf,

I remember seeing errors like that one and after investigating it usually comes down to me having accidently deleting an END SUB or END FUNCTION thus causing subsequent statements that can not go into a Sub/Function to produce an error.
Paul Squires
PlanetSquires Software

Rolf Brandt

Thanks Wilko and Paul,

opening the project in JellyBean etc. I had tried already. I think Paul's idea might touch the problem. I had something similar before. I'll give that a try.

Rolf
Rolf Brandt
http://www.rbsoft.eu
http://www.taxifreeware.com
I cook with wine, sometimes I even add it to the food.
(W. C. Fields)

Nathan Durland

Quote from: Rolf Brandt on June 30, 2015, 06:44:33 AM
Since yesterday I am receiving a warning:

BLOCK/SCANNED STATEMENTS NOT ALLOWED HERE.

FireFly opens another form in the editor (not always the same) and places the cursor at the beginning of the code. I had made no changes to the code. Any idea what causes this or where I could look for the error?

Rolf

Hi Rolf;

I sometimes get bit by this because of my dyslexic fingers, and code similar to the example below.  Notice the errant space in what should be a  'THEN'.  For some reason, the compiler treats this a the beginning of a compound IF, and since there's no END IF, the 'block statement not allowed here' can be tripped.  Apparently, the compiler reconciles those type things before deciding that there is no 'The' or 'nMyVar' function.

ID IsTrue(%True) The nMyVar = 1
a = 1
b = 2
etc

Rolf Brandt

Thanks Nathan, I will check into that direction too.

Rolf
Rolf Brandt
http://www.rbsoft.eu
http://www.taxifreeware.com
I cook with wine, sometimes I even add it to the food.
(W. C. Fields)

David Kenny

Paul,

Have you thought of stitching the individual files into one large (temporary) file just for compile time.  I would think it might be much easier for your code to figure out where that error actually is.  I haven't tried this myself and can imagine that It might create problems if the file size gets too large.  Just a thought.

Wilko Verweij

I ran into this error today too! In my case, I had appended a sub to a file, without ending it with "END SUB".  Then, when I compiled, I got this error in a different module/form, not in the one with the error. Maybe this helps you.
(Is actually similar to what Paul described)
Regards,
Wilko

Rolf Brandt

Thanks Wilko,

I guess that is exatly my problem. I will check other module that I have changed lately.

Rolf
Rolf Brandt
http://www.rbsoft.eu
http://www.taxifreeware.com
I cook with wine, sometimes I even add it to the food.
(W. C. Fields)

Rolf Brandt

Thanks to all for the helpful hints. This is what caused the problem (see picture).

I had deleted some code that was already commented for deletion and I had deleted Lf too. So there was no END FEUNCTION anymore.


Rolf
Rolf Brandt
http://www.rbsoft.eu
http://www.taxifreeware.com
I cook with wine, sometimes I even add it to the food.
(W. C. Fields)