home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 2.ddi / MUTOOLS2.DI$ / FINDSYS.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  593 b   |  27 lines

  1. %function [iloc,err] = findsys(names,namelen,sysname)
  2. function [iloc,err] = findsys(names,namelen,sysname)
  3.    err = 0;
  4.    lend = length(sysname);
  5.    places = find(namelen==lend);
  6.    if length(places) == 0
  7.      err = 1;
  8.    else
  9.      iloc = 0;
  10.      i = 1;
  11.      nomatch = 1;
  12.      while i <= length(places) & nomatch == 1
  13.        if sysname == names(places(i),1:lend)
  14.          iloc = places(i);
  15.          nomatch = 0;
  16.        else
  17.          i = i + 1;
  18.        end
  19.      end
  20.      if iloc == 0
  21.        err = 1;
  22.      end
  23.    end
  24.  
  25. %
  26. % Copyright MUSYN INC 1991,  All Rights Reserved
  27.