Questions tagged [pascal]

Pascal is an imperative language from the Wirthian family created in 1969. It was widely used in engineering and teaching in the 1970s and 1980s. It lives on in compilers as Free Pascal and Delphi.

Pascal is an influential imperative and procedural programming language, designed in 1969 and published in 1970 by Niklaus Wirth as a small and efficient language. It was largely (but not exclusively) intended to teach students structured programming and data structuring.

Pascal is a descendant of , but it was implemented on a wide range of architectures, from PDP-11s, IBM PCs, to CDC Cyber and IBM System 370 mainframes. Pascal probably reached critical mass around the time Borland released Turbo Pascal in 1983.

Wirth later developed Modula-2 and Oberon and those languages share much of Pascal's design. Other derivatives include OOP-based Object Pascal (used in Delphi and Lazarus/Free Pascal).

Pascal is a purely procedural language and includes control statements with reserved words such as if, then, else, while, for, and so on. However, Pascal also has many data structuring facilities and other abstractions not included in ALGOL 60 like type definitions, records, pointers, enumerations, and sets.

External Resources

Free Pascal/Delphi Programming Books

2598 questions
0
votes
0 answers

Delphi Rem Objects Pascal compile in Linux 64

Did anyone manage to build Rem Objects Pascal Script for Linux 64? Currently Linux Platform seems only to be supported for FPC. That and the fact that it compiled with Kylix long ago leads me to the assumption that it should also be possible to…
MichaSchumann
  • 1,361
  • 1
  • 17
  • 36
0
votes
1 answer

drawing quadratic function graphs using canvas

Hi everyone I’m doing an exercise where i have to solve quadratic equation (ax^2+ bx+ c) where x1 and x2 are the solutions then i have to draw the graph of the function but before i have to find Xmin Xmax where if(x1 > x2) then Xmin := (2 *…
jak_es
  • 19
  • 3
0
votes
1 answer

How to use TTimeEdit in Lazarus Pascal?

I need to copy files from one directory to another in time (set by the user like 22:00) automatically. How I have to set my schedule procedure of copy (everyday till manually stopped) to start at time which set up in TTimeEdit? Here is my…
Marcell Nemeth
  • 97
  • 3
  • 4
  • 13
0
votes
1 answer

Even when constant is define as 1 to maxint , 0 is still accepted in Pascal

I'm confused because when I define a type from 1 to maxint in Pascal and I make the choice "0" which should return back to the repeat loop. Here is my code: program Tanken; type tZahl = 1..maxint; var tag1 : tZahl; wahl : tZahl; liter, p :…
Saizzou
  • 58
  • 8
0
votes
1 answer

How to make data type "real" shorter in Pascal

My program transfers millimeters to meters and centimeters. And it is working, but answer is like 1,394900000000000000... How to make it shorter? Program radiuss; var mill : real; metr : real; cent : real; Begin Writeln('Сколько миллиметов надо…
George
  • 47
  • 1
  • 8
0
votes
1 answer

How to fix an error in a for loop. Pascal

I wrote a programm, but there is an error that i can't understand. Error: main.pas(23,11) Fatal: Syntax error, ")" expected but "ordinal const" found program Hello; <-- 10 line var x : integer; y : integer; begin for x := 0 to 120 do …
George
  • 47
  • 1
  • 8
0
votes
1 answer

PASCAL procedure won't read value from an external variable

Given a, b and c, calculate: 2^a + 2^b + 2^c. program power; var a,b,c, r1,r2,r3 :integer; procedure power2(pwr :integer; var result :integer); var i :integer; begin i := 1; result := 1; while pwr <= i do begin result :=…
pETROVIO
  • 3
  • 1
0
votes
1 answer

Is there a way to find out the location that the executable file is being run from during runtime?

I am attempting to create a program that places a copy of itself into the windows start-up folder. if the program is being run from anywhere that isn't the start-up folder, I would like the program to add the users username to a text file where the…
Darcy Power
  • 195
  • 12
0
votes
1 answer

FreePascal - How can I copy a file from one location and paste it in another?

I am attempting to get a program to paste a copy of itself in the windows start-up folder. I have only been able to find the Lazarus function included in FileUtils, CopyFile() but as I'm not using Lazarus this solution doesn't work for me. is there…
Darcy Power
  • 195
  • 12
0
votes
1 answer

How can we determine a program is already running in either in the current user or other user in delphi

I am trying to determine whether a certain process is running under the current user or under another user on the same pc. I've applied the following code and it works well as it program can determine the process from the task manager if that the…
Leong
  • 229
  • 2
  • 11
0
votes
1 answer

Is there any way to convert a String variable into a Char

I'm asking if is there a way to convert a unit of a string into a char? to be more clear, is there a way to legalize this instruction: var s : String; begin s:='stackoverflow'; ord(s[1]); // Illegal expression end. Getting the…
MEDX
  • 89
  • 8
0
votes
1 answer

Functions written in VB6 requires helpmigrate to Delphi

i am struggling since 2 weeks to migrate my VB6 code to Delphi (with intermediate knowledge of Delphi). As i stuck on this Function can someone please help me to convert following function (written in VB6) to Delphi: ( Thanks in advance) Public…
Gandhiman
  • 23
  • 3
0
votes
1 answer

Why does setting a Char variable to nil cause compilation to fail?

In my case below I don't want c to be assigned to anything until the first character of the file is read. I tried setting the Char variable c to nil (c := nil;) but compilation fails. I tried an empty string like below, and still doesn't work. It…
BugHunterUK
  • 8,346
  • 16
  • 65
  • 121
0
votes
1 answer

Delphi Records - creating a pointer to it

I'm trying to see how I can create a pointer to a simple record. I have searched for similar topics before posting but it's quite confusing. I create A & B of which are actual Records. I then have a variable C which I want to be just a 'pointer to…
Peter W.
  • 115
  • 1
  • 8
0
votes
1 answer

How to change between python, pascal, and javascript language easily in Visual Studio Code?

I just learned programming, and I just installed vscode. Can I change between programming languages easily? And how to run Pascal programming in it?