Browse Subversion Repository
Contents of /kwlist.pas
Parent Directory
| Revision Log
Revision 1 -
( show annotations)
( download)
( as text)
Mon Nov 7 12:03:00 2011 UTC
(12 years, 4 months ago)
by shiraishikazuo
File MIME type: text/x-pascal
File size: 1002 byte(s)
| 1 |
unit kwlist; |
| 2 |
{$IFDEF FPC} |
| 3 |
{$MODE DELPHI}{$H+} |
| 4 |
{$ENDIF} |
| 5 |
(***************************************) |
| 6 |
(* Copyright (C) 2003, SHIRAISHI Kazuo *) |
| 7 |
(***************************************) |
| 8 |
|
| 9 |
|
| 10 |
interface |
| 11 |
uses classes; |
| 12 |
|
| 13 |
type |
| 14 |
TKeyWordList=Class(TStringList) |
| 15 |
constructor create(ch:char); |
| 16 |
end; |
| 17 |
|
| 18 |
var |
| 19 |
KeywordList1,KeywordList2:TKeywordList; |
| 20 |
|
| 21 |
|
| 22 |
implementation |
| 23 |
uses Forms,SysUtils,Dialogs; |
| 24 |
|
| 25 |
Constructor TKeywordList.create(ch:char); |
| 26 |
var |
| 27 |
F:TextFile; |
| 28 |
s,n:string; |
| 29 |
begin |
| 30 |
inherited create; |
| 31 |
sorted:=true; |
| 32 |
n:=ExtractFilePath(Application.ExeName)+'basic.kw'+ch; |
| 33 |
AssignFile(F,n); |
| 34 |
try |
| 35 |
reset(F); |
| 36 |
while not EOF(F) do |
| 37 |
begin |
| 38 |
readln(F,s); |
| 39 |
add(s); |
| 40 |
end; |
| 41 |
close(F); |
| 42 |
except |
| 43 |
showMessage(n+' Not Found'); |
| 44 |
end; |
| 45 |
end; |
| 46 |
|
| 47 |
|
| 48 |
initialization |
| 49 |
keywordlist1:=TKeywordList.create('1'); |
| 50 |
keywordList2:=TKeywordList.create('2'); |
| 51 |
|
| 52 |
finalization |
| 53 |
keywordlist1.free; |
| 54 |
keywordlist2.free; |
| 55 |
|
| 56 |
|
| 57 |
end. |
|