msg2inc.pp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835
  1. {
  2. This program is part of the Free Pascal run time library.
  3. Copyright (c) 1998-2002 by Peter Vreman
  4. Convert a .msg file to an .inc file with a const array of char
  5. And for the lazy docwriters it can also generate some TeX output
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. program msg2inc;
  13. {$ifdef unix}
  14. {$define EOL_ONE_CHAR}
  15. {$endif unix}
  16. {$ifdef amiga}
  17. {$define EOL_ONE_CHAR}
  18. {$endif amiga}
  19. {$ifdef morphos}
  20. {$define EOL_ONE_CHAR}
  21. {$endif}
  22. {$ifdef macos}
  23. {$define EOL_ONE_CHAR}
  24. {$endif}
  25. const
  26. version='1.00';
  27. {$ifdef EOL_ONE_CHAR}
  28. eollen=1;
  29. {$else}
  30. eollen=2;
  31. {$endif}
  32. msgparts = 20;
  33. type
  34. TMode=(M_Char,M_Tex,M_Intel,M_String,M_Renumber);
  35. var
  36. InFile,
  37. OutFile,
  38. OutName : string;
  39. Mode : TMode;
  40. TexHeader : boolean;
  41. MsgTxt : pchar;
  42. EnumTxt : pchar;
  43. enumsize,
  44. msgsize : longint;
  45. msgidxmax : array[1..msgparts] of longint;
  46. msgs : array[0..msgparts,0..999] of boolean;
  47. msgcodepage: TSystemCodePage;
  48. procedure LoadMsgFile(const fn:string);
  49. var
  50. f : text;
  51. error,
  52. multiline : boolean;
  53. code : word;
  54. numpart,numidx,
  55. line,i,j,num : longint;
  56. ptxt,
  57. penum : pchar;
  58. number,
  59. s,s1 : string;
  60. procedure err(const msgstr:string);
  61. begin
  62. writeln('error in line ',line,': ',msgstr);
  63. error:=true;
  64. end;
  65. begin
  66. Writeln('Loading messagefile ',fn);
  67. msgcodepage:=CP_ACP;
  68. {Read the message file}
  69. assign(f,fn);
  70. {$push} {$I-}
  71. reset(f);
  72. {$pop}
  73. if ioresult<>0 then
  74. begin
  75. WriteLn('fatal error: '+fn+' not found');
  76. halt(1);
  77. end;
  78. { First parse the file and count bytes needed }
  79. fillchar(msgidxmax,sizeof(msgidxmax),0);
  80. fillchar(msgs,sizeof(msgs),0);
  81. error:=false;
  82. line:=0;
  83. multiline:=false;
  84. msgsize:=0;
  85. while not eof(f) do
  86. begin
  87. readln(f,s);
  88. inc(line);
  89. if multiline then
  90. begin
  91. if s=']' then
  92. multiline:=false
  93. else if (s='') or (s[1] <> '#') then
  94. inc(msgsize,length(s)+1); { +1 for linebreak }
  95. end
  96. else
  97. begin
  98. if (s<>'') and not(s[1] in ['#',';','%']) then
  99. begin
  100. i:=pos('=',s);
  101. if i>0 then
  102. begin
  103. j:=i+1;
  104. if not(s[j] in ['0'..'9']) then
  105. err('no number found')
  106. else
  107. begin
  108. while (s[j] in ['0'..'9']) do
  109. inc(j);
  110. end;
  111. if j-i-1<>5 then
  112. err('number length is not 5');
  113. number:=Copy(s,i+1,j-i-1);
  114. { update the max index }
  115. val(number,num,code);
  116. numpart:=num div 1000;
  117. if numpart=0 then
  118. err('number should be > 1000');
  119. if code<>0 then
  120. err('illegal number: '+s);
  121. numidx:=num mod 1000;
  122. { duplicate ? }
  123. if msgs[numpart,numidx] then
  124. err('duplicate number found');
  125. msgs[numpart,numidx]:=true;
  126. { check range }
  127. if numpart > msgparts then
  128. err('number is to large')
  129. else
  130. if numidx > msgidxmax[numpart] then
  131. msgidxmax[numpart]:=numidx;
  132. if s[j+1]='[' then
  133. begin
  134. inc(msgsize,j-i);
  135. multiline:=true
  136. end
  137. else
  138. inc(msgsize,length(s)-i+1);
  139. inc(enumsize,j);
  140. end
  141. else
  142. err('no = found');
  143. end
  144. else if (Length(s)>11) and (Copy(s,1,11)='# CodePage ') then
  145. begin
  146. val(Copy(s,12,Length(s)-11),msgcodepage,code);
  147. if code<>0 then
  148. err('illegal code page number: '+s);
  149. end;
  150. end;
  151. end;
  152. if multiline then
  153. err('still in multiline mode');
  154. if error then
  155. begin
  156. close(f);
  157. writeln('aborting');
  158. halt(1);
  159. end;
  160. { alloc memory }
  161. getmem(msgtxt,msgsize);
  162. { no linebreak after last entry }
  163. dec(msgsize);
  164. ptxt:=msgtxt;
  165. getmem(enumtxt,enumsize);
  166. penum:=enumtxt;
  167. { now read the buffer in mem }
  168. reset(f);
  169. while not eof(f) do
  170. begin
  171. readln(f,s);
  172. if multiline then
  173. begin
  174. if s=']' then
  175. begin
  176. multiline:=false;
  177. { overwrite last eol }
  178. dec(ptxt);
  179. ptxt^:=#0;
  180. inc(ptxt);
  181. end
  182. else if (s='') or (s[1] <> '#') then
  183. begin
  184. move(s[1],ptxt^,length(s));
  185. inc(ptxt,length(s));
  186. ptxt^:=#10;
  187. inc(ptxt);
  188. end;
  189. end
  190. else
  191. begin
  192. if (s<>'') and not(s[1] in ['#',';','%']) then
  193. begin
  194. i:=pos('=',s);
  195. if i>0 then
  196. begin
  197. j:=i+1;
  198. while (s[j] in ['0'..'9']) do
  199. inc(j);
  200. {enum}
  201. move(s[1],penum^,i-1);
  202. inc(penum,i-1);
  203. penum^:='=';
  204. inc(penum);
  205. number:=Copy(s,i+1,j-i-1);
  206. move(number[1],penum^,length(number));
  207. inc(penum,length(number));
  208. penum^:=#0;
  209. inc(penum);
  210. { multiline start then no txt }
  211. if s[j+1]='[' then
  212. begin
  213. s1:=Copy(s,i+1,j-i);
  214. move(s1[1],ptxt^,length(s1));
  215. inc(ptxt,length(s1));
  216. multiline:=true;
  217. end
  218. else
  219. begin
  220. { txt including number }
  221. s1:=Copy(s,i+1,255);
  222. move(s1[1],ptxt^,length(s1));
  223. inc(ptxt,length(s1));
  224. ptxt^:=#0;
  225. inc(ptxt);
  226. end;
  227. end;
  228. end;
  229. end;
  230. end;
  231. close(f);
  232. end;
  233. {*****************************************************************************
  234. WriteEnumFile
  235. *****************************************************************************}
  236. procedure WriteEnumFile(const fn:string);
  237. var
  238. t : text;
  239. i : longint;
  240. p : pchar;
  241. start : boolean;
  242. begin
  243. writeln('Writing enumfile '+fn);
  244. {Open textfile}
  245. assign(t,fn);
  246. rewrite(t);
  247. writeln(t,'const');
  248. {Parse buffer in msgbuf and create indexs}
  249. p:=enumtxt;
  250. start:=true;
  251. for i:=1 to enumsize do
  252. begin
  253. if start then
  254. begin
  255. write(t,' ');
  256. start:=false;
  257. end;
  258. if p^=#0 then
  259. begin
  260. writeln(t,';');
  261. start:=true;
  262. end
  263. else
  264. begin
  265. write(t,p^);
  266. end;
  267. inc(p);
  268. end;
  269. writeln(t,'');
  270. { msgtxt size }
  271. writeln(t,' MsgTxtSize = ',msgsize,';');
  272. writeln(t,'');
  273. { max msg idx table }
  274. writeln(t,' MsgIdxMax : array[1..20] of longint=(');
  275. write(t,' ');
  276. for i:=1 to 20 do
  277. begin
  278. write(t,msgidxmax[i]+1);
  279. if i<20 then
  280. write(t,',');
  281. if i=10 then
  282. begin
  283. writeln(t,'');
  284. write(t,' ');
  285. end;
  286. end;
  287. writeln(t,'');
  288. writeln(t,' );');
  289. close(t);
  290. end;
  291. {*****************************************************************************
  292. WriteStringFile
  293. *****************************************************************************}
  294. procedure WriteStringFile(const fn,constname:string);
  295. const
  296. maxslen=240; { to overcome aligning problems }
  297. function l0(l:longint):string;
  298. var
  299. s : string[16];
  300. begin
  301. str(l,s);
  302. while (length(s)<5) do
  303. s:='0'+s;
  304. l0:=s;
  305. end;
  306. var
  307. t : text;
  308. f : file;
  309. slen,
  310. len,i : longint;
  311. p : pchar;
  312. s : string;
  313. start,
  314. quote : boolean;
  315. begin
  316. writeln('Writing stringfile ',fn);
  317. {Open textfile}
  318. assign(t,fn);
  319. rewrite(t);
  320. writeln(t,'const '+constname+'_codepage=',msgcodepage:5,';');
  321. writeln(t,'{$ifdef Delphi}');
  322. writeln(t,'const '+constname+' : array[0..000000] of string[',maxslen,']=(');
  323. writeln(t,'{$else Delphi}');
  324. writeln(t,'const '+constname+' : array[0..000000,1..',maxslen,'] of char=(');
  325. write(t,'{$endif Delphi}');
  326. {Parse buffer in msgbuf and create indexs}
  327. p:=msgtxt;
  328. slen:=0;
  329. len:=0;
  330. quote:=false;
  331. start:=true;
  332. for i:=1 to msgsize do
  333. begin
  334. if slen>=maxslen then
  335. begin
  336. if quote then
  337. begin
  338. write(t,'''');
  339. quote:=false;
  340. end;
  341. write(t,',');
  342. slen:=0;
  343. inc(len);
  344. end;
  345. if (len>70) or (start) then
  346. begin
  347. if quote then
  348. begin
  349. write(t,'''');
  350. quote:=false;
  351. end;
  352. if slen>0 then
  353. writeln(t,'+')
  354. else
  355. writeln(t);
  356. len:=0;
  357. start:=false;
  358. end;
  359. if (len=0) then
  360. write(t,' ');
  361. if (ord(p^)>=32) and (p^<>#39) then
  362. begin
  363. if not quote then
  364. begin
  365. write(t,'''');
  366. quote:=true;
  367. inc(len);
  368. end;
  369. write(t,p^);
  370. inc(len);
  371. end
  372. else
  373. begin
  374. if quote then
  375. begin
  376. write(t,'''');
  377. inc(len);
  378. quote:=false;
  379. end;
  380. write(t,'#'+chr(ord(p^) div 100+48)+chr((ord(p^) mod 100) div 10+48)+chr(ord(p^) mod 10+48));
  381. inc(len,3);
  382. end;
  383. if p^ in [#0,#10] then
  384. start:=true;
  385. inc(slen);
  386. inc(p);
  387. end;
  388. if quote then
  389. write(t,'''');
  390. writeln(t,'');
  391. writeln(t,');');
  392. close(t);
  393. {update arraysize}
  394. s:=l0((msgsize-1) div maxslen); { we start with 0 }
  395. assign(f,fn);
  396. reset(f,1);
  397. seek(f,22+34+2*eollen+2*length(constname));
  398. blockwrite(f,s[1],5);
  399. seek(f,22+90+4*eollen+3*length(constname));
  400. blockwrite(f,s[1],5);
  401. close(f);
  402. end;
  403. {*****************************************************************************
  404. WriteCharFile
  405. *****************************************************************************}
  406. procedure WriteCharFile(const fn,constname:string);
  407. function l0(l:longint):string;
  408. var
  409. s : string[16];
  410. begin
  411. str(l,s);
  412. while (length(s)<5) do
  413. s:='0'+s;
  414. l0:=s;
  415. end;
  416. function createconst(b:byte):string;
  417. begin
  418. if (b in [32..127]) and (b<>39) then
  419. createconst:=''''+chr(b)+''''
  420. else
  421. createconst:='#'+chr(b div 100+48)+chr((b mod 100) div 10+48)+chr(b mod 10+48)
  422. end;
  423. var
  424. t : text;
  425. f : file;
  426. cidx,i : longint;
  427. p : pchar;
  428. s : string;
  429. begin
  430. writeln('Writing charfile '+fn);
  431. {Open textfile}
  432. assign(t,fn);
  433. rewrite(t);
  434. writeln(t,'const ',constname,' : array[1..00000] of char=(');
  435. {Parse buffer in msgbuf and create indexs}
  436. p:=msgtxt;
  437. cidx:=0;
  438. for i:=1to msgsize do
  439. begin
  440. if cidx=15 then
  441. begin
  442. if cidx>0 then
  443. writeln(t,',')
  444. else
  445. writeln(t,'');
  446. write(t,' ');
  447. cidx:=0;
  448. end
  449. else
  450. if cidx>0 then
  451. write(t,',')
  452. else
  453. write(t,' ');
  454. write(t,createconst(ord(p^)));
  455. inc(cidx);
  456. inc(p);
  457. end;
  458. writeln(t,');');
  459. close(t);
  460. {update arraysize}
  461. s:=l0(msgsize);
  462. assign(f,fn);
  463. reset(f,1);
  464. seek(f,18+length(constname));
  465. blockwrite(f,s[1],5);
  466. close(f);
  467. end;
  468. {*****************************************************************************
  469. WriteIntelFile
  470. *****************************************************************************}
  471. procedure WriteIntelFile(const fn,constname:string);
  472. var
  473. t : text;
  474. len,i : longint;
  475. p : pchar;
  476. start,
  477. quote : boolean;
  478. begin
  479. writeln('Writing Intelfile ',fn);
  480. {Open textfile}
  481. assign(t,fn);
  482. rewrite(t);
  483. writeln(t,'procedure '+constname+';assembler;');
  484. writeln(t,'asm');
  485. {Parse buffer in msgbuf and create indexs}
  486. p:=msgtxt;
  487. len:=0;
  488. start:=true;
  489. quote:=false;
  490. for i:=1to msgsize do
  491. begin
  492. if len>70 then
  493. begin
  494. if quote then
  495. begin
  496. write(t,'''');
  497. quote:=false;
  498. end;
  499. writeln(t,'');
  500. start:=true;
  501. end;
  502. if start then
  503. begin
  504. write(t,' db ''');
  505. len:=0;
  506. quote:=true;
  507. end;
  508. if (ord(p^)>=32) and (p^<>#39) then
  509. begin
  510. if not quote then
  511. begin
  512. write(t,',''');
  513. quote:=true;
  514. inc(len);
  515. end;
  516. write(t,p^);
  517. inc(len);
  518. end
  519. else
  520. begin
  521. if quote then
  522. begin
  523. write(t,'''');
  524. inc(len);
  525. quote:=false;
  526. end;
  527. write(t,','+chr(ord(p^) div 100+48)+chr((ord(p^) mod 100) div 10+48)+chr(ord(p^) mod 10+48));
  528. inc(len,4);
  529. end;
  530. inc(p);
  531. end;
  532. if quote then
  533. write(t,'''');
  534. writeln(t,'');
  535. writeln(t,'end;');
  536. close(t);
  537. end;
  538. {*****************************************************************************
  539. RenumberFile
  540. *****************************************************************************}
  541. procedure RenumberFile(const fn,name:string);
  542. var
  543. f,t : text;
  544. i : longint;
  545. s,s1 : string;
  546. begin
  547. Writeln('Renumbering ',fn);
  548. {Read the message file}
  549. assign(f,fn);
  550. {$push} {$I-}
  551. reset(f);
  552. {$pop}
  553. if ioresult<>0 then
  554. begin
  555. WriteLn('*** message file '+fn+' not found ***');
  556. exit;
  557. end;
  558. assign(t,'msg2inc.$$$');
  559. rewrite(t);
  560. i:=0;
  561. while not eof(f) do
  562. begin
  563. readln(f,s);
  564. if (copy(s,1,length(Name))=Name) and (s[3] in ['0'..'9']) then
  565. begin
  566. inc(i);
  567. str(i,s1);
  568. while length(s1)<3 do
  569. s1:='0'+s1;
  570. writeln(t,Name+s1+Copy(s,6,255));
  571. end
  572. else
  573. writeln(t,s);
  574. end;
  575. close(t);
  576. close(f);
  577. { rename new file }
  578. erase(f);
  579. rename(t,fn);
  580. end;
  581. {*****************************************************************************
  582. WriteTexFile
  583. *****************************************************************************}
  584. Function EscapeString (Const S : String) : String;
  585. Var
  586. I : longint;
  587. hs : string;
  588. begin
  589. hs:='';
  590. for i:=1 to length(s) do
  591. case S[i] of
  592. '$' :
  593. if (s[i+1] in ['0'..'9']) then
  594. hs:=hs+'arg'
  595. else
  596. hs:=hs+'\$';
  597. '&','{','}','#','_','%': // Escape these characters
  598. hs := hs + '\' + S[i];
  599. '~','^':
  600. hs := hs + '\'+S[i]+' ';
  601. '\':
  602. hs:=hs+'$\backslash$'
  603. else
  604. hs := hs + S[i];
  605. end;
  606. EscapeString:=hs;
  607. end;
  608. procedure WriteTexFile(const infn,outfn:string);
  609. var
  610. t,f : text;
  611. line,
  612. i,k : longint;
  613. s,s1 : string;
  614. texoutput : boolean;
  615. begin
  616. Writeln('Loading messagefile ',infn);
  617. writeln('Writing TeXfile ',outfn);
  618. { Open infile }
  619. assign(f,infn);
  620. {$push} {$I-}
  621. reset(f);
  622. {$pop}
  623. if ioresult<>0 then
  624. begin
  625. WriteLn('*** message file '+infn+' not found ***');
  626. exit;
  627. end;
  628. { Open outfile }
  629. assign(t,outfn);
  630. rewrite(t);
  631. If texheader then
  632. begin
  633. writeln (t,'\documentclass{article}');
  634. writeln (t,'\usepackage{html}');
  635. writeln (t,'\usepackage{fpc}');
  636. writeln (t,'\begin{document}');
  637. end;
  638. { Parse }
  639. line:=0;
  640. TexOutput:=False;
  641. while not eof(f) do
  642. begin
  643. readln(f,s);
  644. inc(line);
  645. If Pos ('# BeginOfTeX',S)=1 then
  646. TexOutPut:=True
  647. else if pos ('# EndOfTeX',S)=1 then
  648. TexOutPut:=False;
  649. if (s<>'') and not(s[1] in ['#',';']) and TeXOutPut then
  650. begin
  651. if s[1]='%' then
  652. begin
  653. Delete(s,1,1);
  654. writeln(t,s);
  655. end
  656. else
  657. begin
  658. i:=pos('=',s);
  659. if i>0 then
  660. begin
  661. inc(i);
  662. while s[i] in ['0'..'9'] do
  663. inc(i);
  664. inc(i);
  665. s1:='';
  666. k:=0;
  667. while (k<5) and (s[i+k]<>'_') do
  668. begin
  669. case s[i+k] of
  670. 'W' : s1:='Warning: ';
  671. 'E' : s1:='Error: ';
  672. 'F' : s1:='Fatal: ';
  673. 'N' : s1:='Note: ';
  674. 'I' : s1:='Info: ';
  675. 'H' : s1:='Hint: ';
  676. end;
  677. inc(k);
  678. end;
  679. if s[i+k]='_' then
  680. inc(i,k+1);
  681. writeln(t,'\item ['+s1+escapestring(Copy(s,i,255))+']');
  682. end
  683. else
  684. writeln('error in line: ',line,' skipping');
  685. end;
  686. end;
  687. end;
  688. If TexHeader then
  689. writeln (t,'\end{document}');
  690. close(t);
  691. close(f);
  692. end;
  693. {*****************************************************************************
  694. Main Program
  695. *****************************************************************************}
  696. procedure getpara;
  697. var
  698. ch : char;
  699. para : string;
  700. files,i : word;
  701. procedure helpscreen;
  702. begin
  703. writeln('usage : msg2inc [Options] <msgfile> <incfile> <constname>');
  704. writeln('<Options> can be : -T Create .doc TeX file');
  705. writeln(' -TS Create .doc TeX file (stand-alone)');
  706. writeln(' -I Intel style asm output');
  707. writeln(' -S array of string');
  708. writeln(' -C array of char');
  709. writeln(' -R renumber section <incfile>');
  710. writeln(' -V Show version');
  711. writeln(' -? or -H This HelpScreen');
  712. halt(1);
  713. end;
  714. begin
  715. Files:=0;
  716. for i:=1 to paramcount do
  717. begin
  718. para:=paramstr(i);
  719. if (para[1]='-') then
  720. begin
  721. ch:=upcase(para[2]);
  722. delete(para,1,2);
  723. case ch of
  724. 'T' : begin
  725. case upcase(para[1]) of
  726. 'S' : TexHeader:=True;
  727. end;
  728. Mode:=M_Tex;
  729. end;
  730. 'I' : Mode:=M_Intel;
  731. 'S' : Mode:=M_String;
  732. 'C' : Mode:=M_Char;
  733. 'R' : Mode:=M_Renumber;
  734. 'V' : begin
  735. Writeln('Msg2Inc ',version,' for Free Pascal (C) 1998-2002 Peter Vreman');
  736. Writeln;
  737. Halt;
  738. end;
  739. '?','H' : helpscreen;
  740. end;
  741. end
  742. else
  743. begin
  744. inc(Files);
  745. if Files>3 then
  746. HelpScreen;
  747. case Files of
  748. 1 : InFile:=Para;
  749. 2 : OutFile:=Para;
  750. 3 : OutName:=Para;
  751. end;
  752. end;
  753. end;
  754. case Mode of
  755. M_Renumber,
  756. M_Tex : if Files<2 then
  757. Helpscreen;
  758. else
  759. if Files<3 then
  760. HelpScreen;
  761. end;
  762. end;
  763. begin
  764. Mode:=M_String;
  765. OutFile:='';
  766. InFile:='';
  767. OutName:='';
  768. GetPara;
  769. case Mode of
  770. M_Renumber : begin
  771. Renumberfile(Infile,OutFile);
  772. end;
  773. M_Tex : begin
  774. WriteTexFile(InFile,Outfile);
  775. end;
  776. M_Intel : begin
  777. Loadmsgfile(InFile);
  778. WriteEnumFile(OutFile+'idx.inc');
  779. WriteIntelFile(OutFile+'txt.inc',OutName+'txt');
  780. end;
  781. M_String : begin
  782. Loadmsgfile(InFile);
  783. WriteEnumFile(OutFile+'idx.inc');
  784. WriteStringFile(OutFile+'txt.inc',OutName+'txt');
  785. end;
  786. M_Char : begin
  787. Loadmsgfile(InFile);
  788. WriteEnumFile(OutFile+'idx.inc');
  789. WriteCharFile(OutFile+'txt.inc',OutName+'txt');
  790. end;
  791. end;
  792. end.