I have played around with this idea for such a long time, and tried many different ways to do it, finally it looks like it's working.
My code checking program:
I posted a puzzle yesterday, and Bill got the correct answer (well done Bill!), this same problem a few weeks ago took me around two hours to find!
https://www.ionicwind.com/forums/index.php?topic=6357.msg46472;topicseen#msg46472
After a few hours of programming (and getting tiered) I decided to make one last change before calling it a day.
Big mistake...
I pasted in some new code over some older code and accidentally removed an ENDIF.
This was the compile message...
Compiling Resources...
No Errors
Compiling...
test1 missing endifs.iwb
File: c:\test\subtest\project\bin\test1 missing endifs.iwb (222) Error: syntax error - FlagEnd
File: c:\test\subtest\project\bin\test1 missing endifs.iwb (237) Error: syntax error
File: c:\test\subtest\project\bin\test1 missing endifs.iwb (128) Error: unexpected end of sub: missing UNTIL
File: c:\test\subtest\project\bin\test1 missing endifs.iwb (1) Error: syntax error
Error(s) in compiling "c:\test\subtest\project\bin\test1 missing endifs.iwb"
Build Failed
When (after 2 hours) I finally found the problem, I decided to do something about it and looked again at how to solve this problem.
Using my code, the way I have typed it, it works, but would like someone else to test it...
Anyone interested?
Just need a few more days to tidy it up before I can pass it on.
It takes no time at all for the program to give you the answer (see attached).
By the way... it doesn't just work for IF / ENDIF's, it works for anything where there needs to be a matching pair e.g. FOR / NEXT, DO / UNTIL etc.
Andy.
If I wasn't in the middle of two major projects at work, I would love to help. Looks like a great idea and will save a lot of time for many programmers. I know how infuriating it can be to miss an ENDIF or other conditionals or loops.
Good luck,
Bill
That's a real shame Bill, but if you're busy, you're busy!
Thanks anyway,
Andy.
:)