# Re: st: Creating a local macro with a colon

 From "Adrian Sayers" To statalist@hsphsun2.harvard.edu Subject Re: st: Creating a local macro with a colon Date Mon, 21 Apr 2008 22:47:41 +0100

Many thanks for your suggestions, i will have a crack to see if i can
make it work.

On 21/04/2008, Nick Cox <n.j.cox@durham.ac.uk> wrote:
> But you can happily put a colon inside the macro.
>
>  local r "R://myserver.ac.uk/"
>
>  or whatever.
>
>  Like Austin, I am using forward slashes here. They will work fine even
>  under Windows. As the backslash \ is used by Stata as an escape
>  character you can get weird results otherwise. See [U] 18.3.11.
>
>  Nick
>  n.j.cox@durham.ac.uk
>
>  Austin Nichols
>
>
>
>  Don't you just want
>   local r "//myserver.ac.uk/"
>   dir `r'Research
>   dir `r'Stats
>  ?  I.e. there's no reason to put a colon in the name of the macro, and
>  it is not allowed in any case.
>
>  On Mon, Apr 21, 2008 at 11:12 AM, Adrian Sayers <adriansayers@gmail.com>
>  wrote:
>  > Hi,
>  > I am working in two locations, and in one location i have complete
>  > acess to the whole server, and the file path starts R:Research in the
>  > other location which i work a few day a week the path starts R:Stats I
>  > thought the easiest way to solve this was to specify the server name
>  > instead and this would solve all my problems. So i was going to change
>  > the R: to the name of the server. This would solve all my problems.
>  >
>  >
>
> > On 21/04/2008, Friedrich Huebler <fhuebler@gmail.com> wrote:
>  > >
>  > >  Out of curiosity, why do you need a macro name with a colon?
>  > >
>  > >
>  > >  Friedrich
>  > >
>  > >
>  > >  On Mon, Apr 21, 2008 at 10:39 AM, Adrian Sayers
>  > >  > Dear all,
>  > >  >
>  > >  >  I am having trouble creating a macro with a colon.
>  > >  >
>  > >  >  I have just started working in two locations and in essence the
>  server
>  > >  >  name is a little different in each place.
>  > >  >
>  > >  >  in essence i want to delcare a macro which is `R:' followed by a
>  string
>  > >  >
>  > >  >  like this:
>  > >  >
>  > >  >  local R: "\\myserver.ac.uk\myfolder"
>  > >  >
>  > >  >  di "`R:'"
>  > >  >  \\myserver.ac.uk\myfolder
>  > >  >
>  > >  >  however i get this error message
>  > >  >
>  > >  >  "\\myserver.ac.uk\myfolder not allowed
>  > >  >
>  > >  >  I know that local macros have extended functions which use
>  colons is
>  > >  >  there any way of getting round this?
>
>  *
>  *   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/
>
*
*   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/