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

5965Re: [Clip] Highlighting text for programs

Expand Messages
  • Alan C.
    Mar 3, 2001
      Hi Ray,

      >Yes, I can run the line numbering perl program in the samples library, but I
      >have never been able to get any of MY perl programs to run. (To run perl, I

      The line numbering uses two clips, one of them (the clip with the grey header) is called from the first clip. The "Perl script" (1st clip) appears to me it is an actual NoteTab "Clip" while the 2nd ("PerlNumLines") looks like it is a Perl type of script language, not a NoteTab "Clip" language.

      So, it appears to me that was just one method of calling up a Perl script, demonstrated in the SampleCode library. Since it worked for you . . . then perhaps the issue surrounds the mechanics of "how do you call up a Perl script on your computer" But for list topic purpose, I share a clip in the following

      and the following is just one method of even several more methods with which to call up (execute) a perl file.

      I don't know what you need or what you are looking for. But, just to share, an experience that worked/succeeded for me (yeah!!) as follows.

      I'm a beginner on Perl. And I noticed some of the beginner Perl files are with .plx file extension, not .pl file extension. Nonetheless, they run on activestate perl.

      As follows, mainly, I have 2 items portrayed. One is a clip. The 2nd is a Perl (.plx) file. The clip, when launched, the clip activates or runs a Perl script that is opened as the current document in NoteTab.

      **Key: So, you must have a .plx file opened and currently focused in NoteTab then you run the clip.

      when used in combination, the following (clip and .plx file) calls up a simple perl file which prints to the console window, reports "Hello World" (wihout the quotes)

      In the perlstuff below, copy everything between (do not copy the quoted start and end lines) the start and end lines and save it to a file named ch1a.plx

      then, open ch1a.plx in NoteTab. then launch the clip.

      ^!IfSame ^$Getext(^**)$ .plx Skip_2
      ^!Info [L]^**^%nl% is not a .plx file. So, END
      ^!Goto Exit^!IfAppOpen "C:\WINDOWS\System32\cmd.exe" skip
      ^!FocusApp "C:\WINDOWS\System32\cmd.exe"
      ^!Set %curdoc%=^**

      ^!Delay 3
      ^!Keyboard #perl ^%curdoc%# ENTER
      ;--<end of clip<<

      In the above clip, the following lines

      ^!IfAppOpen "C:\WINDOWS\System32\cmd.exe" skip
      ^!FocusApp "C:\WINDOWS\System32\cmd.exe"

      might need to be

      ^!IfAppOpen "C:\winnt\System32\cmd.exe" skip
      ^!FocusApp "C:\winnt\System32\cmd.exe"

      Because, essentially, you'll need the path to cmd.exe in there is what you will need. You might get by with just "cmd.exe" in those two path statements.

      Perlstuff follows.

      "perl start"
      # ch1a

      print ("Hello, world!\n");
      "perl end"

      Regards, Alan.
    • Show all 14 messages in this topic