Announcement

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

  • How can I create a customized welcome result window in STATA 14.

    I would like to see a welcome message every time I open stata. Pls, guide me on how to do this? Thanks

  • #2
    help profile
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Maarten Buis Thanks. I created a profile.do as mentioned in the help command. But display "welcome name" is not working. Any other command to write in profile.do

      Comment


      • #4
        "is not working" tells us that you were expecting something and Stata did something else. That is not very much to go on... Can you tell us more on what exactly you did, and what exactly you expected that to do, and what exactly Stata did instead?
        ---------------------------------
        Maarten L. Buis
        University of Konstanz
        Department of history and sociology
        box 40
        78457 Konstanz
        Germany
        http://www.maartenbuis.nl
        ---------------------------------

        Comment


        • #5
          Sorry for not being clear and delayed response. I created a file namad Profile.ado (the command I typed was display "my name, everytime I opens my stata window" in the path C:\Users\Rukman\ado\plus, expecting that stata will display my name everytime I opens a new window. Thanks in advance

          Comment


          • #6
            You need to specify noisy output:

            Code:
            noisily: di "your message"
            This is because Stata executes profile.do quietly (the equivalent of hitting CTRL+R instead of CTRL+D in a do-file), so you have to explicitly override that. As a test, you can CTRL+R your profile.do file before saving it to make sure that the output is what you want.

            Comment


            • #7
              Dear Ali Atia, Thanks for the reply. I used the command in profile.do as you said. With Ctrl+R, I am getting my message as you said. I am facing two issues
              1.When I open my stata, it is not searching for profile.do (I presumed this, because stata is opening as normal.
              2. When I open my profile.do I am getting following message in Stata results window.

              C:\Users\Rukman\ado\profile.ado
              command C is unrecognized
              r(199);

              Pardon me if I am not clear. Thanks for the help

              Comment


              • #8
                You need to store it in C:\Users\Rukman\ado\plus, not C:\Users\Rukman\ado (alternatively you can put it in your home directory (usually C:\Users\Rukman), or in any other location on the adopath (e.g., C:\ado\personal). There is a complete list of potential places to put it in the helpfile). As to your second question, you can't open a do file by just typing its location. You need to specify whether to run it, do it, doedit it, etc.:

                Code:
                run "yourfile.do"
                Last edited by Ali Atia; 30 Jan 2021, 04:20.

                Comment


                • #9
                  Thank you Ali Atia for your prompt response.
                  I did a sysdir first.
                  Then I saved the profile.do in C:\Users\Rukman\ado\personal.
                  This is how my profile.do file looks like.
                  Attached my Stata results window also. Even after giving the run command as you said, it didn't start automatically the profile.do. Second thing the command itself is showing this error (when entering directly in Stata)
                  Code:
                  run "C:\Users\Rukman\ado\personal\profile.ado"
                  noisily: di "Dear Rukman, what would you like to do"
                  Click image for larger version

Name:	image_21152.png
Views:	1
Size:	16.9 KB
ID:	1592391


                  Click image for larger version

Name:	image_21153.png
Views:	1
Size:	52.8 KB
ID:	1592392

                  Last edited by sladmin; 01 Feb 2021, 10:06. Reason: obscure license information

                  Comment


                  • #10
                    Remove the first line (run "C:\Users\Rukman\ado\personal\profile.ado") That's telling Stata to run the program, which causes it to run the program, which causes it to run the program, etc., preventing it from ever getting past the first line. When Stata opens, it will run the program automatically. So just keep the second line with the display command and that should work.

                    Comment


                    • #11
                      Also note that you have named your -profile.do- with the -ado- file extension in your screenshots. It should be -profile.do- and not -profile.ado-.

                      Comment


                      • #12
                        Thanks yo both of you Ali Atia and Leonardo Guizzetti , it just worked. First I removed run command from first line and then made Do file instead of ado extension. It worked perfect. Also I added cls before the display command, so that my screen is clear and just the display image.
                        Thanks a ton.

                        Comment

                        Working...
                        X