Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Programming a version-number check

From   "Mark Schaffer" <>
Subject   Re: st: Programming a version-number check
Date   Sun, 25 Sep 2005 23:12:40 +0100 (BST)


> At 03:59 PM 9/25/2005, Mark Schaffer wrote:
>>Using -findfile- to get the path to the ado, opening the ado with -file-,
>>and then messing about with file i/o is unappealing, though I suppose it
>>could be made to work.  Is there anything easier?
> One additional complication is that there is nothing that says an ado
> file has to use the same version number throughout, e.g. different
> subroutines could use different version numbers.  Would you need to
> track all of them, the highest one, the lowest one, or what?

What I have in mind is pretty straightforward in principle.  Many ados
have a few lines at the top that start with the characters "*!".  I would
want to grab the line that has "*!" followed by "version".  E.g., ivreg
has at the top

*! version 5.1.3  21jul2004

I would take that line, tokenize it, and if the second token is "version",
the third token would be the version number, namely "5.1.3".

I suppose this could be done with -findfile-, then -file open- and -file
read-, but it's a hassle, esp. dealing with pathnames and different
operating systems, \ vs. /, and all that.


> -------------------------------------------
> Richard Williams, Notre Dame Dept of Sociology
> OFFICE: (574)631-6668, (574)631-6463
> FAX:    (574)288-4373
> HOME:   (574)289-5227
> EMAIL:  Richard.A.Williams.5@ND.Edu
> WWW (personal):
> WWW (department):
> *
> *   For searches and help try:
> *
> *
> *

Prof. Mark Schaffer
Director, CERT
Department of Economics
School of Management & Languages
Heriot-Watt University, Edinburgh EH14 4AS
tel +44-131-451-3494 / fax +44-131-451-3294



This e-mail message is subject to

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index