1. Standard Output...

Hello Everyone,

I'm currently using Euphoria on Linux and I'm trying to figure out if
there is a way I can use stdout instead of the default way Euphoria
outputs to the screen.  I'm doing a short application that makes several
system calls (to which I'd like to see the output) and as soon as the
program finishes I get returned to "Euphoria's Page" that only has
output that I've put there using puts or printf.  I'm using system_exec
for execution of outside programs.  A "puts("test",1)" and
"puts("test",2)" seems to make no difference.

Thanks in advance,

Doug Miller

new topic     » topic index » view message » categorize

2. Re: Standard Output...

Kenneth Roger writes:
> I'm using Euphoria for Windows from the command line 
> and am trying to find out if there is a way to use the 
> command window I'm working from instead of opening a new one. 

If you search the March 2002 mailing list archive,
for:
     setsubsys

http://www.rapideuphoria.com/cgi-bin/esearch.exu?fromMonth=3&fromYear=7&toMonth=3&toYear=7&postedBy=&keywords=setsubsys

you'll discover a little freeware utility that converts Windows GUI apps
into Windows console apps. That should do what you want.
I think you can either modify exw.exe, or modify your 
translated/compiled programs.
I haven't thoroughly tested it yet. I'll put it on Recent User
Contributions after I get around to testing it some more.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

3. Re: Standard Output...

Doug Miller writes:
> I'm currently using Euphoria on Linux and I'm trying to figure out if
> there is a way I can use stdout instead of the default way Euphoria
> outputs to the screen.  I'm doing a short application that makes several
> system calls (to which I'd like to see the output) and as soon as the
> program finishes I get returned to "Euphoria's Page" that only has
> output that I've put there using puts or printf. 

Euphoria (exu) uses ncurses for output to the screen from
puts, printf etc. After a system() or system_exec() call, 
exu restores the screen to the way it was, to avoid 
causing confusion for ncurses.

I wonder if you could redirect your system() call output into
a file, and then display the file. e.g.  system("command > temp", 2)

In the future there might be a way to "turn off" ncurses for
Euphoria programs that don't want it.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

4. Re: Standard Output...

There are 2 ways to do this. The first easy (and hacked) method
uses system(). The second (more compicated) method uses C calls to
do screen io directly and bypass ncurses.

For the first method, you can just copy this procedure:

procedure echo_puts(sequence s)
system("echo -e "&s, 2)
free_console()
end procedure

This will use the command echo to show data on the screen
(free_console(),
which is in dll.e, is needed to avoid the "Press Enter ..." prompt
which comes up at the end of any Linux Euphoria program).

For the second method, you can use C calls to glibc directly to
show your information. I have already done this and instead of
explaining
how to do it, I will make an announcement to this list when I have
placed
the library on my download site.

jbrown

On  0, orkim at kc.rr.com wrote:
> 
> Hello Everyone,
> 
> I'm currently using Euphoria on Linux and I'm trying to figure out if
> there is a way I can use stdout instead of the default way Euphoria
> outputs to the screen.  I'm doing a short application that makes several
> system calls (to which I'd like to see the output) and as soon as the
> program finishes I get returned to "Euphoria's Page" that only has
> output that I've put there using puts or printf.  I'm using system_exec
> for execution of outside programs.  A "puts("test",1)" and
> "puts("test",2)" seems to make no difference.
> 
> Thanks in advance,
> 
> Doug Miller
>

new topic     » goto parent     » topic index » view message » categorize

5. Re: Standard Output...

On 17/4/2002, Robert Craig wrote:

> In the future there might be a way to "turn off" ncurses for
> Euphoria programs that don't want it.

Hear hear !

Make that one a priority. Apart from the fact that ncurses generally
stinks for most programmes, the redirection bug where stdout and stderr
get mixed up totally cripples Euphoria - I have been doing something
today where I needed to use both and it just made a huge mess.

-- 
Blessings,
Daniel Johnson		euphoria at ahava.f9.co.uk
-
Do you let other people open your post ?
Did you know that *anybody* can read your email ?
             http://www.pgp.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu