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

RE: st: RE: Clickable examples in ado help files

From   Mark Schaffer <>
To, Nick Cox <>
Subject   RE: st: RE: Clickable examples in ado help files
Date   Thu, 18 Sep 2003 22:17:51 +0100 (BST)


Quoting Nick Cox <>:

> Mark Schaffer
> > Question 2:
> > 
> > Shouldn't the {stata} smcl command be as clever about :s as 
> > the {net} 
> > smcl command?  This would eliminate the need for messy little 
> > auxiliary files in a command package.
> > 
> > Comment:
> > 
> > I don't think I would -preserve- the data etc., because I 
> > would want 
> > the user to be able to click on various examples 
> > separately.  Rather, 
> > I would leave it to the user to voluntarily clear memory before 
> > clicking on the line in the help display that loads the example 
> > dataset.  If Stata complains that it can't load the example data
> > because the existing data would be lost, that's fine by me.
> I went home for dinner. Fortunately, Vince answered 
> the programming bit in the interim, but I can add a 
> little arm-waving. 
> This question is about programming style and etiquette. 
> Often and often a program writer stops at a certain point 
> for all sorts of reasons, and says, in effect, "My program 
> does this. If you want a program to do something else,
> feel free to write it yourself!"
> Nevertheless, in practice, clickable examples have 
> been introduced by Stata developers with a certain 
> sales pitch, namely that you can try on the fly, 
> and not disturb what you're doing. That's a precedent 
> for user-programmers to match, it seems to me. 
> Personally, I see a clickable example which 
> requires a prior -clear- as a little user-unfriendly. 

In this particular case I have a programming difficulty, as follows.

After the user types -help mycommand-, s/he faces a screen with a list of 
of clickable examples, the first of which will load the data.  After the 
click, the data are loaded and the user is ready to click on one or more 
other examples, as s/he choses.

The alternative is to put a preserve/load-example-data/restore-user-data 
cycle into each clickable example.  This seems to me to be likely to be 
painfully slow, mostly because the data would have to be downloaded off 
the net each time (the added loss of time via preserve and restore is 
probably just icing on the cake).  I haven't been able to check how Stata 
developers handle this, but my guess is that the dataset that a clickable 
example uses comes built-in with Stata and doesn't have to be downloaded 
with each click.  I don't see any way I can emulate this approach and at 
the same time avoid the cost in speed, short of requiring users to 
download the clickable example dataset at the same time that the rest of 
the package is installed.  Am I missing something?




This e-mail and any files transmitted with it are confidential
and intended solely for the use of the individual or entity to
whom it is addressed.  If you are not the intended recipient
you are prohibited from using any of the information contained
in this e-mail.  In such a case, please destroy all copies in
your possession and notify the sender by reply e-mail.  Heriot
Watt University does not accept liability or responsibility
for changes made to this e-mail after it was sent, or for
viruses transmitted through this e-mail.  Opinions, comments,
conclusions and other information in this e-mail that do not
relate to the official business of Heriot Watt University are
not endorsed by it.
*   For searches and help try:

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