counting lines of code

Lorry Litman LLitman at manitoba-ehealth.ca
Mon Feb 9 14:57:35 CST 2009


Hi, there might be a lexical function that can be used or try this code
(or something like this, quick and dirty). Lorry

$! output directory file listing to an output file
$ dir/col=1/ver=1/nohead/out=qks_files.out *.qks
$! open each file count lines and write count to output file
$ open/write out qks_file_line_count.txt
$ open/read indir qks_files.out
$_read_dirloop:
$ read/end_of_file=_eofdir indir qksfile
$ if qksfile .eqs. "" then goto _eofdir
$ linecnt=0
$ open/read inqks 'qksfile'
$_read_qksloop:
$ read/end_of_file=_eofqks inqks qkscnt
$ linecnt=linecnt+1
$ goto _read_qksloop
$_eofqks:
$ close inqks
$ write out "''qksfile' lines in file ''linecnt'"
$ goto _read_dirloop
$_eofdir:
$ close indir
$ close out
$ exit


-----Original Message-----
From: powerh-l-bounces+llitman=manitoba-ehealth.ca at lists.sowder.com
[mailto:powerh-l-bounces+llitman=manitoba-ehealth.ca at lists.sowder.com]
On Behalf Of Alan and Vicki
Sent: Monday, February 09, 2009 1:14 PM
To: powerh-l at lists.sowder.com
Subject: Re: Contents powerh-l Digest, Vol 45, Issue 4

Assuming you must do this programatically and can't use VMS to do it for

you....

I think I've done something like this before in MPE - concept should be
the 
same.  If memory serves, I did this:

Create a flat file in the dictionary with one char*80 item (or larger if
you 
use a longer record length for your source file, but the record length 
should be the same as your source files)
Use a file equate (logical in VMS?) to point each source file to the
flat 
file created
Use QUIZ or QTP to count the records in the flat file...what you do with
the 
counter is up to you,

Essentially, you're just creating a shell file in PHD that PowerHouse
will 
recognize and then treating your source code as a data file.

I'm not sure if there is a more elegant solution (utility) available
now, 
but I wouldn't be surprised if there was.  If you need to do this for
all of 
your code, then it could be a bit time consuming.

Good luck - let us know if it works.

Vicki



>
>
> Today's Topics:
>
>   1. counting lines of code of POW code on Open VMS (Desmond Dujon)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 9 Feb 2009 08:08:38 -0800 (PST)
> From: Desmond Dujon <ddujon at yahoo.com>
> Subject: counting lines of code of POW code on Open VMS
> To: powerh-l at lists.sowder.com
> Message-ID: <105345.45665.qm at web110604.mail.gq1.yahoo.com>
> Content-Type: text/plain; charset=us-ascii
>
> Hi ,
> Does anyone have a routine to count the number of lines of code in POW

> source programs(POW ver 7.10-G3. We are running on OpenVMS Ver 7.3
> thanks a million
>
>
>
>
>
>
>
> ------------------------------
>
> -- 
> = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> Mailing list: powerh-l at lists.sowder.com
> Subscribe: &quot;subscribe&quot; in message body to 
> powerh-l-request at lists.sowder.com
> Unsubscribe: &quot;unsubscribe &lt;password&gt;&quot; in message body
to 
> powerh-l-request at lists.sowder.com
> http://lists.sowder.com/mailman/listinfo/powerh-l
> This list is closed, thus to post to the list you must be a
subscriber.
> Add 'site:lists.sowder.com powerh-l' to your search terms to search
the 
> list archive at Google.
>
> End of powerh-l Digest, Vol 45, Issue 4
> ***************************************
> 


-- 
= = = = = = = = = = = = = = = = = = = = = = = = = = = =
Mailing list: powerh-l at lists.sowder.com
Subscribe: 'subscribe' in message body to
powerh-l-request at lists.sowder.com
Unsubscribe: 'unsubscribe &lt;password&gt;' in message body to
powerh-l-request at lists.sowder.com
http://lists.sowder.com/mailman/listinfo/powerh-l
This list is closed, thus to post to the list you must be a subscriber.
Add 'site:lists.sowder.com powerh-l' to your search terms to search the
list archive at Google.
-------------- next part --------------
This email and/or any documents in this transmission is intended for the
addressee(s) only and may contain legally privileged or confidential information.  Any unauthorized use, disclosure, distribution, copying or dissemination is strictly prohibited.  If you receive this transmission in error, please notify the sender immediately and return the original.

Ce courriel et tout document dans cette transmission est destin? ? la personne ou aux personnes ? qui il est adress?. Il peut contenir des informations privil?gi?es ou confidentielles. Toute utilisation, divulgation, distribution, copie, ou diffusion non autoris?e est strictement d?fendue. Si vous n'?tes pas le destinataire de ce message, veuillez en informer l'exp?diteur imm?diatement et lui remettre l'original.


More information about the powerh-l mailing list