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

st: Clickable examples in ado help files


From   "Mark Schaffer" <M.E.Schaffer@hw.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   st: Clickable examples in ado help files
Date   Thu, 18 Sep 2003 18:20:49 +0100

Dear Statalisters:

A couple of questions for you:

1.  What do you think of clickable examples in a command help file?  
That is, if the example in the help file is

ivreg2 y1 x1 x2 (y2 y3 = z1 z2 z3), gmm ffirst

and you click on this line, then the command is executed.  It's 
possible to do this in smcl with {stata <command> : <text of the 
command> } , but is it worth it?

2.  This would work only if the dataset that the example uses is in 
memory.  I tried to put a clickable command to load the data in the 
help file with the command  

{stata use "http://fmwww.bc.edu/ec-p/data/macro/abdata.dta"; : . stata 
use http://fmwww.bc.edu/ec-p/data/macro/abdata.dta}   

where the part following the : separator is the clickable text to 
display to the user, and the "" are used because the URL contains a :.

Unfortunately, what gets displayed is

//fmwww.bc.edu/ec-p/data/macro/abdata.dta" : . use http://fmwww.bc.edu/ec-p/data/macro/abdata.dta

(all on one line)

and when I click on it, Stata tries to execute the command

use "http

with the following result:

. use "http
file http.dta not found
r(601);

What's happening is that Stata is ignoring the "" and treats the 
first : in the URL as the separator for the smcl command.

I'm using Stata 7 (but hoping to update soon....).  Does this happen 
in Stata 8 too?  Any ideas on a Stata 7 (or 8) workaround?

--Mark

Prof. Mark E. Schaffer
Director
Centre for Economic Reform and Transformation
Department of Economics
School of Management & Languages
Heriot-Watt University, Edinburgh EH14 4AS  UK
44-131-451-3494 direct
44-131-451-3008 fax
44-131-451-3485 CERT administrator
http://www.som.hw.ac.uk/cert
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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