HP3000-L Archives

July 2008, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Francois Desrochers <[log in to unmask]>
Reply To:
Francois Desrochers <[log in to unmask]>
Date:
Tue, 8 Jul 2008 15:32:47 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (98 lines)
Mike,
 
The Cobol sample used "%15" to include a carriage-return. This is an octal value so the actual decimal equivalent is 13. So, I think it should be "(char) 13" and not "(char)15".
 
I believe "\r" should have worked in C however.
 
HTH
François

________________________________

From: HP-3000 Systems Discussion on behalf of Michael Mileusnich
Sent: Tue 7/8/2008 3:36 PM
To: [log in to unmask]
Subject: Re: [HP3000-L] CREATEPROCESS and other questions...



I am still receiving the same error.

My code is:

//cmd is put on the stack and a command line like LISTFILE is put into it
*(cmdline+strlen(cmdline)+1) = (char)15;
HPCICOMMAND(cmdline, &createstatus);

This should overwrite the null terminator with a carriage return. I have
also tried strcat(cmdline , "\r"), strcat(cmdline, "\r "); and basically
every combination of a space and a carriage return, with a null terminator
and without. I have also tried using (char)15 instead of \r and that didnt
work. I have also tried memsetting the whole buffer to 15 or '\r'.



On Mon, Jul 7, 2008 at 11:20 PM, Walter J. Murray <[log in to unmask]>
wrote:

> Mike asked:
>
> > I am porting a C application over to MPE/iX and I have some questions
> > regarding CREATEPROCESS.  It seems CREATEPROCESS only lets me launch
> an
> > executable program.  What do I need to use if I wanted to STREAM a job
> or
> > run an internal command such as a LISTFILE?  Also, when using
> > CREATEPROCESS,
> > the executable in which I want to launch will only launch if the
> > executable
> > is in the same group as my application.
>
> For an easy way to execute commands from a C program, try the system()
> function.  It calls HPCICOMMAND for you, and you don't have to append a
> carriage-return.
>
> You can even use it to execute a RUN command, so you might not need to
> use CREATEPROCESS.
>
> Here's a sample program.
>
> -----cut here-----
> #include <stdio.h>
> #include <stdlib.h>
> int main(void)
> {
>   int return_value;
>   /* Invoke our favorite text editor */
>   return_value=system("RUN EDITOR.PUB.SYS");
>   if (!return_value)
>      {
>      puts("Everything is fine!");
>      return EXIT_SUCCESS;
>      }
>   else
>      {
>      puts("*** OOPS! ***");
>       return EXIT_FAILURE;
>      }
> }
> -----cut here-----
>
> Walter
>
> Walter J. Murray
>
>
>

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html * 
 
Remarque - Cette transmission est pour l'usage exclusif du ou des destinataires indiqués et peut contenir de l'information confidentielle ou protégée. Si vous n'êtes pas le destinataire indiqué, veuillez supprimer cette transmission ainsi que tout fichier joint et aviser l'expéditeur par courriel immédiatement. Toute révision, utilisation, divulgation ou distribution non autorisée est interdite.
 
 
Notice: This transmission is for the sole use of the intended recipient(s) and may contain information that is confidential and/or privileged.  If you are not the intended recipient, please delete this transmission and any attachments and notify the sender by return email immediately.  Any unauthorized review, use, disclosure or distribution is prohibited.

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2