comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: outputting formated text version of code
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: outputting formated text version of code [message #13678] Mon, 07 December 1998 00:00
Brad Gom is currently offline  Brad Gom
Messages: 49
Registered: August 1997
Member
Robert S. Mallozzi wrote:

> If you are using UNIX, try the program a2ps. I wrote a style
> file for that program for IDL. a2ps doesn't do color (I don't
> think), but it will highlight key words, comments, etc. and
> make a Postscript file that you can include into a document.
> See http://www-inf.enst.fr/~demaille/a2ps/

unfortunately I'm running windows, and I couldn't get a2ps to work properly.
Thanks anyhow.
Re: outputting formated text version of code [message #13680 is a reply to message #13678] Mon, 07 December 1998 00:00 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
&nbsp;
<p>Brad Gom wrote:
<blockquote TYPE=CITE>&nbsp;
<p>R.Bauer wrote:
<blockquote TYPE=CITE>&nbsp;
<br>Do you think about something like this?
<p><font color="#009900"> ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ; Written
by:&nbsp;&nbsp;&nbsp;&nbsp; R.Bauer (ICG-1), 1998-Dec-07</font>
<br><font color="#009900">;-</font>
<br><font color="#CC0000">PRO</font><font color="#000000"> x_breaker_event,ev</font>
<br><font color="#000000">&nbsp;&nbsp; </font><font color="#000099">WIDGET_CONTROL</font><font color="#000000">,
ev.id, get_uval=cmd</font>
<br>&nbsp;</blockquote>
Yep, exactly. I assume you have control over the html codes that are generated?
<p>Brad Gom</blockquote>
Yes, I have.
<br>It uppercases the RSI Routines too and did the formatting of&nbsp;
the whole syntax
<br>and it is written totaly in IDL .
<p>Now I think you will ask if you can use it.
<p>Yes, but you have to wait a few days, because it is part of a library
which we will published I hope before Christmas.
<br>&nbsp;
<p>R.Bauer
<br>&nbsp;
<br>&nbsp;</html>
Re: outputting formated text version of code [message #13684 is a reply to message #13678] Mon, 07 December 1998 00:00 Go to previous message
mallors is currently offline  mallors
Messages: 76
Registered: November 1997
Member
In article <366B381B.7885B915@uleth.ca>,
Brad Gom <gombg@uleth.ca> writes:
> I want to include some of my code in my thesis, so I need to be able to
> import the code into a document.
> Does anyone know of a routine that will convert a .pro file to a
> document that preserves the syntax highlighting seen in the IDL window?
> Copying the code from within IDL 5.0 doesn't allow me to paste it into a
> word processor with its formatting intact.
>
> I figure it would be possible to write a small program that would
> convert a source file into a rich-text-format document by searching for
> various keywords and inserting the appropriate format statements, but I
> don't really have the time to look into it.
>
> Anyone have any suggestions?

If you are using UNIX, try the program a2ps. I wrote a style
file for that program for IDL. a2ps doesn't do color (I don't
think), but it will highlight key words, comments, etc. and
make a Postscript file that you can include into a document.
See http://www-inf.enst.fr/~demaille/a2ps/


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~
Robert S. Mallozzi 256-544-0887
Mail Code ES 84
Work: http://www.batse.msfc.nasa.gov/ Marshall Space Flight Center
Play: http://cspar.uah.edu/~mallozzir/ Huntsville, AL 35812
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~
Re: outputting formated text version of code [message #13687 is a reply to message #13678] Mon, 07 December 1998 00:00 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
<PRE>



<FONT COLOR="#009900">; Copyright (c) 1998, Forschungszentrum Juelich GmbH ICG-1</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; All rights reserved.</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; Unauthorized reproduction prohibited.</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; This software may be used, copied, or redistributed as long as it is not</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; sold and this copyright notice is reproduced on each copy made. This</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; routine is provided as is without any express or implied warranties</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; whatsoever.</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">;</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">;+</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; NAME:</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; x_breaker</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">;</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; PURPOSE:</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; This widget procedure is used to break a routine by sending a breakpoint</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">;</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; CATEGORY:</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; PROG_TOOLS/WIDGETS</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">;</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; CALLING SEQUENCE:</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; x_breaker</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">;</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">;</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; EXAMPLE:</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; PRO test</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; result=x_breaker()</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; FOR i=0l,100000l DO BEGIN</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; res=WIDGET_EVENT(result.base,/nowait)</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; WAIT,0.01</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; PRINT,i</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; ENDFOR</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; END</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">;</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">;</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; MODIFICATION HISTORY:</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">; Written by: R.Bauer (ICG-1), 1998-Dec-07</FONT><FONT COLOR="#000000">
<FONT COLOR="#009900">;-</FONT><FONT COLOR="#000000">


<FONT COLOR="#CC0000">PRO</FONT> x_breaker_event,ev
<FONT COLOR="#000099">WIDGET_CONTROL</FONT>, ev.id, get_uval=cmd
<FONT COLOR="#000099">WIDGET_CONTROL</FONT>, ev.top, get_uval=map
<FONT COLOR="#000099">WIDGET_CONTROL</FONT>, map.base, get_uval=struct
<FONT COLOR="#CC0000">IF</FONT> <FONT COLOR="#3366FF">SIZE</FONT>(cmd,/type) <FONT COLOR="#CC0000">NE</FONT> 8 <FONT COLOR="#CC0000">THEN</FONT> <FONT COLOR="#CC0000">BEGIN</FONT>
<FONT COLOR="#CC0000">CASE</FONT> cmd[0] <FONT COLOR="#CC0000">OF</FONT>
'<FONT COLOR="#FF6666">BREAK</FONT>': <FONT COLOR="#CC0000">BEGIN</FONT>
<FONT COLOR="#000099">HELP</FONT>,call=call
line=<FONT COLOR="#3366FF">LONG</FONT>((<FONT COLOR="#3366FF"><FONT COLOR="#3366FF">STR_SEP</FONT></FONT>((STR_SEP(call[1],'('))[1],')'))[0])
file=(<FONT COLOR="#3366FF"><FONT COLOR="#3366FF">STR_SEP</FONT></FONT>((STR_SEP(call[1],' <'))[1],'('))[0]
<FONT COLOR="#000099">BREAKPOINT</FONT>,file,line
<FONT COLOR="#CC0000">END</FONT>
<FONT COLOR="#CC0000">ELSE</FONT>:
<FONT COLOR="#CC0000">ENDCASE</FONT>
<FONT COLOR="#CC0000">ENDIF</FONT>
<FONT COLOR="#CC0000">END</FONT>


<FONT COLOR="#CC0000">FUNCTION</FONT> x_breaker
base=<FONT COLOR="#3366FF">WIDGET_BASE</FONT>(col=3,title='<FONT COLOR="#FF6666">Break a running Script</FONT>')
id_break=<FONT COLOR="#3366FF">WIDGET_BUTTON</FONT>(base,Value='<FONT COLOR="#FF6666"><FONT COLOR="#FF6666">BREAK</FONT></FONT>',UVALUE='BREAK',/ALIGN_CENTER,event_pro=' <FONT COLOR="#FF6666">x_breaker_event</FONT>')
result={base:base}
<FONT COLOR="#000099">WIDGET_CONTROL</FONT>,base,set_uval= result,/realize , /XMANAGER_ACTIVE_COMMAND
<FONT COLOR="#CC0000">RETURN</FONT>,result
<FONT COLOR="#CC0000">END</FONT>
Re: outputting formated text version of code [message #13689 is a reply to message #13678] Mon, 07 December 1998 00:00 Go to previous message
mirko_vukovic is currently offline  mirko_vukovic
Messages: 50
Registered: January 1998
Member
In article <366B381B.7885B915@uleth.ca>,
Brad Gom <gombg@uleth.ca> wrote:
> I want to include some of my code in my thesis, so I need to be able to
> import the code into a document.
> Does anyone know of a routine that will convert a .pro file to a
> document that preserves the syntax highlighting seen in the IDL window?
> Copying the code from within IDL 5.0 doesn't allow me to paste it into a
> word processor with its formatting intact.
>
> I figure it would be possible to write a small program that would
> convert a source file into a rich-text-format document by searching for
> various keywords and inserting the appropriate format statements, but I
> don't really have the time to look into it.
>
> Anyone have any suggestions?
>
>
Can't you paste it into your document,and then specify a fixed spacing font?

Mirko

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Are .SAV files platform independent?
Next Topic: Re: New dollar coin designed using IDL (please vote)

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:21:00 PDT 2025

Total time taken to generate the page: 0.00678 seconds