      // assign function header
      fprintf(textfile,"STGTYP void DGLProductions::%s_assign(const char *ival,int ilen)\n",nameval);
      fputs("{\n",textfile);
      // local variables
      fputs("   int lcl_index;\n",textfile);
      fputs("   int lcl_len;\n",textfile);
      fputs("   void (*selrtn)();\n",textfile);
      fputs("   DGLSystem::Command * cmd;\n",textfile);
      fputs("   char *lcl_value;\n\n",textfile);
      // get selection routine.
      // if it doesn't exist, pass the string itself to the interpreter.
      // if it does exist then call it.
      fputs("   selrtn = DGLSystem::getsel(ival,ilen);\n",textfile);
      fputs("   DGLSystem::Begsav();\n",textfile);
      fputs("   if (selrtn == NULL)\n",textfile);
      fputs("   {\n",textfile);
      fputs("      DGLSystem::outstr(ival,ilen);\n",textfile);
      fputs("   }\n",textfile);
      fputs("   else\n",textfile);
      fputs("   {\n",textfile);
      fputs("      (*selrtn)();\n",textfile);
      fputs("   }\n",textfile);
      // get the interpreted results
      fputs("   lcl_len = DGLSystem::Lensav();\n",textfile);
      fputs("   lcl_value = DGLSystem::Endsav();\n",textfile);
      // test to see if the interpreted result is a command
      fputs("   cmd = DGLSystem::CommandParser(lcl_value,lcl_len);\n",textfile);
      // if a $count command was found, execute it
      fputs("   if (cmd->Type == DGLSystem::CmdCount)\n",textfile);
      fputs("   {\n",textfile);
      fprintf(textfile,"      DGLSystem::interpret(\"%d\");\n",temp->entries);
      fputs("   }\n",textfile);
      fputs("   else\n",textfile);
      // if no command, or a command other than $count, treat interpreted
      // result as a selection number. non-numeric=zero
      fputs("   {\n",textfile);
      fputs("      lcl_index = strtol(lcl_value,NULL,0);\n",textfile);
      if (temp->refer == NULL)
      {
	 fprintf(textfile,"   DGLSystem::interpret(DGLProductions::%s_table[lcl_index%%%d]);\n",nameval,temp->entries);
      }
      else
      {
	 fprintf(textfile,"   DGLSystem::interpret(DGLProductions::%s_table[lcl_index%%%d]);\n",temp->refer,temp->entries);
      }
      fputs("   }\n",textfile);
      fputs("   delete cmd;\n",textfile);
      fputs("   free(lcl_value);\n",textfile);
      fputs("}\n\n\n\n",textfile);
