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:
Brian Donaldson <[log in to unmask]>
Reply To:
Brian Donaldson <[log in to unmask]>
Date:
Wed, 10 Sep 2008 23:14:21 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (170 lines)
I will throw in my own 2 cents worth based upon my own experience with
HPCICOMMAND vs COMMAND intrinsics:


If you have an MPE command and a UDC with the same name, HPCICOMMAND
will execute the UDC command and not the MPE command, whereas the COMMAND
intrinsic will execute the MPE command and not the UDC command.


Brian.


On Wed, 10 Sep 2008 09:17:06 -0500, Daniel Griffin
<[log in to unmask]> wrote:

>An HP Engineer contacted me off list. I am using GCC in the Posix shell,
>in GCC each call has an additional first parameter which says how many
>parameters I am passing. When I change my HPCICOMMAND call to
>
>HPCICOMMAND(4, buf, &cmderror, &parmnum, 0);
>
>it works perfectly. Thanks for the help everyone, I greatly appreciate it.
>
>I am using HPCICOMMAND instead of COMMAND because it seems to be more
>shell-like and allow things like re-direction and UDCs. Now that I have
>something testable I can find out for sure.
>
>Dan
>
>Robert Mills wrote:
>> Daniel,
>>
>> Did you try Kevin's (Miller) suggestion of adding the fourth parameter? I
would stay with using the HPCICOMMAND intrinsic instead of using COMMAND due
to its additional capabilities.
>>
>>
>> regards,
>>
>> Robert W.Mills
>> Business Systems Development Analyst
>> Group Information Systems & Technology
>> Pinnacle Entertainment
>> DDI: +44 (0)20 8309 3604
>>
>>
>> -----Original Message-----
>> From: HP-3000 Systems Discussion [mailto:[log in to unmask]] On
Behalf Of Gary Robillard
>> Sent: 10 September 2008 04:16
>> To: [log in to unmask]
>> Subject: Re: [HP3000-L] HPCICOMMAND again
>>
>> 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 *
>>
>> * 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