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

st: RE: Function to assign a value label to a global marco


From   "Steichen, Thomas J." <[email protected]>
To   <[email protected]>
Subject   st: RE: Function to assign a value label to a global marco
Date   Fri, 14 Oct 2005 08:30:21 -0400

Fred Wolfe said to see extended functions... He's right, but you want _macro_ 
extended functions, so start with macro first.

Here's the diagram for what you want:

 {local | global} macname :  label { valuelabelname | (varname) } {
                                    maxlength | # [#] } [, strict ]

Thus"
   global myvaluelabel : label mylabel 1

And if, say, mylabel was the value label for variable myvar, you could
directly do:
   global myvaluelabel : label (myvar) 1
And Stata will figure out which value label you want.

Tom

> On Behalf Of Lars E. Kroll
> Sent: Friday, October 14, 2005 7:08 AM
> To: [email protected]
> Subject: st: Function to assign a value label to a global marco
> 
> 
> Dear all,
> 
> I'm trying to do the following:
> 
> . label define mylabel 1 "Hello" 2 "Good Bye"
> . global myvaluelabel UNKNOWNFUNCTION(mylabel,1)
> . di "{$myvaluelabel} XY!"
> HELLO XY!
> 
> But I don't know the UNKNOWNFUNCTION and I didn't find an information 
> about. But I know that it is possible..
> 
> (In fact I want to assign the value label to a legend in an 
> overlaid tw 
> graph.. )
> 
> I hope someone can help me..
> 
> Lars
> 
> -- 
> ____________________________
> Lars E. Kroll
> UNI     030  83857614
> RKI     030  45473307
> Privat 0176 23131352
> FAX  069  13306720084
> WEB www.lkroll.de
> *
> *   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/
> 

-----------------------------------------
CONFIDENTIALITY NOTE: This e-mail message, including any attachment(s),
contains information that may be confidential, protected by the
attorney-client or other legal privileges, and/or proprietary non-
public information. If you are not an intended recipient of this
message or an authorized assistant to an intended recipient, please
notify the sender by replying to this message and then delete it from
your system. Use, dissemination, distribution, or reproduction of this
message and/or any of its attachments (if any) by unintended recipients
is not authorized and may be unlawful.


*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index