Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
An IDE anomoly detected
#1
I happen to be writing a new section for the tutorial that highlights the use of the IDE and as such I am paying close attention to the IDE output screens.

I noticed something odd. Type the following line of code into the IDE and then press ENTER:

FOR x% = 1 TO 10

The IDE is reporting the line of code as an error as it should "FOR without NEXT" in the status window. However the second line in the Status window is a bit strange:

"Caused by (or after): SUB VWATCH ( )"

Is the second line reporting correctly?
There are two ways to write error-free programs; only the third one works.
QB64 Tutorial
Reply
#2
oh that is weird, never noticed before
b = b + ...
Reply
#3
Sub vwatch is always there. If you have $debug, the hidden sub will contain the debug features. If not, the hidden sub will be just a stub, so you can’t have a conflicting sub vwatch of your own.
Reply
#4
(04-29-2024, 04:53 PM)FellippeHeitor Wrote: Sub vwatch is always there. If you have $debug, the hidden sub will contain the debug features. If not, the hidden sub will be just a stub, so you can’t have a conflicting sub vwatch of your own.
Oh sure, I understand what VWATCH is and does in relation to the IDE and debugging, I'm just wondering if that line should read:

"Caused by (or after): FOR" 

instead of

"Caused by (or after): SUB VWATCH ( )"
There are two ways to write error-free programs; only the third one works.
QB64 Tutorial
Reply
#5
Think of it as:

FOR I = 1 TO 10
   
    SUB Foo
    END SUB

NEXT

Now, is that error the fault of FOR?  It's got a proper NEXT to it; it's just a silly SUB out of place!

As far as the IDE is concerned, that's your glitch here.  It reads down, from top to bottom, and stops and tosses an error at the first problem it finds. In the above, it never really knows if there's a NEXT, or not, as it errors on SUB foo before it can verify things.

The only issue with SUB vwatch is it's hidden and not part of the user's code.  Makes for some confusing feedback when it's referencing an invisible module.  Wink
Reply




Users browsing this thread: 1 Guest(s)