From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f7344,2e7cacc0c404d644 X-Google-Attributes: gidf7344,public X-Google-Thread: fc7fa,2e7cacc0c404d644 X-Google-Attributes: gidfc7fa,public From: rankin@eql.caltech.edu (Pat Rankin) Subject: Re: Trying to use SYS$ASSIGN... Date: 1995/12/16 Message-ID: <16DEC199517111336@eql.caltech.edu>#1/1 X-Deja-AN: 122027631 distribution: world references: <4an4al$ho0@nntpd.lkg.dec.com> news-software: VAX/VMS VNEWS 1.41x7 organization: California Institute of Technology newsgroups: comp.os.vms,comp.sys.vms In article <4an4al$ho0@nntpd.lkg.dec.com>,\ hoffman@xdelta.enet.dec.com (Stephen Hoffman) writes... [...] >:static struct {int Size; char *Ptr;} Descr={9,"SYS$INPUT"}; [...] > You will want to take a look at the C documentation around the > declaration and use of the string descriptor structure. [...] > If you choose to use a string descriptor and are manually > initializing it, you will want to use the descriptor class > DSC$K_CLASS_S until you fully understand the declaration and > use of the dynamic string descriptor class DSC$K_CLASS_D. > And most common string descriptors use the text string data > type: DSC$K_DTYPE_T. (These values, and the structure of > various string descriptors are declared in descrip.h.) The descriptor he is using is not the source of his problem, because is it completely correct (as long as `int' and `char *' are each 32 bits, and assuming that the length value fits within 16 bits, so as not to overflow into the type & class fields). Probably 98% of VAX/VMS assembler code--including within VMS itself--would have constructed a similar descriptor without bothering with the type and class. System services do not even examine the type and class fields. Even if they did, 0 is a valid value (indicating "unspecified", which is treated as static for the class and arbitrary bytes for the type). His descriptor did have zeroes in those two fields due to the bit pattern of the length value 9. Neither adding a trailing colon to "SYS$INPUT" nor changing the case of "SYS$ASSIGN" makes any difference. Almost certainly the original problem was due to his actual translation of "SYS$INPUT", not to the code which was posted. Pat Rankin, rankin@eql.caltech.edu