| | |
Loop stopping short
![]() |
•
•
Join Date: Sep 2005
Posts: 6
Reputation:
Solved Threads: 0
Hi everyone!
I have this loop which just wont complete. My code is:
begin
a:=1;
repeat
b:=1;
repeat
write('element ', a, ',', b, ' = ');
readln(mat[a, b]);
b:=b+1;
until b>n;
a:=a+1;
until a>n;
end;
a, b and n are all declared as integers. This is used to enter the elements of a n by n matrix into the program, a being rows and b columns. The application completely shuts downs after I enter the [n, 1] element and I'm going crazy trying to figure out why!
I'm not asking for a "do this" answer, but some pointing in the right direction would be much apreciated.
Pt
I have this loop which just wont complete. My code is:
begin
a:=1;
repeat
b:=1;
repeat
write('element ', a, ',', b, ' = ');
readln(mat[a, b]);
b:=b+1;
until b>n;
a:=a+1;
until a>n;
end;
a, b and n are all declared as integers. This is used to enter the elements of a n by n matrix into the program, a being rows and b columns. The application completely shuts downs after I enter the [n, 1] element and I'm going crazy trying to figure out why!
I'm not asking for a "do this" answer, but some pointing in the right direction would be much apreciated.
Pt
![]() |
Similar Threads
- Problems with While Loop (PHP)
- do while loop - not stopping!! (Java)
- Database and ASP loops and hierarachal Data (ASP)
- Loop...without the loop (Java)
Other Threads in the Pascal and Delphi Forum
- Previous Thread: Client Server Applications
- Next Thread: Getting a rollover menu in delphi
| Thread Tools | Search this Thread |





