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
18
votes
4 answers

Why do Delphi and Free Pascal usually prefer a signed-integer data type to unsigned one?

I'm not a Pascal newbie, but I still don't know until now why Delphi and Free Pascal usually declares parameters and returned values as signed integers whereas I see them should always be positive. For example: Pos() returns type of Integer. Is it…
Astaroth
  • 2,241
  • 18
  • 35
17
votes
1 answer

In Inno Setup Scripting (Pascal), how do you set a global variable's initial value?

(I'm pursuing Inno Setup scripting, but my understanding is that the [Code] section uses Pascal syntax, or a close approximation. I know zero about Pascal or its standard conventions, so apologies in advance for my ignorance.) When defining a…
Syndog
  • 1,531
  • 4
  • 19
  • 27
17
votes
8 answers

What are the pros and cons of RemObjects PascalScript versus the DWS script?

I'm planning to include a pascal script in my application. It does not require any web access, simply access to classes in my Application. It should be fast (compiled). I see that there are a number of scripts available, some are interpreters but…
Brian Frost
  • 13,334
  • 11
  • 80
  • 154
16
votes
6 answers

How to cast a Interface to a Object in Delphi

In delphi 2009 I have a reference to a IInterface which I want to cast to the underlying TObject Using TObject(IInterface) obviously doesn't work in Delphi 2009 (it's supposed to work in Delphi 2010 though) My searches lead me to a function that…
Yona
  • 9,392
  • 4
  • 33
  • 42
16
votes
9 answers

Do console apps run faster than GUI apps?

I am relatively new to world of programming. I have a few performance questions: Do console apps run faster than apps with a graphical user interface? Are languages like C and Pascal faster than object oriented languages like C++ and Delphi? I know…
Omair Iqbal
  • 1,820
  • 1
  • 28
  • 41
16
votes
6 answers

How do I pretty-print JSON in Delphi?

I am looking for a function that will take a string of JSON as input and format it with line breaks and indentations (tabs). Example: I have input line: {"menu": {"header": "JSON viewer", "items": [{"id": "Delphi"},{"id": "Pascal", "label": "Nice…
Andrey Prokhorov
  • 890
  • 2
  • 13
  • 25
15
votes
4 answers

Returning a value in Pascal

For a function to return a value in Pascal the assignment FunctionName := SomeVal; is used. I assume it doesn't stop the function execution in that exact place as return in C does. Is there something similar to C return in Pascal? (I'm using…
Clueless
  • 605
  • 3
  • 10
  • 19
15
votes
2 answers

Delphi Pascal - how to write data to file larger than 2 GB?

I made a tool in Delphi to create rainbow table. It was fine until file grew up to 3.1 GB. I closed my program. Then i opened it again and it crashes while executing this code: Assign(RainbowFile,'Rainbow_table.txt'); {assign a text…
fastman92
  • 351
  • 2
  • 9
14
votes
1 answer

SetLength on multidimensional array

I'd like to know how to set the length of multidimensional arrays/create dynamic multidimensional arrays in Pascal. Like SetLength(arr,len) does for one dimensional arrays. I cannot find the answer.
Jonathan
  • 141
  • 1
  • 1
  • 3
14
votes
3 answers

Large numbers in Pascal (Delphi)

Can I work with large numbers (more than 10^400) with built-in method in Delphi?
regexp
  • 263
  • 2
  • 8
13
votes
1 answer

How do I get a registry value in Inno Setup when the value only uses the default name?

I'm trying to get the install directory of an application from the Windows Registry (Google Sketchup in this case) with Inno Setup's Pascal scripting so I can install a plugin there. The registry key doesn't have a name, it just has "(Default)" in…
kraryal
  • 278
  • 1
  • 3
  • 11
13
votes
7 answers

Screen recorder

I'm interested in a library(for windows) written in Delphi/Pascal or C++ that allows me to record(to a video format) desktop screen, requirements: must be able to specify the frame rate, or at least be able to record @ 5fps; must be open source or…
user497849
13
votes
2 answers

How do I print a tab character in Pascal?

I'm trying to figure out in all the Internets what's the special character for printing a simple tab in Pascal. I have to format a table in a CLI program and that would be handy.
Gabriel
  • 5,453
  • 14
  • 63
  • 92
13
votes
8 answers

Move() to Insert/Delete item(s) from a dynamic array of string

Using System.Move() to insert/delete item(s) from an array of string is not as easy as insert/delete it from other array of simple data types. The problem is ... string is reference counted in Delphi. Using Move() on reference-counted data types…
Phantom
  • 271
  • 1
  • 3
  • 9
13
votes
3 answers

How to check if string contains string in Pascal

I tried the following code which supposed to check if a string contains spaces but I get an error. How else can I check that if Index('some string',' ')>1 then begin Result:= False; end else begin Result := True; end;
user1016179
  • 599
  • 3
  • 10
  • 24