Announcement

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

  • abbreviations allowed in options of a user-written command?

    Is it possible to write user-written commands that will accept abreviatoins in the options?

    For example, syntax bellow works on both cases a nd th e help file for "merge" ndicates this by underlying the first 3 letters on the "generate" option.
    Code:
      
    merge 1:1 var1 using dataset, generate(var2)
    merge 1:1 var1 using dataset, gen(var2)
     
    How do I replicate this for a user-written command? For instance:

    Code:
    sysuse auto, clear
    program test_prog
        set more off
        syntax varlist(min=2 max=2), generate(name)
        confirm new variable `generate'
        di "testing"
        gen `generate'=1
        end
    test_prog weight length,  generate(c)    // works
    test_prog weight length,  gen(c)          // does not work


  • #2
    Lucas,

    Try:

    Code:
     
    syntax varlist(min=2 max=2), GENerate(name)
    The upper case letters in the option indicate the minimal allowed abbreviation.

    Regards,
    Joe

    Comment


    • #3
      Tks Joe. It works.

      Comment

      Working...
      X