Announcement

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

  • Can I specify an if/then statement in power_cmd_init?

    Hi All,

    I am writing a power command using power_usermethod. I would like to have the power_cmd_name_init program change the title, depending on whether an option was specified in the power_cmd_name program. Something like this completely contrived example:

    Code:
    capture program drop power_cmd_whatever_init
    program power_cmd_whatever_init, sclass
            version 11
           if "`level'" == "" {
               sreturn local pss_title " for a test of upper level"
         }
        else {
           sreturn local pss_title " for a test of lower level"
        }
    The local "`level'" would be in the power_usermethod command. I am not sure if I can use a passthrough, or how else to do this. The help file does not discuss this issue.

    Thanks in advance!

    Ariel
    Last edited by Ariel Linden; 30 May 2025, 17:30.
Working...
X