tokendat.pas 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. {
  2. $Id$
  3. Copyright (c) 1998-2000 by Daniel Mantione, Peter Vreman
  4. Members of the Free Pascal development team
  5. This little program generates a file of tokendata
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. ****************************************************************************
  18. }
  19. program tokendat;
  20. {$ifdef FPC}
  21. {$FATAL Use tp 7 to compile, FPC can't be used because the records are written different.}
  22. {$else}
  23. {$ifndef TP}
  24. -- You need to define -dTP and -dI386
  25. {$endif}
  26. {$ifndef I386}
  27. -- You need to define -dTP and -dI386
  28. {$endif}
  29. {$endif}
  30. uses tokens;
  31. {Header is designed both to identify the file and to display a nice
  32. message when you use the type command on it.
  33. Explanation:
  34. #8 String length is also displayed. A backspace erases it.
  35. #13#10 Needed to display dos prompt on next line.
  36. #26 End of file. Causes type to stop reading the file.
  37. }
  38. const
  39. headerstr:string[length(tokheader)]=tokheader;
  40. var
  41. f:file;
  42. a:longint;
  43. begin
  44. new(tokenidx);
  45. create_tokenidx;
  46. assign(f,'tokens.dat');
  47. rewrite(f,1);
  48. {Write header...}
  49. blockwrite(f,headerstr,sizeof(headerstr));
  50. {Write size of tokeninfo.}
  51. a:=sizeof(arraytokeninfo);
  52. blockwrite(f,a,sizeof(a));
  53. {Write tokeninfo.}
  54. blockwrite(f,arraytokeninfo,sizeof(arraytokeninfo));
  55. {Write tokenindex.}
  56. blockwrite(f,tokenidx^,sizeof(tokenidx^));
  57. close(f);
  58. dispose(tokenidx);
  59. end.
  60. {
  61. $Log$
  62. Revision 1.2 2000-07-13 11:32:52 michael
  63. + removed logs
  64. }