[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

------> GNU Pascal <-----



Hi, 

well, i figure out this little program that works for turbo pascal but doesnt for gnu pascal. It does what i want, and i guess there is no functions in pascal that will do this... my first problem is that i  have  to do it in this lang. my second problem is that i cannot work at home, couse gnu pascal wont accept "the line". it gives me "array index out of range" at compilatoin time. without that line, i cannot (dont know how to...) set the length of b (so its 0 by default i guess), for example if something=print, print(b) wont print anything, couse b will have length 0. Someboady remember how to set the length of a string? (via a funcion or manually, as ive try here...)



a:='Hola soy yo bla AS as';
n:=1;
while n<=length(a) do
begin
m:=1;
	while (a[n]<>chr(32)) and (n<=length(a)) do
	begin
	b[m]:=a[n];
	n:=n+1;
        m:=m+1;
	end;
b[0]:=chr(m-1);  <------  the line
something(b); <------ "something"
n:=n+1;

end;



thanks,

---------------------
    Phillip Neumann
  max@julia.dhis.org


Reply to: