Finding Functions and Summary View
![Duane Degn](https://forums.parallax.com/uploads/userpics/621/nYR252DBM43HX.jpg)
Now that I have all the parts to convert a BOE-Bot into an ActivityBot, I've been working through the Propeller C Tutorials. As I've come to expect from Parallax, the tutorials are great and a very pleasant way of learning a new topic.
I have run into a couple of frustrations. One is the difficulty in finding a function called by an example program and the other frustration is the lack of a way of easily "summarize" a program.
Here's an example of my first frustration, finding a function called by a program.
Below is the example program "Forward Stop Face Right.side".
I'd like to know how the method function "drive_goto" works. I assume the function is part of "abdrive.h" but is there a way to know which included file holds the function?
Once I know which file holds the function I wish to view, is there an easy way to find this function?
So far I've found I need to find the project which includes "abdrive.h" which I believe is part of "libabdrive.side". I found "libabdrive.side" in the SimpleIDE\Learn\Simple Libraries\Robotics\ActicityBot\libabdrive\ folder. Once I open "libabdrive.side", I can then "Open Tab to Project" and and find "abdrive.c" and "abdrive.h".
In "abdrive.h" I find the function prototype "drive_goto" on line 337 but I don't find "drive_goto" in "abdrive.c"?
I was able to find "drive_goto" in "goto.c". Was there some way I should have known to look in "goto.c" for the function "drive_goto"?
Is there an easier way of finding functions called from example programs?
On to my second frustration. With the Propeller Tool, if I select the "Summary" option the code will be compressed to a list of methods. Is there a similar way of listing the functions within a C program? I haven't been able to find a way to compressing the displayed program.
I have these same frustrations when using the Arduino IDE so using C on the Propeller isn't any more frustrating than using C on an Arduino but I sure have gotten used to being able to find methods quickly in Spin with the Propeller Tool and to easily get an overview of my program using the Summary feature and I don't like having to get by without these convinces.
I have run into a couple of frustrations. One is the difficulty in finding a function called by an example program and the other frustration is the lack of a way of easily "summarize" a program.
Here's an example of my first frustration, finding a function called by a program.
Below is the example program "Forward Stop Face Right.side".
/* Forward Stop Face Right.c http://learn.parallax.com/activitybot */ #include "simpletools.h" #include "abdrive.h" int main() { drive_goto(256, 256); pause(200); drive_goto(26, -25); }
I'd like to know how the method function "drive_goto" works. I assume the function is part of "abdrive.h" but is there a way to know which included file holds the function?
Once I know which file holds the function I wish to view, is there an easy way to find this function?
So far I've found I need to find the project which includes "abdrive.h" which I believe is part of "libabdrive.side". I found "libabdrive.side" in the SimpleIDE\Learn\Simple Libraries\Robotics\ActicityBot\libabdrive\ folder. Once I open "libabdrive.side", I can then "Open Tab to Project" and and find "abdrive.c" and "abdrive.h".
In "abdrive.h" I find the function prototype "drive_goto" on line 337 but I don't find "drive_goto" in "abdrive.c"?
I was able to find "drive_goto" in "goto.c". Was there some way I should have known to look in "goto.c" for the function "drive_goto"?
Is there an easier way of finding functions called from example programs?
On to my second frustration. With the Propeller Tool, if I select the "Summary" option the code will be compressed to a list of methods. Is there a similar way of listing the functions within a C program? I haven't been able to find a way to compressing the displayed program.
I have these same frustrations when using the Arduino IDE so using C on the Propeller isn't any more frustrating than using C on an Arduino but I sure have gotten used to being able to find methods quickly in Spin with the Propeller Tool and to easily get an overview of my program using the Summary feature and I don't like having to get by without these convinces.
Comments
There's tutorials for setting up Netbeans or Code::Blocks with PropGCC here..
Probably not the answer that you want, but I suspect that the answer for SimpleIDE is "not possible."
I hadn't seen that page before. Thank you.
SimpleIDE allows Control+Click browsing for functions within a project, but libraries are not browsable from your own project (typically true of system libraries on any IDE). All Simple Libraries offer a file (such as libsimpletext.c in the simpletext library project) where functions can be added, tested, and browsed, etc....
Having SimpleIDE browse functions in the Simple Libraries has never been a high enough priority to add in the program. One could say the same for context help, but it's there anyway because I had time to add it.
Do you really want to see the function's code or just a description of what it does and what inputs it needs? If the later, you can always use SimpleIDE's Help menu item, "Simple Library Reference". I keep it up in a browser in the background and just switch to it and search through the header file links (of course, you need to have an idea which header to look for :-)... It's not "auto-magical" but works.
Both of these features sound like enhancement requests. You can create issues as feature requests at: https://code.google.com/p/propside/issues/list, then just reference the issue's link in a forum post. It's a great way for the requests to be published and tracked! And, it keeps the issue in a public place, sorted by date and available to SimpleIDE's developers (Now, who was that musically-named forum poster, that would take an interest in the issue list?, Hmm...)... Jazzed beat me to the punch!
dgately
Well, there's XCode and it allows jumping to a library's definition of a selected function, object or VAR...
dgately
Thanks guys. I had found the list of functions in the help section. I wanted to see the code and how it was written.
As I mentioned, I have these same frustrations with other IDEs, I was just wondering if I was missing something obvious.
I'll try the options Cody mentioned.