To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 703
702  |  704
Subject: 
Re: NQC stdin & stdout
Newsgroups: 
lugnet.robotics.rcx.nqc
Date: 
Tue, 15 Aug 2000 22:26:37 GMT
Viewed: 
1949 times
  
Dave Baum wrote:

In article <3990D5A1.9635859E@akasa.bc.ca>, Dean Husby
<nntp@akasa.bc.ca> wrote:

I'm looking for some way in windows to send files to and from stdin &
stdout.

I'm not 'C' savvy.  I'm building a macro set for a editor to NQC for the
disabled and would like to talk to NQC via the above.

If I can't talk to it directly I'd love a cmd line program that, when
run, takes the contents of the Clip board and sends that to NQC via
stdin. I can handle the output by way of a file if need be.

I'm not sure about the specific calls, but when you invoke one program
from another you typically can control what file handles are used as
stdin, stdout, and stderr by the launched program.  Usually these are
just handed off from stdin/stdout/stderr of the calling program, but you
should be able to make them anything you want.

Sending data from the clipboard (or any other memory) may be tricky.
I'm not very familiar with Windows, but under Unix I'd probably have the
calling program create a pipe and hand the other end of the pipe to the
callee as stdin.  Then the caller could just stuff all the data into the
pipe and close it, and the callee would see the data on stdin and then
also see an EOF.

From a more practical standpoint (given that I'm unfamiliar with the
Windows capabilities for exec'ing tasks, pipes, etc), if I had to do
this I'd probably take the lazy way out and have the calling program
just create a temp file, and pass that on the command line to NQC.
Inelegant, but very easy to implement.


Yes, that would be the easiest way but also the most annoying as it forces me
to change the file name on the users editor. I'm looking in to a DDE command
way to avoid this, but so far without success.

Thanks for your help btw.

Dean
--
Coin-Op's For Sale!: http://www.akasa.bc.ca/tfm/coin-op.html
Dean's Lego Workshop: http://www.akasa.bc.ca/tfm/lego_wr.html
Vancouver Lego Club: http://www.akasa.bc.ca/vlc



Message has 1 Reply:
  Re: NQC stdin & stdout
 
(...) Could you copy the entire contents to the clipboard, then have your program write the clipboard data to a temp file? (you'd still avoing having to create pipes, etc) Dave Baum (24 years ago, 16-Aug-00, to lugnet.robotics.rcx.nqc)

Message is in Reply To:
  Re: NQC stdin & stdout
 
(...) I'm not sure about the specific calls, but when you invoke one program from another you typically can control what file handles are used as stdin, stdout, and stderr by the launched program. Usually these are just handed off from (...) (24 years ago, 13-Aug-00, to lugnet.robotics.rcx.nqc)

7 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR