summaryrefslogtreecommitdiff
path: root/texmf-dist/scripts/ketpic/ketlib/ketpic2escifiles6/ReadfromCindy.sci
blob: eaf9f6df2bd927b15b6f78affb33a9d5e0d09624 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// s:2014,09.08
// e:2014.09.26
// e:2014.10.07  debugged, code changed
// e:2014.10.08  CR | LF

function Out=ReadfromCindy(Fname)
  Fid=mopen(Fname,"rb");
  Gline=list();
  Gpt=list();
  Gstr=[];
  Str="";
  Flg=1;
  Tmp=mgetstr(1,Fid);
  while 1==1
    if Tmp=="" then
      if Flg==1 then
        Gstr=[Gstr;Str];
        Str="";
        Flg=1;
      end;
      break;
    end
    C=ascii(Tmp);
    if C==13|C==10 then// CR,LF
      if Flg==1 then
        Gstr=[Gstr;Str];
        Str="";
        Flg=0;
      end;
    else
      Str=Str+Tmp;
      Flg=1;
    end;
    Tmp=mgetstr(1,Fid);
  end;
  mclose(Fid);
  Out=Gstr;
endfunction;