PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Rolf Brandt on June 30, 2015, 06:44:33 AM

Title: Compiler Warning
Post by: 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
Title: Re: Compiler Warning
Post by: Wilko Verweij on June 30, 2015, 07:23:25 AM
Dear Rolf,
have you tried opening the file in the PB-editor? Sometimes helps for this kind of error.
Wilko
Title: Re: Compiler Warning
Post by: Paul Squires on June 30, 2015, 09:19:38 AM
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.
Title: Re: Compiler Warning
Post by: Rolf Brandt on June 30, 2015, 09:24:24 AM
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
Title: Re: Compiler Warning
Post by: Nathan Durland on July 05, 2015, 08:43:44 PM
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
Title: Re: Compiler Warning
Post by: Rolf Brandt on July 06, 2015, 08:24:23 AM
Thanks Nathan, I will check into that direction too.

Rolf
Title: Re: Compiler Warning
Post by: David Kenny on July 08, 2015, 02:32:12 PM
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.
Title: Re: Compiler Warning
Post by: Wilko Verweij on July 09, 2015, 06:34:57 PM
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
Title: Re: Compiler Warning
Post by: Rolf Brandt on July 10, 2015, 04:31:08 AM
Thanks Wilko,

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

Rolf
Title: Re: Compiler Warning
Post by: Rolf Brandt on July 10, 2015, 04:56:48 AM
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