Article 160298 of comp.os.vms:
Actually the following example may better illustrate the use
of LIB$SET_LOGICAL:

#include <stdio.h>
#include <string.h>
#include <descrip.h>
#include <lnmdef.h>
#include <lib$routines.h>

struct item_list_3 { short buflen;
                     short code;
                     long bufadr;
                     long retlenadr; };

$DESCRIPTOR(tbldes,"LNM$PROCESS");

void set1(char *lnm,char *val)
{
   struct dsc$descriptor_s lnmdes;
   struct dsc$descriptor_s valdes;
   lnmdes.dsc$w_length = strlen(lnm);
   lnmdes.dsc$b_dtype = DSC$K_DTYPE_T;
   lnmdes.dsc$b_class = DSC$K_CLASS_S;
   lnmdes.dsc$a_pointer = lnm;
   valdes.dsc$w_length = strlen(val);
   valdes.dsc$b_dtype = DSC$K_DTYPE_T;
   valdes.dsc$b_class = DSC$K_CLASS_S;
   valdes.dsc$a_pointer = val;
   lib$set_logical(&lnmdes,&valdes,&tbldes,0,0);
   return;
}

void set2(char *lnm,char *val1,char *val2)
{
   struct dsc$descriptor_s lnmdes;
   struct item_list_3 itmlst[3];
   lnmdes.dsc$w_length = strlen(lnm);
   lnmdes.dsc$b_dtype = DSC$K_DTYPE_T;
   lnmdes.dsc$b_class = DSC$K_CLASS_S;
   lnmdes.dsc$a_pointer = lnm;
   itmlst[0].buflen = strlen(val1);
   itmlst[0].code = LNM$_STRING;
   itmlst[0].bufadr = (long)val1;
   itmlst[0].retlenadr = 0;
   itmlst[1].buflen = strlen(val2);
   itmlst[1].code = LNM$_STRING;
   itmlst[1].bufadr = (long)val2;
   itmlst[1].retlenadr = 0;
   itmlst[2].buflen = 0;
   itmlst[2].code = 0;
   itmlst[2].bufadr = 0;
   itmlst[2].retlenadr = 0;
   lib$set_logical(&lnmdes,0,&tbldes,0,itmlst);
   return;
}

int main()
{
   set1("TEST1","foo");
   set2("TEST2","foo","bar");
}

                                                          Arne

Arne Vajhøj                             local DECNET:  KAL13::ARNE
Computer Department                     PSI:           PSI%23831001354030::ARNE
Southern Denmark Business School        Internet:      ARNE@KO.HHS.DK
                WWW URL: http://www.hhs.dk/~arne/arne.html



