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

Weird behavior when running perl clips

Expand Messages
  • Piotr Bienkowski
    Hi, when I run a Perl clip on a text document in Notetab Pro, the screen goes completely black for a moment, as if the system was switching the display to the
    Message 1 of 9 , Jan 11, 2003
    • 0 Attachment
      Hi,

      when I run a Perl clip on a text document in Notetab Pro, the screen goes completely
      black for a moment, as if the system was switching the display to the text mode. The
      clip works alright and the result is displayed in Notetab Pro, but this behavior is
      annoying. How can I fix it?

      My setup is:

      1. Notetab Pro: 4.91

      2. Windows XP Home Ed.

      3. Perl 5.8.0

      Will appreciate your help.

      Piotr
    • Sheri <silvermoonwoman@comcast.net>
      What syntax are you using to run your Perl? That doesn t happen to me in W98SE using ^!RunPerl. I do see all the lines in the file get highlighted. I can avoid
      Message 2 of 9 , Jan 11, 2003
      • 0 Attachment
        What syntax are you using to run your Perl? That doesn't happen to me
        in W98SE using ^!RunPerl. I do see all the lines in the file get
        highlighted. I can avoid that by preceding the ^!RunPerl with

        ^!SetScreenUpdate Off

        Regards,
        Sheri
      • Piotr Bienkowski
        ... I use ^!FocusDoc and ^!RunPerl with the name of the clip containing Perl code. I guess that the screen going black (completely black, with no program
        Message 3 of 9 , Jan 11, 2003
        • 0 Attachment
          On 11 Jan 2003 at 13:48, Sheri silvermoonwoman@... wrote:

          > What syntax are you using to run your Perl? That doesn't happen to me
          > in W98SE using ^!RunPerl. I do see all the lines in the file get
          > highlighted. I can avoid that by preceding the ^!RunPerl with
          >
          > ^!SetScreenUpdate Off



          I use ^!FocusDoc and ^!RunPerl with the name of the clip containing Perl code.
          I guess that the screen going black (completely black, with no program windows
          visible) has to do with the way Win XP handles calls to command line programs, but I
          don't know what to do to prevent it

          Regards,

          Piotr
        • hsavage
          ... Piotr, I have a box with XP on it but haven t gotten into it yet so this is a shot in the dark. Is it possible that when running a commandlline program XP
          Message 4 of 9 , Jan 11, 2003
          • 0 Attachment
            Piotr Bienkowski wrote:

            >On 11 Jan 2003 at 13:48, Sheri silvermoonwoman@... wrote:
            >
            >
            >
            >>What syntax are you using to run your Perl? That doesn't happen to me
            >>in W98SE using ^!RunPerl. I do see all the lines in the file get
            >>highlighted. I can avoid that by preceding the ^!RunPerl with
            >>
            >>^!SetScreenUpdate Off
            >>
            >>
            >
            >
            >
            >I use ^!FocusDoc and ^!RunPerl with the name of the clip containing Perl code.
            >I guess that the screen going black (completely black, with no program windows
            >visible) has to do with the way Win XP handles calls to command line programs, but I
            >don't know what to do to prevent it
            >
            >Regards,
            >
            >Piotr
            >
            >
            Piotr,

            I have a box with XP on it but haven't gotten into it yet so this is a
            shot in the dark.

            Is it possible that when running a commandlline program XP opens
            something like a dos window? If it does maybe the dos window is using
            the full screen and if it is that might be regulated by finding the
            proper .pif file and making the necessary settings adjustments to
            prevent it from happening.

            hrs
          • Sheri <silvermoonwoman@comcast.net>
            Hi Piotr, Unless you have seen the exact same code, clip and file names respond differently under a different Windows OS, you might want to post all your code
            Message 5 of 9 , Jan 11, 2003
            • 0 Attachment
              Hi Piotr,

              Unless you have seen the exact same code, clip and file names respond
              differently under a different Windows OS, you might want to post all
              your code and file details to see how it works for others.

              Regards,
              Sheri
            • Manuel123
              I don t understand. Could you send me an example. ^$StrSort( Str ;CaseSensitive;Ascending;RemoveDuplicates)$ (added in v4.52) Returns the specified text Str
              Message 6 of 9 , Jan 11, 2003
              • 0 Attachment
                I don't understand. Could you send me an example.

                ^$StrSort("Str";CaseSensitive;Ascending;RemoveDuplicates)$ (added in
                v4.52)
                Returns the specified text "Str" sorted according to the defined
                criteria. For example, the following instruction will sort the lines
                contained in the Clipboard, in ascending order, ignoring character
                case, and removing duplicates

                I trie the next but don't work.

                The text in the document is
                Madrid
                Madrid
                Barcelona

                ^!set %ok%=^$StrSort(^$GetText$;Ascending)$
                ^!Info ^%ok%
                ---
                Cursos para ciegos
                Windows,Iexplorer,Outlook,Html,Word,Excel,Access
                ALTAS/BAJAS avisarte cursos en http://www.solotxt.com
              • Alan C.
                ... I haven t used FocusDoc. But RunPerl works fine here: Win 2k SP2 NTP 492 ActiveState Perl 5.61 (just a guess, a query really) OS user permissions? a
                Message 7 of 9 , Jan 11, 2003
                • 0 Attachment
                  At 04:15 PM 1/11/2003 +0100, you wrote:
                  >On 11 Jan 2003 at 13:48, Sheri silvermoonwoman@... wrote:
                  >
                  >> What syntax are you using to run your Perl? That doesn't happen to me
                  ><snipped>
                  >
                  >I use ^!FocusDoc and ^!RunPerl with the name of the clip containing Perl code.

                  I haven't used FocusDoc. But RunPerl works fine here: Win 2k SP2 NTP 492 ActiveState Perl 5.61

                  (just a guess, a query really) OS user permissions? a user's permissions versus an administrator's permissions. I run with administrator privileges/permissions though I don't endorse this practice.

                  H="pl_leadspace_trimr"
                  ^!RunPerl pl_trmleadspace

                  H="_pl_trmleadspace"
                  #!/perl/bin/perl -w
                  while (<>) {
                  s/^ +//;
                  print "$_";
                  }


                  H="pl_conditional_line_joiner"
                  ^!RunPerl pl_joinlines

                  H="_pl_joinlines"
                  #!/perl/bin/perl -w
                  # removes \n from line(s) but does so only if line(s)
                  # are NOT 1. begin with a dot 2. end of string.
                  # undef $/; # Enter "file slurp" mode.
                  # $text = <>; # This file/selection slurped into the scalar
                  $text = do { local $/; <> };
                  $text =~ s/\n(?!\.|\z)/ /g;
                  print $text;
                  # end

                  --
                  Alan.
                • Sheri <silvermoonwoman@comcast.net>
                  ... Hi Manuel, You have to give boolean specs for each of the options in order; each (i.e., CaseSensitive;Ascending;RemoveDuplicates) can be True/False,
                  Message 8 of 9 , Jan 11, 2003
                  • 0 Attachment
                    --- In ntb-clips@yahoogroups.com, Manuel123 <manuel123@s...> wrote:
                    > I don't understand. Could you send me an example.
                    >
                    > ^$StrSort("Str";CaseSensitive;Ascending;RemoveDuplicates)$ (added in
                    > v4.52)
                    > Returns the specified text "Str" sorted according to the defined
                    > criteria. For example, the following instruction will sort the lines
                    > contained in the Clipboard, in ascending order, ignoring character
                    > case, and removing duplicates
                    >
                    > I trie the next but don't work.
                    >
                    > The text in the document is
                    > Madrid
                    > Madrid
                    > Barcelona
                    >
                    > ^!set %ok%=^$StrSort(^$GetText$;Ascending)$
                    > ^!Info ^%ok%

                    Hi Manuel,

                    You have to give boolean specs for each of the options in order; each
                    (i.e., CaseSensitive;Ascending;RemoveDuplicates) can be True/False,
                    Yes/No, or 1/0.

                    Might want to try my Clipcode Syntax clip to help avoid syntax
                    problems.

                    http://groups.yahoo.com/group/ntb-clips/files/ClipcodeSyntax_v4.02.zip

                    Regards,
                    Sheri
                  • hsavage
                    ... Manuel123, Try this. The digit 1 equals true and the digit 0 equals false . h=strsort ^!set %ok%=^$StrSort(^$GetText$;1;1;0)$ ^!Info ^%ok% hrs
                    Message 9 of 9 , Jan 11, 2003
                    • 0 Attachment
                      Manuel123 wrote:

                      >I don't understand. Could you send me an example.
                      >
                      >^$StrSort("Str";CaseSensitive;Ascending;RemoveDuplicates)$ (added in
                      >v4.52)
                      >Returns the specified text "Str" sorted according to the defined
                      >criteria. For example, the following instruction will sort the lines
                      >contained in the Clipboard, in ascending order, ignoring character
                      >case, and removing duplicates
                      >
                      >I trie the next but don't work.
                      >
                      >The text in the document is
                      >Madrid
                      >Madrid
                      >Barcelona
                      >
                      >^!set %ok%=^$StrSort(^$GetText$;Ascending)$
                      >^!Info ^%ok%
                      >
                      >
                      Manuel123,

                      Try this. The digit "1" equals "true" and the digit "0" equals "false".

                      h=strsort
                      ^!set %ok%=^$StrSort(^$GetText$;1;1;0)$
                      ^!Info ^%ok%


                      hrs
                    Your message has been successfully submitted and would be delivered to recipients shortly.