April 19, 2024, 03:27:36 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


New code checking program - anyone interested in testing?

Started by Andy, January 18, 2020, 10:56:28 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy

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.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

billhsln

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
When all else fails, get a bigger hammer.

Andy

That's a real shame Bill, but if you're busy, you're busy!

Thanks anyway,
Andy.
 :)
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.