HP3000-L Archives

September 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:
Gary Robillard <[log in to unmask]>
Reply To:
Gary Robillard <[log in to unmask]>
Date:
Tue, 9 Sep 2008 21:16:26 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (103 lines)
Hi Daniel,

If I use your code (cut/paste) in HP C *with* the "pragma intrinsic
HPCICOMMAND", everything works fine.

If I remove "#pragma intrinsic HPCICOMMAND", I get the same error you get.

The reason is that HPCICOMMAND is written in Pascal, and has extensible
parameters, which requires some
"hidden" values to be passed indicating which parameters are present. The
"pragma intrinsic" directive causes the HP C compiler to pass the "hidden"
values.

The simplest solution would be to substitute the COMMAND intrinsic for the
HPCICOMMAND intrinsic.

The COMMAND intrinsic is not extensible, and only accepts the 3 parameters
you are passing to the HPCICOMMAND intrinsic. You can change your code
simply by changing the routine you call from HPCICOMMAND to COMMAND:

        ...
        COMMAND(cmdbuf, &cmderror, &parmnum);
        ...


Thanks,

Gary Robillard




-----Original Message-----
From: HP-3000 Systems Discussion [mailto:[log in to unmask]] On Behalf
Of Daniel Griffin
Sent: Tuesday, September 09, 2008 11:13 AM
To: [log in to unmask]
Subject: Re: [HP3000-L] HPCICOMMAND again

Someone off list suggested I stop using /r and instead append a 13 to 
the end of the string.
This changes the error to:

BOUNDS VIOLATION   (FSERR 73)
Invalid message level - expected 0, 1, 2. (CIWARN 9007)
û ÙPSHOWTIME > TIME.GECS.SYS
Invalid first character in command name. (CIERR 9090)
New Err -15361 9090

The code now looks like:
int     main (int arg,char* argv[])
{
        short cmderror;
        short parmnum;
        char  cmdbuf[256];
        memset(cmdbuf, 0, 256);
        strcpy(cmdbuf, "SHOWTIME > TIME.GECS.SYS");
        *(cmdbuf + strlen(cmdbuf)) = (char)13;
        HPCICOMMAND(cmdbuf, &cmderror, &parmnum);
        printf("New Err %d %d\n", cmderror, parmnum);

return 0;
}

This is even more confusing, this is just a normal ascii string.



Keven Miller (rtt) wrote:
> Daniel Griffin wrote:
>>        HPCICOMMAND("SHOWTIME > TIME.GECS.SYS\r", &cmderror, &parmnum);
>>
>> I am compiling on version 6.5 in the Posix shell using GCC. (The 
>> source is obviously C and has to remain C). Is this a bug or am I 
>> doing something wrong? I have tried a variety of command lines and 
>> different string formats with no effect.
>
> Because your using GCC, beware of system intrinsics that have documented
> (and undocumented) optional parameters.
>
> HICICOMMAND has 4 parameters. Although the intrinsic manual says
> the last two are optional, GCC doesn't know that.
> So you have to provide the missing parameters or mask or which ever
> the intrinsic is looking for.
>
> Note that parm 4 does say it defaults to a value of 0.
> So
>    HPCICOMMAND("SHOWTIME > TIME.GECS.SYS\r", &cmderror, &parmnum, 0 );
>
> should work in this case.
>
> Keven
>
> * To join/leave the list, search archives, change list settings, *
> * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
>

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

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

ATOM RSS1 RSS2