Home > Archive > dBASE downloads > June 2005 > Application Documentation Program









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Application Documentation Program
Ken Mayer [dBVIPS]

2005-06-08, 9:24 am

This program attempts to go through all dBL Source Code files in a
folder, and find all dependencies ...

I do not guarantee it, and I have found that words such as "do" and
"use" show up in comments a lot, and am not sure how to deal with that
(I know I can check for lines that begin with // and * and such, but
what about code blocks?).

Anyway, this is a first run at it. I am sure it can be improved, if you
have ideas, drop me a note ...

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase


Ken Mayer [dBVIPS]

2005-06-08, 9:24 am

Version 1.1 attached -- fixed some things, the only real issue is the
comment lines that come up. I tested this against a couple of
application folders and it does a decent job ... I suppose it could use
a front-end, but not today ... <g>

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase


Bill P

2005-06-08, 9:24 am

Ken -

My hat's off to you.

------------- Bill

Ken Mayer [dBVIPS] wrote:
> Version 1.1 attached -- fixed some things, the only real issue is the
> comment lines that come up. I tested this against a couple of
> application folders and it does a decent job ... I suppose it could use
> a front-end, but not today ... <g>
>
> Ken
>


Bill P

2005-06-08, 9:24 am

Ken -

This is really very useful.

I've just now used it to run through the 139 files that make up the
application I'm converting to use a BDE alias. Looking over the output
from your program, I easily found a report in which I had failed to open
the alias' database (but have not done enough testing of the converted
application so far to find out that way).

If you are going to put some more time into this, I've got two
additional thoughts:

1. It would be good if your program would scan for "open database
somename" in the XDML portions of the code. (There are times when the
database is not opened in the OODML portions of the code, or even when
there is no OODML code at all.)

2. Because I usually end up with a lot of wfm, prg and rep files in the
target folder that represent test code or code that doesn't end up being
used in the project file for one reason or another, it would be good to
have an option for the user to specify a prj file in the target folder
so your program would just look at the files in the selected project file.

Once again, I really appreciate the work you have put into this.

------------------------- Bill

Ken Mayer [dBVIPS] wrote:
> Version 1.1 attached -- fixed some things, the only real issue is the
> comment lines that come up. I tested this against a couple of
> application folders and it does a decent job ... I suppose it could use
> a front-end, but not today ... <g>
>
> Ken
>


Robert Bravery

2005-06-08, 9:24 am

HI Ken,

I did something like this a while ago. It is a great help. My app, alos
countied and documented suc things as condition statements, like if..endif,
do while... do case... etc. It also reformated the code, corrected all
indenting, so that procedure, if ... do.. statements and the like where
properley indented. It also added Some header info to each program with
generic stuff that I had become lazy in not doing, things like program name,
date, programmer name etc. Never upgraded mine.
But anyway, on the comment lines, the normal // and * are easily picked up.
Perhaps on comment blocks you could have a counting flag that everytime you
see a line beggining with a /* you increment by one, and don't document or
whatever until you get an closing */ whereby you would decrease the count.
You would only process documenting the code if youre count is 0
With dbase commands, I made sure that what I looked for was that all dbase
commands must have a space after so that I would look dor 'use ' and 'do '
and look for an exact match, when it come to 'do while ' same thing applies.
I would also document all dbase commands by looking for the first for letter
like 'brow ', what ever, any dbase command would need to be followed by a
space, this eliminated things like 'mouse' and 'dongle'



Robert


Malcolm Brown

2005-06-08, 9:24 am

Ken Mayer [dBVIPS] wrote:

> Version 1.1 attached -- fixed some things.


This is incredibly useful stuff - it turns up all sorts of little nasties
lurking in dark corners.

Thank you very much.

Malcolm Brown

Ken Mayer [dBVIPS]

2005-06-08, 9:24 am

Bill P wrote:
> Ken -
>
> This is really very useful.
>
> I've just now used it to run through the 139 files that make up the
> application I'm converting to use a BDE alias. Looking over the output
> from your program, I easily found a report in which I had failed to open
> the alias' database (but have not done enough testing of the converted
> application so far to find out that way).
>
> If you are going to put some more time into this, I've got two
> additional thoughts:
>
> 1. It would be good if your program would scan for "open database
> somename" in the XDML portions of the code. (There are times when the
> database is not opened in the OODML portions of the code, or even when
> there is no OODML code at all.)


D'oh. I knew I had forgotten something ...

> 2. Because I usually end up with a lot of wfm, prg and rep files in the
> target folder that represent test code or code that doesn't end up being
> used in the project file for one reason or another, it would be good to
> have an option for the user to specify a prj file in the target folder
> so your program would just look at the files in the selected project file.


Possible. I had that in the back of my fuzzy brain, but didn't deal with
it ...


Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
Ken Mayer [dBVIPS]

2005-06-08, 9:24 am

Robert Bravery wrote:
> HI Ken,
>
> I did something like this a while ago. It is a great help. My app, alos
> countied and documented suc things as condition statements, like if..endif,
> do while... do case... etc. It also reformated the code, corrected all
> indenting, so that procedure, if ... do.. statements and the like where
> properley indented. It also added Some header info to each program with
> generic stuff that I had become lazy in not doing, things like program name,
> date, programmer name etc. Never upgraded mine.
> But anyway, on the comment lines, the normal // and * are easily picked up.
> Perhaps on comment blocks you could have a counting flag that everytime you
> see a line beggining with a /* you increment by one, and don't document or
> whatever until you get an closing */ whereby you would decrease the count.
> You would only process documenting the code if youre count is 0
> With dbase commands, I made sure that what I looked for was that all dbase
> commands must have a space after so that I would look dor 'use ' and 'do '
> and look for an exact match, when it come to 'do while ' same thing applies.
> I would also document all dbase commands by looking for the first for letter
> like 'brow ', what ever, any dbase command would need to be followed by a
> space, this eliminated things like 'mouse' and 'dongle'


I'm able to find the lines that begin with // and *, but as noted the
difficulty is the comment blocks ...

I am not even going to try to document all dBASE commands. That's silly.
What would be the point?

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
Ken Mayer [dBVIPS]

2005-06-08, 9:24 am

Malcolm Brown wrote:
> Ken Mayer [dBVIPS] wrote:
>
>
>
>
> This is incredibly useful stuff - it turns up all sorts of little nasties
> lurking in dark corners.


Sure. It was kind of fun, and got my head cleared of some cobwebs. I
had been staring at a chapter of my book when I thought I'd take a break
and work on this ...

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
Ken Mayer [dBVIPS]

2005-06-08, 9:24 am

Version 1.3 is attached, this catches as many commands as I can think of
.... of course, I could still be missing something. Resolved some of the
issues with comments (including comment blocks, at least mostly ... I
think I did it all, but I could be wrong <g> ), and I think I got Ivar's
line numbering issue dealt with. Again, I could be wrong.

I plan on still adding a form to deal with the usual UI stuff, and also
as suggested, optionally loading a .PRJ file and loading the files from
there. Have some ideas for that, but ...

Anyway, for a toss-off little program, it's turning out pretty well, I
think. Try the new version, let me know of problems -- I am not claiming
this has no bugs ... <g>

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase


Malcolm Brown

2005-06-08, 9:24 am

Ken Mayer [dBVIPS] wrote:

> Sure. It was kind of fun, and got my head cleared of some cobwebs. I
> had been staring at a chapter of my book when I thought I'd take a break
> and work on this ...


Ah, priorities, priorities. We need both the program and the book - you'll
just have to knuckle down and invent a 30 hour day.

Thanks again.

Malcolm Brown
Dan Barbaria

2005-06-08, 9:24 am


"Ken Mayer [dBVIPS]" < dbase@_nospam_golden
stag.net> wrote in message
news:9H5Z%23WFEFHA.648@news-server...
Try the new version, let me know of problems -- I am not claiming
> this has no bugs ... <g>

Ken,

Nice program! It seems to have a bug. The AppDoc.txt results below lists
line 87 as a Table but the line is related to a text value. Line 87 is
shown below the AppDoc.txt.

File: printNewQc.wfm
** Dependencies:
Line: 16 - eformstoprint.dmd
Line: 87 - Table: the menu</p><p></p
Line: 195 - forms ready to print.rep

Code in printNewQC.wfm
this.STEP3TEXT = new MYTEXT(this)
with (this.STEP3TEXT)
height = 80
left = 47
top = 144
width = 223
LINE 87: text = "<p>Step 3. Check the list and make sure all forms Printed.
If forms are missing, select 'Print Single Request' from the
Menu</p><p></p>"

endwith
------------------------------------------------------------------
Thanks for your work.

Dan Barbaria


Ken Mayer [dBVIPS]

2005-06-08, 9:24 am

Malcolm Brown wrote:
> Ken Mayer [dBVIPS] wrote:
>
>
>
>
> Ah, priorities, priorities. We need both the program and the book - you'll
> just have to knuckle down and invent a 30 hour day.


Hah! Yeah ... and the ability to not sleep ... <g> I'm around half-way
through the book, with a couple of hefty chapters to go, but most of
them won't be huge ...

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
Ken Mayer [dBVIPS]

2005-06-08, 9:24 am

Dan Barbaria wrote:
> "Ken Mayer [dBVIPS]" < dbase@_nospam_golden
stag.net> wrote in message
> news:9H5Z%23WFEFHA.648@news-server...
> Try the new version, let me know of problems -- I am not claiming
>
>
> Ken,
>
> Nice program! It seems to have a bug. The AppDoc.txt results below lists
> line 87 as a Table but the line is related to a text value. Line 87 is
> shown below the AppDoc.txt.
>
> File: printNewQc.wfm
> ** Dependencies:
> Line: 16 - eformstoprint.dmd
> Line: 87 - Table: the menu</p><p></p
> Line: 195 - forms ready to print.rep
>
> Code in printNewQC.wfm
> this.STEP3TEXT = new MYTEXT(this)
> with (this.STEP3TEXT)
> height = 80
> left = 47
> top = 144
> width = 223
> LINE 87: text = "<p>Step 3. Check the list and make sure all forms Printed.
> If forms are missing, select 'Print Single Request' from the
> Menu</p><p></p>"
>
> endwith
> ------------------------------------------------------------------
> Thanks for your work.


I think there are going to be situations where I just can't catch all
the options. Having text that uses words like "select" make things ...
difficult. Trying to back up to see if it's a text property of a text or
textlabel control makes things more difficult (and of course, there's
the value property of the editor, and ...). I am not sure I will ever
have this not throwing a few lines out that aren't really doing what the
program thinks. I would rather err on that side, then miss something
that it should catch. <g>

I started a UI, but my day is going to be crazed for the rest of the
day, so I won't really be getting back to this until next week (out of
town for the weekend ...).

I will upload the latest version of the program, which is the "real"
version 1.3 ... (lost track here).

This resolves Ivar's SQL file thing ...

Ken

--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase
Robert Bravery

2005-06-08, 9:24 am


HI Ken,

Perhaps I don't understand what youre getting at, but anyway, the following
would print out only comment blocks, those text blocks beginning with /* and
ending with */. Reverse the code to exclude

As far as the commands are concerned, I used that for analytical purposes
and consistancy in my code

Robert


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com