Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • syntax for command "macro list"

    I've been putting some values into macros and interactively checking that my assignments went through by typing "macro list". This behaves like "return list" or "ereturn list", listing everything classified as a macro.

    I was wondering where the help page for this command is...? If I type "help macro list" it takes me to "help macrolists", which doesn't seem to cover this syntax (unlike "help return list", for example).

    Probably there are no options available for the command, but I was hoping for an option to filter the list by a prefix, like "macro list parm_*"

  • #2
    Documented at help macro.

    Global macros are different, but in essence local macros are what you create, so one solution is to keep track of your own local macro names within your own program (they aren't visible anywhere else, naturellement). (No, I thought that wouldn't be what you were after.)

    Comment


    • #3
      Thanks, Nick.

      I think I might do that (tracking my macro names). Right now, I'm reading in some parameters (in the programming sense, like toggles for different things) with

      Code:
      insheet using "$indir\parm.csv", comma names clear
      ds
      local parms `r(varlist)'
      
      foreach p of local parms {
          global parm_`p' `=`p''
      }
      I could track the macro names at this stage, I figure. I already have something close to their names in "parms." Alternately, I could read these into mata variables. The "mata describe" command does allow for pattern matching on mata variable names.

      (Aside: Yes, I know that globals are bad/dangerous, but it is simply too convenient to read them this way when I (i) won't be using the parameters for several hundred lines of code and (ii) am developing the code interactively. Why are my programs so long? Company policy -- one script per project.)

      Comment

      Working...
      X