perl as tool from PN2 does not send proper output to output window

Discussion Forums discussion perl as tool from PN2 does not send proper output to output window

This topic contains 0 voices and has 13 replies.

Viewing 14 posts - 1 through 14 (of 14 total)
Author Posts
Author Posts
March 5, 2008 at 5:38 pm #351

ryancw
Member

Running windows XP and Programmer’s Notepad version 2.0.08.718.basie

I want to be able to run a perl script by using the tools menu in PN2. I have set up perl in Options . . . Tools (not as a project tool, but as a global one.) I think I have set it up correctly, launching in the current directory, and using the file name parameter (with extension.) If I choose to capture output, then perl seems to run, but only a few random lines of what should be a couple hundred lines appear in the output window, separated by a lot of blank space. If I choose not to capture output, then the script seems to run OK in a command prompt box, but the output goes by so quickly, and then the box closes, so I can’t be entirely sure.

All my LaTeX tools run properly from PN2, so I think I know how to set up tools properly.

Any suggestions on how to get perl to run correctly?

Thanks.

March 6, 2008 at 10:49 am #15741

simon
Key Master

Hi, perl should work fine from inside PN. Can you post your tool configuration, and also some simple perl that reproduces the problem?

Thanks.

March 6, 2008 at 3:23 pm #15742

ryancw
Member

Sure. What’s the best way to “post my tool configuration?” Is there a file I should upload or post? Or screenshots: as you know, the tool configuration involves dialog box with a couple of tabs, so it would require a couple of screenshots. Or should I try to explain it in detail in words? Thanks.

March 6, 2008 at 4:19 pm #15743

simon
Key Master

You could post the contents of the file UserTools.xml from this directory:

XP: c:documents and settings[your user]application dataecho softwarePN2

Vista: c:users[your user]AppDataRoamingEcho SoftwarePN2

March 6, 2008 at 6:37 pm #15744

ryancw
Member

<schemetools><scheme name=”latex”><tool command=”C:Program FilesMiKTeX 2.7miktexbinlatex.exe” flags=”104″ folder=”%d” index=”0″ name=”latex” params=”%n” parsepattern=”" shortcut=”0″></tool><tool command=”C:Program FilesMiKTeX 2.7miktexbinbibtex.exe” flags=”105″ folder=”%d” index=”1″ name=”bibtex” params=”%n” parsepattern=”" shortcut=”0″></tool><tool command=”C:Program FilesMiKTeX 2.7miktexbinyap.exe” flags=”40″ folder=”%d” index=”2″ name=”ViewDvi” params=”%n” parsepattern=”" shortcut=”0″></tool><tool command=”C:Program FilesMiKTeX 2.7miktexbindvips.exe” flags=”41″ folder=”%d” index=”3″ name=”dvi2ps” params=”%n” parsepattern=”" shortcut=”0″></tool><tool command=”C:Program FilesGhostgumgsviewgsview32.exe” flags=”40″ folder=”%d” index=”4″ name=”viewPS” params=”%n.ps” parsepattern=”" shortcut=”0″></tool><tool command=”C:Program FilesMiKTeX 2.7miktexbinps2pdf.exe” flags=”41″ folder=”%d” index=”5″ name=”ps2pdf” params=”%n.ps” parsepattern=”" shortcut=”0″></tool><tool command=”C:Program FilesMiKTeX 2.7miktexbinpdflatex.exe” flags=”41″ folder=”%d” index=”6″ name=”pdflatex” params=”%n” parsepattern=”" shortcut=”0″></tool><tool command=”C:Program FilesAdobeAcrobat 5.0ReaderAcroRd32.exe” flags=”40″ folder=”%d” index=”7″ name=”ViewPDF” params=”%n.pdf” parsepattern=”" shortcut=”0″></tool></scheme><scheme name=”perl”><tool command=”C:Perlbinperl.exe” flags=”41″ folder=”%d” index=”0″ name=”perl” params=”%f” parsepattern=”" shortcut=”0″></tool><tool command=”C:Perlbinperl5.8.8.exe” flags=”41″ folder=”%d” index=”1″ name=”perl588″ params=”%f” parsepattern=”" shortcut=”0″></tool></scheme></schemetools>

March 6, 2008 at 6:38 pm #15745

ryancw
Member

And here’s a piece of code that illustrates the problem:

#!usr/bin/perl -w

print “****** ECHO CHECK ********************”;

March 6, 2008 at 7:01 pm #15746

simon
Key Master

Hi,

I tried this with my local perl install (ActivePerl 5.10.0) and I couldn’t see the same problem. Your settings seem to work fine for me at least with this sample program.

Is it possible that the output that isn’t being captured is being sent to stderr instead of stdout? Even so, that should also be supported.

March 6, 2008 at 8:09 pm #15747

ryancw
Member

Hmm, that’s disappointing. I really like the editor; all the features I need in one editor–a rare find. I’m using ActiveState’s perl 5.8.8, an earlier version than yours. How can I tell whether the uncaptured output is being sent to stderr instead of stdout? And what would be the implications, and the fix, for that?

Alternatively, is there a way I could at least make the command prompt box remain open after the perl script runs? That might help a little.

Thanks.

March 7, 2008 at 9:10 am #15748

simon
Key Master

I’d like to help work out what the differences are here. I take it the output from the ECHO CHECK script you sent me doesn’t show up for you?

Also, what OS are you using?

Out of interest, if you switch to perl.exe instead of perl5.8.8.exe does that make a difference (I don’t really expect it to).

Until we work out the problem, I’m pretty sure something like getc(STDIN) at the end of your script should keep the window open until you’re done.

March 7, 2008 at 6:38 pm #15749

ryancw
Member

Well, I may have made some progress, to my embarrasment. You see, I like to code on a black background, and that’s how I have my PN2 main window configured. The output window is also black (I suppose as a consequence of my setting for the main window?). When I tried my little test script again today, I again saw no output but the file name and a notation about the processing time. But then with an inadvertent mouse gesture, I selected all the text in the output window, and there was “******Echo check******, now white text on blue background, because of being selected! So it may have been working all along!

Now, what settings would you suggest so that I will actually be able to see my output? Are there ways to configure the font color in the output window?

And, is there a way to select-copy-paste the stuff in the output window? I can select the text, and the popup context menu that comes up with a right click has a choice for copy, but it is greyed out and unavailable.

Thanks.

March 7, 2008 at 6:49 pm #15750

ryancw
Member

I found the Output scheme. I was able to adjust the background color for the output window, to light grey, so the black output text shows up. No matter what I tried, I was unable to change the color of the text output produced by my perl script–could only get black.

March 8, 2008 at 10:29 am #15751

simon
Key Master

Oops! Ok, I’ll have a look at the text colour thing, anything that’s black should really default to your default text colour so that when the background changes it doesn’t get lost!

I’ll also look at the copy/paste from output window problem, but Ctrl-C and Ctrl-V should work fine in there.

Thanks for the update.

March 8, 2008 at 4:37 pm #15752

ryancw
Member

Indeed, CTLR-C and CTRL-V work. Thank you. Love the editor!

March 27, 2008 at 6:22 am #15753

NolanVoid
Member

I’ve found that the trick to changing the text color (for example, when you have a black background) is to go to Options > Schemes > Advanced > Output and set the _Whitespace_ Text Colour to a light color. This won’t take effect immediately. You have to quit and restart the application. You can also use this to change the font, size, etc. in the Output window.

It’s not very intuitive — I imagine it will be improved in time.

Viewing 14 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic.