On Mon, 23 Apr 2001 11:25:09 -0500, Born, Ken <[log in to unmask]>
wrote:
>Is there a quick way to calculate what my Foptions and Aoptions will be in
>my fopen ?
>I always stumble on this part with byte positions like (14:2) domain,
(13:1)
>ascii/binary whether I start on the left side or right side and how it all
>works.
>
For the overall answer, look for one of the Orbit "pocket guides" -- in the
intrinsic section for FOPEN there are two easy-to-read tables showing the
various bit-positions & values. Failing that, I'd suggest the INTRINSICS
manual itself for FOPEN. (but it doesn't answer the right-left side
question directly -- for the HP, the MOST significant bit is bit number 0,
meaning bit 0 is the LEFT most bit with a decimal value of 32768, and bit
15 is the RIGHT most bit with a decimal value of 1)
However, what language are you using to access the file? If you are
using "C", then take a look at MPE.H.SYS (/usr/include/mpe.h should be
symlinked to it) This has a STRUCT defined for fop/aop that lets you set
bits as needed. For example:
===>
OK-no changes 13 Text MSGIO.C.EMERSON "FOPEN" Hint: Type ?f7 for Help
-3 foptions fop;
-2 aoptions aop;
-1 unsigned short PARAM;
* short msgfile;
+1 short file_err;
+2
+3 fop.fv=0;
+4 fop.fs.type=6; /* MSG file */
+5 fop.fs.format=1; /* Variable */
+6 fop.fs.domain=1; /* Old file */
+7
+8 aop.av=0;
+9 aop.as.no_wait=waitflag;
10 aop.as.exclusive=3; /* allow SHARE access... */
11 aop.as.multi =2; /* ...with other JOBS */
12 aop.as.access =mode;
13
14 msgfile=FOPEN(filename,fop.fv,aop.av,maxreclen);
15 if (msgfile==0) {
<error condition logic goes here...>
Another "technique" is to assign literal constants to various values and
add them together, i.e.:
#define domain_new 0x0000
#define domain_old 0x0001
#define domain_temp 0x0002
#define domain_any 0x0003
#define type_std 0x0000
#define type_ksam 0x0800
#define type_RIO 0x1000
#define type_ksamxl 0x1800
#define type_CIR 0x2000
#define type_spool 0x2100
#define type_msg 0x3000
msgfile=FOPEN(filename,domain_old + type_msg,...)
Tom
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|