level 1
程序内容涉及到了到三个txt文件的输入和输出操作。我把三个txt和生成的exe放到一个文件夹里,然后发给别人,但在别人的电脑上却运行不了,为什么?有什么办法解决?
2013年07月23日 00点07分
1
level 3
应该是位置不同吧,别人的电脑上三个TXT的储存位置与你不同
2013年07月23日 14点07分
3
我把exe文件和三个txt放在同一个文件夹里,这样运行的exe应该只会处理跟它在同一个文件夹里的txt吧
2013年07月23日 14点07分
回复 lido3000 :你读取的时候有没有写文件地址?
2013年07月23日 14点07分
回复 发A烧B友 :“assgin(input,'a.txt')”我的打开文件是这样写的……
2013年07月23日 14点07分
回复 发A烧B友 :不过我发现不用处理文件直接运行的的exe程序,在其他电脑上也运行不了……
2013年07月23日 14点07分
level 13
FPC编译的exe文件要在“别人的电脑”上运行有以下要求:
必须安装Free Pascal
FPC编译的exe文件要在“别人的电脑”上运行而且还附带文件必须有以下要求:
Var区必须定义一个input1,output1:text;
然后assign(input1,'a.txt');(顺便说一声LZ你assign打错了)
如果要同时打开多个文件那么再定义input2,input3,output2,output3....
再打开读入数据完毕后必须用close关掉
2013年07月24日 02点07分
4
别人的电脑无需安装FP的。。
2013年07月24日 04点07分
回复 courage17340 :是么
![[疑问]](/static/emoticons/u7591u95ee.png)
我没实验过,不过附带文件必须要定义text我是试过的
2013年07月24日 06点07分
回复 汪靖恒 :我编的那个魔塔在没有FP的电脑上照样能运行,不过我的确定义了text文件
2013年07月24日 06点07分
回复 courage17340 :好吧……
2013年07月24日 06点07分
level 13
编译完成了就是完整的可执行文件,32位windows系统都应该可以执行,除非你的程序有问题
2013年07月24日 04点07分
5
level 1
var a,b:array[0..100000] of ansistring;
i,j,x,y:longint;
flag:boolean;
begin
x:=0;y:=0;
assign(input,'a.txt'); reset(input);
while not eof do begin inc(x);
readln(a[x]); end;
close(input);
assign(input,'b.txt'); reset(input);
while not eof do begin inc(y);
readln(b[y]); end;
close(input);
assign(output,'c.txt'); rewrite(output);
for i:=1 to x do
begin
flag:=false;
for j:=1 to y do
if a[i]=b[j] then
begin
flag:=true;break;
end;
if not flag then writeln(a[i]);
end;
close(output);
end.
2013年07月25日 10点07分
8