"Segment fault" error :-(
Wed, 8 Oct 1997 22:25:52 +0200 (CEST)
Hello again !
My problems with file handling are all solved - thanks a lot, but as I
continue working on my program I get another error message. I wrote an
extract from my program, which causes the error :
program test;
type tstr = string[30];
var s_test : tstr;
function copy (s : tstr; p1 : integer; p2 : integer ) : tstr;
var
i : integer;
buf : tstr;
begin
for i:=p1 to p2 do
buf[i]:=s[i];
copy:=buf;
end;
begin
s_test:='Dies ist ein Test-string';
writeln(copy(s_test,5,4));
end.
I just wanted to implement the string-function "copy" from Borland Pascal
to use it on my Linux-System. The error messages I get is :
chris@bockermann:/home/chris/programs/pascal/indent > a.out
Segmentation fault
Does anybody know this problem ?
(By the way, if you have suggestions for a better style of programming
this copy-function, please let me know, I'm already learning ... :-)
Thanks,
Chris
e-mail > chris@bockermann.ping.de
____________________________________
(subject "send pgp-key" for pgp-key)
Christian Bockermann (chris@bockermann.ping.de (Christian Bockermann))
HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada -
Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es