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

[Clip] Re: Weird behavior when running perl clips

Expand Messages
  • 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 1 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 2 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 3 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 4 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 5 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.