.- help for ^loopdef^ (STB-37: ip17) .- Create, or append to, a command sequence intended for use by @loop@ ----------------------------------------------------------------- ^loopdef^ [^, a^ppend ^m^acro^(^macname^)^ ] Description ----------- ^loopdef^ accepts Stata commands from the command line and stores them, separated by semicolons, in a global macro (by default, the macro ^LOOP_CMD^). Such a macro can then serve as the source of commands to be repeated by the command @loop@. Typing the command ^loopdef^ produces this response: Replacing LOOP_CMD Enter: command command ... command ^>.^ In response to each prompt (^>.^) enter a command to be saved; the command can be typed, or placed on the command line by using Prevline (pressing the ^PgUp^ key in Windows) or (in windowed versions of Stata) by clicking in the Review window. Press the ^Return^ key twice in succession to stop entering commands and exit. (The command ^loop, rev^ will then display the commands currently stored in the macro ^LOOP_CMD^.) Options ------- ^append^ requests that the commands to be entered be appended to the current con- tents of the selected macro; by default, each call to loopdef overwrites the current contents (if any) of the selected macro. ^macro(^macname^)^ causes commands to be saved in the global macro macname, rather than in the default macro, ^LOOP_CMD^. Commands thus saved can be repeatedly executed with the command ^loop, cmd(MACRO^ macname^)^. Examples -------- . ^loopdef, mac(ALOOP)^ (Create or replace the global macro ALOOP with the commands entered at the prompts that follow) . ^loopdef, a^ (Append the commands entered at the prompts that follow to the current con- tents of the global macro LOOP_CMD) Author ------ John R. Gleason Syracuse University 73241.717@@compuserve.com Also see -------- STB: STB-37 ip17 Manual: [U] 24 Programming Stata, [R] while On-line: help for @loop@ (if installed)