/* This program shows a calluser program using */ /* TPU$EXECUTE_COMMAND to provide information */ /* to VAXTPU */ #include descrip #include math #include ssdef int tpu$handler (); tpu$calluser (code, instring, outstring) int *code; struct dsc$descriptor *instring, *outstring; { int status; struct dsc$descriptor_d execute_desc; char execute_string [128]; int len; if (*code != 0) srand (*code); sprintf (execute_string, "random_int := %d;", rand ()); execute_desc.dsc$w_length = 0; execute_desc.dsc$b_dtype = DSC$K_DTYPE_T; execute_desc.dsc$b_class = DSC$K_CLASS_D; execute_desc.dsc$a_pointer = 0; len = strlen (execute_string); status = lib$scopy_r_dx (&len, execute_string, &execute_desc); if (status != SS$_NORMAL) return status; lib$establish (tpu$handler); return tpu$execute_command (&execute_desc); } ! ! A VAXTPU command file showing that a ! calluser program can modify VAXTPU ! variables using TPU$EXECUTE_COMMAND ! random_int := 0; ignore := call_user (1, ""); message (str(random_int)); ignore := call_user (0, ""); message (str(random_int)); ignore := call_user (0, ""); message (str(random_int)); ignore := call_user (0, ""); message (str(random_int)); ignore := call_user (0, ""); message (str(random_int)); message (""); ignore := call_user (1, ""); message (str(random_int));