Right we can work around everything...
the point is the compiler knows it was created already -- so just say "in file1.pbi line 301"
It's happened with structures, lists, procedures -- it'd just be nice if it were a bit more helpful...
With procedures, it's easy -- just double click on the error line & it takes you to where (at least one) was already defined.
I don't know about you -- but it would be fairly ugly code to wrap everything in compilerif's.
more importantly, as IdeasVacuum pointed out - let's say you have wrapped all your structures up "just in case"
Code: Select all
compilerif defined(winlink,#pb_structure) = #false
structure winlink
... blah ..
endstructure
compilerendif
And your program works fine with PB5.1 beta4, but then beta5 comes out, and it has a structure "winlink" now your program is broken, but you have to hunt for the 'why'.
It would be much easier to not have it wrapped, get an error and be told where it was already created...
This issue gets bigger when you're not the only one working on a single project... I may create a structure "jFishes" and work in my module happily. Another programmer working on a different module, also creates a structure "JFIshes" and his works perfectly well in testing.
But then come to compile the actual application, and now, "What? how can that be" -- and now a search is on. In either cases, being told where it was previously defined makes debugging much easier.
Think about driving to someone's house in a city you've never been, it's dark out you're lost, so you ask "Hey, I'm headed for <this address>" the response you get from helpful person "you're not there, you're here" and they walk away... That's what the compiler does "already defined" and walks away.