home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume6 / lookup.c++ / lookup2.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-04  |  263 b   |  16 lines

  1. #include <stream.h>
  2. #include <string.h>
  3. #include "lookup.h"
  4.  
  5. proc lookup::operator[](const char *str)
  6.   {
  7.   entry *t=table;
  8.  
  9.   for(; t-table < max; t++)
  10.     if(!strcmp(t->name, str))
  11.       break;
  12.  
  13.   if(t-table<max) return t->f;
  14.   else            return dflt;
  15.   }
  16.