Loading ...
Sorry, an error occurred while loading the content.

Re: [Clip] Keep DOS Window Open

Expand Messages
  • Larry Thomas
    Hi Jody, ... ^!RunPerl does not open a DOS window at all. It works on the currently focused open document selection or the whole document if nothing is
    Message 1 of 4 , Jun 2, 2000
    • 0 Attachment
      Hi Jody,

      At 09:39 PM 06/02/2000 -0500, you wrote:
      >Hi All,
      >
      >I forgot how to make the DOS Window stay open when running a Perl
      >script, say NumLines for instance in SampleCodes. ???
      >
      >^!RunPerl perl NumLines
      >
      >_Perl NumLines
      >#
      ># \perl\numline.pl
      >#
      ># begin
      >while (<>) {
      > $x=sprintf("%05d",$.);
      > print "$x $_";
      >}
      ># end


      ^!RunPerl does not open a DOS window at all. It works on the currently
      focused open document selection or the whole document if nothing is
      selected. It stores its error messages in a file in the NoteTab folder
      called "StdError.err".

      To run perl from a DOS window and keep the window open, you would need to do:

      ^!Command /k Perl Numlines or some such. My Doslink clip below is a
      demonstration of how to do DOS commands from a batch file in a document or
      a window.

      ---------< start clip >---------
      H="DosLink"
      ;Larry Thomas <larryt@...>
      ;11/20/1999, 08:26:57 PM

      ;----------------------[begin long line]---------------------------
      ^!^?[Select Dos Function==Dos Window^=Goto Dos Command /k|Dos to
      Document^=Goto Dos to Doc]
      ;-----------------------[end long line]----------------------------

      :Dos Command /k
      ^!Deletefile Doscmd.bat
      ^!TextToFile "Doscmd.bat" @echo off^%nl%^?{(T=M)Enter Dos command=}
      ^!Command.com /k doscmd.bat
      ^!Goto Exit

      :Dos to Doc
      ^!Deletefile Doscmd.bat
      ^!TextToFile "Doscmd.bat" @echo off^%nl%^?{(T=M)Enter Dos command=}
      ^!SetClipboard ^$GetOutput("Doscmd.bat")$
      ^!Toolbar Paste New
      ^!Goto Exit
      ---------< end clip >-----------

      When sending output to a new NoteTab document, you must avoid commands such
      as the paging switch (dir /p) or DOS programs that do not use the regular
      DOS screen dump. If you do not, NoteTab will freeze up and you will have
      to use Ctrl+Alt+Delete to close it.

      Regards,

      Larry
      larryt@...
    • Jody
      Hi Larry, ... Thanks, I had tried a .bat and ^$GetOutput(...)$ before writing. I just didn t know how to get my text over and also kept getting a path error
      Message 2 of 4 , Jun 2, 2000
      • 0 Attachment
        Hi Larry,

        > ^!Command /k Perl Numlines or some such.

        Thanks, I had tried a .bat and ^$GetOutput(...)$ before writing.
        I just didn't know how to get my text over and also kept getting
        a path error that is could not find my script. When I saw I got
        the same errors with your's as mine I new where else to look.
        After stumbling around in the dark and finally remembering what
        I needed I came up with this using your command.com line. your

        ^!Deletefile numlines.bat
        ^!TextToFile "Doscmd.bat" @echo off^%nl%perl E:\PROGRAMS\PERL\LIB\NumLines.pl ^##
        ^!Set %Output%=^$GetOutput("numlines.bat")$
        ^!Command.com /k numlines.bat
        ^!SetClipboard ^%Output%
        ^!Toolbar Paste New

        My prblem was I was not putting the path to file in my command so
        perl was just sitting there waiting for it. Had I know what it
        was waiting for... My hind sight is 20/20. ;)

        Thanks!
        Jody

        Clean-Funnies: click and send...
        mailto:c-f@...?subject=Subscribe
      • Larry Thomas
        Hi Jody, ... E: PROGRAMS PERL LIB NumLines.pl ^## ... If I understand correctly ^!RunGawk and ^!RunPerl look for their respective scripts in one of two places.
        Message 3 of 4 , Jun 3, 2000
        • 0 Attachment
          Hi Jody,

          At 11:32 PM 06/02/2000 -0500, you wrote:
          >Hi Larry,
          >
          >> ^!Command /k Perl Numlines or some such.
          >
          >Thanks, I had tried a .bat and ^$GetOutput(...)$ before writing.
          >I just didn't know how to get my text over and also kept getting
          >a path error that is could not find my script. When I saw I got
          >the same errors with your's as mine I new where else to look.
          >After stumbling around in the dark and finally remembering what
          >I needed I came up with this using your command.com line. your
          >
          >^!Deletefile numlines.bat
          >^!TextToFile "Doscmd.bat" @echo off^%nl%perl
          E:\PROGRAMS\PERL\LIB\NumLines.pl ^##
          >^!Set %Output%=^$GetOutput("numlines.bat")$
          >^!Command.com /k numlines.bat
          >^!SetClipboard ^%Output%
          >^!Toolbar Paste New
          >
          >My prblem was I was not putting the path to file in my command so
          >perl was just sitting there waiting for it. Had I know what it
          >was waiting for... My hind sight is 20/20. ;)

          If I understand correctly ^!RunGawk and ^!RunPerl look for their respective
          scripts in one of two places. Either they look in the NoteTab Scripts
          folder for the name you give or in they look for it in the current clipbook
          library as if you were calling it as a subroutine with the ^!Clip command.
          That means that you would have to have your script in the script folder as
          Numlines.pl or in the active clipbook as if it were another clip in order
          to use ^!RunPerl.

          H="Numlines"

          Regards,

          Larry
          larryt@...
        • Jody
          Hi Larry and Wayne, Thanks for your help guys! ... Yes, I knew about calling the script in a Clip, but it never dawned on me to put it in the scripts folder.
          Message 4 of 4 , Jun 4, 2000
          • 0 Attachment
            Hi Larry and Wayne,

            Thanks for your help guys!

            > If I understand correctly ^!RunGawk and ^!RunPerl look for
            > their respective scripts in one of two places. Either they
            > look in the NoteTab Scripts folder for the name you give or in
            > they look for it in the current clipbook library as if you were
            > calling it as a subroutine with the ^!Clip command. That means
            > that you would have to have your script in the script folder as
            > Numlines.pl or in the active clipbook as if it were another
            > clip in order to use ^!RunPerl.

            Yes, I knew about calling the script in a Clip, but it never
            dawned on me to put it in the scripts folder. <g> It does allow
            a path though as my Clip showed.

            > The following clip will open the error file, if any errors were
            > generated.

            Thanks Wayne. I knew how to do the following for an error, but I
            want to see what was going on with or witch error in a window
            which I found out. ;)

            H="Check for error file"
            ^!SET %ERR%=^$GetStdErrorName$
            ^!IFFILEEXIST "^%ERR%" DISPLAYERROR

            Happy Clip'n!
            Jody

            http://www.sureword.com/notetab

            Subscribe, UnSubscribe, Options
            mailto:Ntb-Clips-Subscribe@...
            mailto:Ntb-Clips-UnSubscribe@...
            http://www.egroups.com/group/ntb-clips
          Your message has been successfully submitted and would be delivered to recipients shortly.