module: ascii_read
description: 
parameters:  int x
inputs:  
outputs:  double out
classes:  Vector vec_buffer()
static_variables: FILE *fp, int end_file_flag, int cur_vec_length, 
                  int cur_count  
init:  
char filename[100];
sprintf(filename,"sigin_%d.dat",x);
if ((fp = fopen(filename,"r")) == NULL)
  {
   printf("error in 'ascii_store':  can't open file '%s'\n",filename);
   exit(1);
  }
end_file_flag = 0;
out = 0.0;
vec_buffer.set_length(1000);
cur_count = 0;
cur_vec_length = 0;

end:  
fclose(fp);
code:
char word[100];
int i;

if (end_file_flag == 0 && cur_count == cur_vec_length)
   {
    cur_count = 0;
    cur_vec_length = 0;
    for (i = 0; i < 1000; i++)
       {
       if (fscanf(fp,"%s",word) == 1)
         {
          vec_buffer.set_elem(i,atof(word));
          cur_vec_length++;
         }
       else
         {
          end_file_flag = 1;
          break;
         }
       }
   }
else if (cur_count < cur_vec_length)
   {
    out = vec_buffer.get_elem(cur_count);
    cur_count++;
   }
