Tuesday, April 29, 2008

Go to definition

In the middle of the night, I received what I like to think of as a "personal message" from what I like to think of as "Chris Jones". Our illustrious AGS author has asked me to blog about the "Go to function definition" feature of AGS 3.01 and beyond.

When writing a script, we can hit F1 on any built-in function to get the context-sensitive help. But if you right-click on the function name you are calling, you can also go to the function definition if it is in one of your own scripts or modules. This is a very handy feature and lets you navigate your code with ease. You don't need to remember which script the function is defined in, and if the script is not already open, AGS opens it up for you and goes to the correct line.

Because of this feature, I suggest that module authors could perhaps put a bit of documentation for each function after the first line of a function, becuase if the user uses this feature, it makes it very easy for them to access that documentation. Its also good to have documentation in one place as well, though, so this is as a supplement to any other documentation (which I always put in the header file of my modules). I haven't been doing this yet, but I intend to do so on the next release of any modules that I do.

No comments:

Post a Comment

Please keep comments clean: foul language means your comment will not get published. Sorry for the captcha, was getting to much spam.