Another feature request (was 'crash_file')

new topic     » topic index » view thread      » older message » newer message

What I'd like to see is the ability to pass multiple file handles to
output routines, puts(), print(), etc. So I could print information to
a file and the screen at the same time. Take this for example:

constant debug = 1    -- set to 1 to send debug information to a file

object out
    out = 1    -- send to screen

    if debug then
        out &= open("debug.out", "w")    -- send to debug.out too
    end if

    -- just do this:
    puts(out, "information")    -- only one call to puts!

    -- insted of this:
--  puts(1, "information")
--  puts(out, "information")

    if debug then
        close( out[2] )
    end if


~Greg
if good( idea ) then
    my += 0.02    -- two more cents
else
    blame( too_much_caffiene & RedBull )
end if



On Fri, 29 Oct 2004 07:33:13 -0700, Bernie Ryan <guest at rapideuphoria.com>
wrote:
> 
> posted by: Bernie Ryan <xotron at bluefrog.com>
> 
> 
> Robert Craig wrote:
> >
> > Bernard Ryan wrote:
> > >   Why don't you return a file number when a user
> > > uses crash_file() then a user could add information
> > > to file for trouble shooting purposes as he runs
> > > through their program's code.
> >
> > I think having a separate file is better.
> >
> > Using trace(3), I have, on occasion, written extra debug
> > information to "ctrace.out".
> > Since ctrace.out is flushed after each statement, you can
> > printf() some values into it, and they will appear between
> > the appropriate statements in that file. You just have
> > to open it for append, mode "a", and then flush() it.
> > I made a little routine to do that.
> >
> > Regards,
> >    Rob Craig
> >    Rapid Deployment Software
> 
> 
> But how do i get access to the file handle ?
> 
> Bernie
> 
> My files in archive:
> w32engin.ew mixedlib.e eu_engin.e win32eru.ew
> 
> Can be downloaded here:
>
> http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=bernie+ryan
> 
> 
> 
> 
>

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu