Turbo Pascal is an old software development system including a compiler and an integrated development environment for the Pascal programming language running on CP/M, CP/M-86, and DOS.
Questions tagged [turbo-pascal]
115 questions
0
votes
1 answer
Turbo Pascal Homework Problem: Why did Error 57 pop up in a row it shouldn't have?
I attend 1st grade of Highschool. Recently I had an assignment to do in Turbo Pascal and this happened:
var
a,b,x,y,n:integer;
begin
readln(a,b,x,y);
if ay then n:=a+y;
if a>b and x

Endtower
- 1
- 2
0
votes
0 answers
Numerical value returns differ from actual
This might be a commonly known thing, but I wonder if there is any best practice of dealing with data spill-over in Delphi.
Say I have a variable Dt that is assigned a value of 0.01 in code. When Delphi runs through it, the value of Dt in debug mode…

SamAct
- 529
- 4
- 23
0
votes
2 answers
What is that the Error of Illegal assignment and how to correct it?
procedure tri_selection(t: tab; n: Integer);
var
i, j, min, aux: Integer;
begin
for i := 1 to n - 1 do
begin
min := i;
for j := i + 1 to n do
if t[j] < t[min] then
j := min;
if min <> i then
begin
aux :=…

bilel kalamoun
- 5
- 2
0
votes
2 answers
How to find the biggest number from a txt file?
I have to find out the biggest number from a txt file. Numbers are for example:
9 8 7 6 5
Someone told me, that it should works, but it didn't, and I have no clue how to work with file bcs.
program file;
uses crt;
var…

Blablabla
- 175
- 3
- 9
0
votes
0 answers
Pascal exam procedure, dont understand
This is the problem
Can someone please help me, I really do not understand how on earth did they get x*y in this procedure ... Question asks what does procedure do ?
PROGRAM iz52(output);
VAR pom: integer;
FUNCTION calc(x,y: integer):…
0
votes
0 answers
ARGUMENTS type in pascal
I want to make a procedure to write a color text, similar writeln();
writelncolor(color:byte;args:arguments);
But when I compile it, Pascal found an error not found type Arguments
I looked in Lazarus, in unit System, it have writeln…

Vuio
- 140
- 1
- 7
0
votes
2 answers
Convert algorithm from pascal to c#
I am trying to convert this thing (Shannon-Fano algorithm) from pascal to c#:
program ShennonFano;
uses crt;
const
a :array[1..6] of char = ('a','b','c','d','e','f');
af:array[1..6] of integer = (10, 8, 6, 5, 4, 3);
procedure…

coldembrace
- 549
- 8
- 19
0
votes
1 answer
Turbo Pascal: check if string contains numbers
As it's said in the title Im having trouble finding a solution on how to check if a string PW contains a number or not. How can i check in TP if the string PW contains a digit?
repeat
writeln;
writeln('Ok, please enter your future…
user6548546
0
votes
0 answers
how to convert this turbo pascal code to turbo c++?
I learned turbo pascal eight months ago and now I am studying turbo c++, so far I only know how to translate writeln and readln to turbo c++. Could anyone help me translate this code from turbo pascal to turbo c++ please? Thank You…

Jane Doe
- 29
- 7
0
votes
2 answers
Troubles with pascal conditions
I'm writing the program with Pascal. And have some troubles with conditions.
For example, if you write in input
1 1
1 4
5 1
2 2
tArea1 = 6 and sumAreas = 6 too
But in "if" structure this doesn't working correctly.
Help me, please. Tnx.
var
…

Alexander Seredenko
- 799
- 3
- 9
- 26
0
votes
1 answer
Square with diagonal in Pascal
I have written an application which will write square with diagonal (from left side) - output:
+ * * * *
* + * * *
* * + * *
* * * + *
* * * * +
Code for first application:
PROGRAM cycle4;
USES CRT;
VAR a,r,s:INTEGER;
BEGIN
CLRSCR;
WRITE…

user4653508
- 23
- 1
- 3
0
votes
2 answers
How do I close the DOS screen after I run a pascal program and I'm stuck in a loop?
Lets say I've made a pascal program. Let's say that I haven't saved the program and I mistakenly created a loop. I ran the program and I'm stuck in a loop in the DOS run screen. How do I get out without Alt+F4? The program I am using is Turbo…

RoLeagueGamers
- 51
- 4
0
votes
2 answers
How to load an image to Turbo Pascal using the graph unit
I need to load a single bitimage to a Pascal program, is there a way to do it or I must draw pixel by pixel?

user3762058
- 1
- 1
- 1
0
votes
0 answers
Turbo Pascal handle Nan and INF values in floating point variable
I've got a Turbo Pascal 5.5 program which has generated a binary data file containing Not A Number values. Using Turbo Pascal 5.5, I can import the data file correctly. But when I get an range-check error when I test
If a.aSingle > 0 then
I can, of…

david
- 2,435
- 1
- 21
- 33
0
votes
1 answer
Turbo Pascal, Capture Writeln using stream?
I've got a legacy TP5 program. It compiles and runs OK using TP7. I'd like to capture and log some of the write / writeln statements. I can do a global search-and-replace for write and writeln, so I don't mind code changes like that. It does use…

david
- 2,435
- 1
- 21
- 33