PB 5.11-5.20 - Error shown on wrong line / in wrong file

Working on new editor enhancements?
Little John
Addict
Addict
Posts: 4519
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

PB 5.11-5.20 - Error shown on wrong line / in wrong file

Post by Little John »

I've tested all following code with PB 5.11 and PB 5.20 beta 9 on Windows XP x86.
The first part shows expected behaviour, and the second part shows the problem.

Expected

Code: Select all

; File "test.pbi"

Procedure TestProc()
   Foo()
EndProcedure

Macro TestMacro()
   Foo()
EndMacro

Code: Select all

; File "main.pb"

XIncludeFile "test.pbi"

TestProc()
TestMacro()
When I run "main.pb", the IDE opens "test.pbi", highlights the line inside the procedure TestProc(), and shows a MessageRequester that says:
Line 4: Foo() is not a function, array, list, map or macro.
Problem

Now the previously shown error in my code is removed by commenting Foo() in the procedure:

Code: Select all

; File "test.pbi"

Procedure TestProc()
   ; Foo()
EndProcedure

Macro TestMacro()
   Foo()
EndMacro

Code: Select all

; File "main.pb"

XIncludeFile "test.pbi"

TestProc()
TestMacro()
When I run "main.pb" now, the IDE does not open "test.pbi", but it highlights the line which contains TestMacro() in "main.pb". It also shows a MessageRequester that says:
Line 6: Foo() is not a function, array, list, map or macro.
and a "Macro Error" window that says:
Foo()
Especially when a program has lots of include files, it would be way more helpful if the IDE would open "test.pbi", and highlight the line which contains Foo() inside the macro TestMacro(), like it did in the above example.
I know that the code inside the macro is copied to "main.pb", but if an error occurs the compiler or the IDE could "remember" that the code originated from that macro in "test.pbi", couldn't it?