Excel用のインポートモジュールを自動作成するツール


これはExcel用のインポートモジュールを自動作成するツールである. 使い方は以下の通り.

  1. アーカイブを解凍し,makebas.pasをDelphiのコマンドラインコンパイラdcc32.exeでコンパイルする.
  2. 新関数があればsample.&&&に記述を追加する.
  3. dllがあるディレクトリにmakebas.exeとsample.&&&をコピーし,makebas.exeを実行する.

program makebas;

uses
  Forms, SysUtils, Classes;

var
  DLLList, Tmp: TStringList;
  Path, DLLName, S, SS: String;
  Info: TSearchRec;
  R, Index, J: Integer;
begin
   DLLList := TStringList.Create;
   Path := ExtractFilePath( Application.ExeName ) + '*.dll';
   R := FindFirst( Path, faAnyFile, Info );
   while R = 0 do
   begin
      DLLList.Add( Info.Name );
      R := FindNext( Info);
   end;
   FindClose( Info );

   for Index := 0 to DLLList.Count - 1 do
   begin
      S := DLLList[ Index ];
      DLLName := ChangeFileExt( S, '' );
      Tmp := TStringList.Create;
      Tmp.LoadFromFile( 'sample.&&&' );
      for J := 0 to Tmp.Count - 1 do
      begin
         Tmp[ J ] := StringReplace( Tmp[ J ], 'DLLNAME', DLLName,
                        [rfIgnoreCase] );
      end;
      SS := DLLName + '.bas';
      Tmp.SaveToFile( SS );
      Writeln( SS + ' has been created.' );
   end;

end.


お問い合わせはメールにて: akasaka@klc.ac.jp
SEO [PR] 爆速!無料ブログ 無料ホームページ開設 無料ライブ放送