From:	MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX" 24-MAY-1992 18:33:58.65
To:	info-vax@kl.sri.com
CC:	
Subj:	Re: Descriptor for static array of character strings

In article <1992May23.002028.14722@magnus.acs.ohio-state.edu> DAVISM@kcgl1.eng.ohio-state.edu (Michael T. Davis) writes:
>
>	I need to know the components of the (C) structure which describes the
>data structure in the Subject line (for use in a call to SMG$CREATE_MENU).  If
>this is documented somewhere, please point me at the correct volume from the
>Gray Wall.
>
>							Thanks,
>							 Mike

Here's the basic setup I used:

   struct dsc$descriptor_a data;
   char *fields, *calloc();

   fields = calloc(2000, sizeof(char));

   data.dsc$w_length = 20;
   data.dsc$b_dtype = DSC$K_DTYPE_T;
   data.dsc$b_class = DSC$K_CLASS_A;
   data.dsc$a_pointer = fields;
   data.dsc$b_aflags.dsc$v_fl_column = 1;
   data.dsc$b_dimct = 1;
   data.dsc$l_arsize = 2000;

Since the array size is 2000 and my w_length is 20, I can have 100 menu items
of size 20.  When I added each item to the array, I'd make sure I had a blank
padded string and then used strncpy(fields+(x*20), string, 20) where 'x' is
the index for the array item.

Hope this helps.

Greg

