From the Support Desk
Tagged in a Web Application?
- Clay Martin
If you work on web sites (keep reading this for other languages also), eventually a customer will want a forum, calendar or blog. There are lots of PHP code, free
and not, that can help provide your customer what they want, especially if you don't want to write it from scratch. Many of these applications are well written and
depend on libraries of functions to get things done. But they are not your code. They have a style, but it is not yours. And eventually the customer will want a
customization that can't be provided through the applications control panel or option settings.
ME Tags can help you out. Place a copy of the web application's code in your project at the same relative location as it is on the web server. Then add all the
.php files to your project with the Add Files Wizard (right click on the root of the project's directory in the project pane). After all the php
files have been added to the project, open the Tags Pane with View-Tags. Then click on the 4th button (Scan Project) over from the left in the
Tags Pane or use the Tags menu.
Ok, how do we use this? As you are pouring through the web application's code, looking for where to make that modification, you will run into calls to functions. You
need to know what they do, or if they may be the place to make the change. A lot of the free web applications (and some you pay for) don't have a lot of low-level
documentation, except as comments. So seeing the code that is being called, really helps understanding the original programmer's intent. Lets say you have a line of
code like this:
You can place your cursor on the "setError" function name and right click to get the context menu. Then select Find tag under the cursor.
If the coding is linear, ME will open the file containing the function, and place your cursor at the declaration. If the code is object oriented (OO),
there may be many instances where the function is declared (over ridden), once in each object. ME will give you a list of places where the functions are
defined. You can then select the one object on which you are working.
Speaking of Object Oriented code, if you are defining your own extension of an object, you may need to chase back through numerous extensions to see what
functions are ok and what you need to override. So if you are looking at a line like this:
class YearField extends DropDownField
You can place your cursor on DropDownField, right click and select Find tag under cursor. ME will open the file that the DropDownField
class is declared in and place your cursor right on the declaration. If it was extended, then you can do the same thing to hop to its ancestor.
ME Tags can even help in the debugging process. In the Tag pane the upper list shows all the files in your project. Clicking on one of these will show,
in the lower list, all the scanned functions, procedures or classes declared in that file. You can then click on the function name to hop directly to it. Between right
clicking on function calls in your code, or using the Tag pane you can quickly traverse your code base.
Of course ME Tags is not just for PHP files. If you are working with large libraries of classes, functions or procedures for most languages,
Multi-Edit has support for scanning that language for tags. You can determine if ME Tags are supported for a particular language by going to
Tools-Customize-Languages, select the language and press the Edit button. In the lower left of the dialog there is a field labeled FindTag: if
there is a macro listed there, then that language has ME Tags support.
Clay Martin, Technical Support
Multi Edit Software, Inc.
Input Your Suggestions in the Forum:
**Please note that you can review/search
through all forum topics,
but to submit a post you must register on the forums.