5

私は2つのメタポストファイルを持っています:

% test1.mp
beginfig(1):

% foobar code

% code specific to test1

endfig;
end;

% test2.mp
beginfig(1):

% foobar code    

% code specific to test2

endfig;
end;

プログラマーとして、私は当然複製が嫌いです。「foobarコード」をfoobar.mpファイルに移動し、このファイルをtest1.mpとtest2.mpの両方に含める方法はありますか?例えば...

% test1.mp
beginfig(1):

% for illustration...
Include.foobar("foobar.mp");

% code specific to test2

endfig;
end;
4

1 に答える 1

4
% test1.mp
beginfig(1):
input foobar
endfig;
end;
于 2011-02-25T21:37:21.903 に答える