× Discussions for CodeTyphon Object Pascal Programming Language

Question Not clear close the program!!! problem IDE?!

  • Tigr
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
2 years 9 months ago - 2 years 9 months ago #11046 by Tigr
When performing a simple task, namely filling a three-dimensional array, the program suddenly for no reason just destroyed....( CT 6.2



var
mas:array[1..2097151,1..2097151,1..2097151] of integer;

///....////
procedure TForm1.Button1Click(Sender: TObject);
var i,j,k:integer;
begin
for i:=1 to 2097151 do
begin
for j:=1 to 2097151 do
begin
for k:=1 to 2097151 do
begin
mas[i,j,k]:=1;
end;
end;
end;
form1.Memo1.Lines.Add('dfbdfbdb');
end;
Last edit: 2 years 9 months ago by Tigr.

Please Log in or Create an account to join the conversation.

  • Tigr
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
2 years 9 months ago #11047 by Tigr
after restarting the program from the environment .... there is a bug:
failed to execute:193

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
2 years 9 months ago - 2 years 9 months ago #11048 by Sternas Stefanos
Replied by Sternas Stefanos on topic Not clear close the program!!! problem IDE?!
Sir
don't use so big numbers (2097151) in multi dimension arrays

http://wiki.freepascal.org/Integer

this sample work OK
var
  mas: array[1..100, 1..100, 1..100] of integer;

procedure TForm1.Button1Click(Sender: TObject);
var
  i, j, k: integer;
begin
  for i := 1 to 100 do
  begin
    for j := 1 to 100 do
    begin
      for k := 1 to 100 do
      begin
        mas[i, j, k] := 1;
      end;
    end;
  end;

  form1.Memo1.Lines.Add('dfbdfbdb');
end;

PilotLogic Architect and Core Programmer
Last edit: 2 years 9 months ago by Sternas Stefanos.

Please Log in or Create an account to join the conversation.

  • Tigr
  • Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
More
2 years 9 months ago - 2 years 9 months ago #11049 by Tigr
Thank you! I'm just under forgot for a moment that program need a lot of memory!
when I'm on the calculator counted realized what a fool!
Last edit: 2 years 9 months ago by Tigr.

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
2 years 9 months ago - 2 years 9 months ago #11050 by Sternas Stefanos
Replied by Sternas Stefanos on topic Not clear close the program!!! problem IDE?!
have fun...:)

PilotLogic Architect and Core Programmer
Last edit: 2 years 9 months ago by Sternas Stefanos.

Please Log in or Create an account to join the conversation.