Trouble shooting. For larger plugins.
I was having such difficulties with trouble shooting and finding problems.
Now for the most part, I rarely have problems with Amx ModX, lately with the recent developement of Amx Modx and some function changes / additions. I am finding myself tearing old plugins apart and changing whatever was necessary. On some plugins. / Larger plugins / I would make A. a mistake or mistype B. Invalid function call or argument Rather often. So in order to COMBAT the cascading problems I would have, I was forced into a change. |
I found myself in a fluster of problems and mismatches.
The Idea came to me when reading through " Battle Mages " -- an amxmodx plugin. I saw how the author used " Multiple Include Files " So your plugin is 4000 lines plus. You either made a large change in several functions , added new functions, or just need to update it. Split it up into " Sections " and save them into the include dir as an include. For example : If your plugin saves anything. Make a saving include with all the information included in it. If you Plugin has skills or classes. Make that its own include it will make it easier to update and change. If you have a lot of menu's : Make a menu's include Put them all in there ..... You can even place all of your variables into an include. |
The ONLY PROBLEM that can arise
If you include them in the wrong order. For example Code:
#include <menus>since variables will allways need to be before anything else. Now if your menu's call a <skills> function then <skills> would need to be above <menus>. |
The reason this will help you in troubleshootin faster and easier is.
if you have a compiler error you can comment out an include to find out which one is causing it. also this will make accessing sections of you code easier. so your only seeing what is pertainent to your problem. |
If you have a programming interface
or mark up editor dont worry about this. IF YOU ARE USING NOTEPAD... dont. If you need a good and free editor. User crimson editor. |
Why did you make 1 topic and 4 replies when all you needed was one topic? Perhaps you have ADD or something?
P.S. Notepad is awesome. |
Quote:
|
...
Wait, are you saying that you used a header to hold all your global variables? O_o And that - lmfao - it wouldn't work if you included them in the wrong order? Look up the technique known as "single-file inclusion." Works wonders, it really does. Quote:
Quote:
PPS. Notepad rulez you. |
Notepad here, too. Crimson Editor just doesn't have that "feeling" when you complete plugin.
|
| All times are GMT -4. The time now is 19:19. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.