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
8
votes
9 answers

How many different letters are in string

I have to write program that counts how many different letters are in string. For example "abc" will give 3; and "abcabc" will give 3 too, because there are only 3 different letters. I need to use pascal, but if you can help with code in different…
va.
  • 848
  • 3
  • 17
  • 39
8
votes
1 answer

FreePascal / Lazarus and implementing nsurlconnectiondatadelegate

I am trying to implement nsurlconnectiondatadelegate as I need to support async mode - in synchronous mode redirects are followed automatically which I do not want. For reference I have the code working in synchronous mode with urlRequest etc. The…
Tom
  • 3,587
  • 9
  • 69
  • 124
8
votes
2 answers

3 points are collinear in 2d

I am trying to verify when 3 points (double) are collinear in 2-D. I have found different Pascal functions that return true if this is verified; those functions use integer to specify X and Y coordinates. I need a more precise calculation at least…
marcostT
  • 573
  • 1
  • 10
  • 20
8
votes
1 answer

Is it easier to reverse engineer or break a Delphi program if the exe file was compiled with debug compiler settings?

if I accidentally forget to switch to release configuration before releasing my program, does it matter in terms of it being easier to decompile or reverse engineer my code? For example if I accidentally use the following debug compiler options: 1.…
joz ret
  • 83
  • 3
8
votes
4 answers

Are Pascal comments supposed to nest?

I have a compiler homework question that wants me to draw a DFA for Pascal comments, but I have never (and probably never will) use Pascal. The question does not specify if we should use ANSI Pascal or Turbo Pascal, so I was going to do one for…
ubiquibacon
  • 10,451
  • 28
  • 109
  • 179
8
votes
1 answer

Correct way to copy data from TBytes to Array of Byte in Delphi

Given the following: LBytes: TBytes; LArr: array[1..512] of Byte; ... SetLength(LBytes, 512); What is the correct Move() call to copy all bytes from LBytes to LArr? Move(LBytes[0], LArr, Length(LBytes)); // works Move(LBytes[0], LArr[1],…
cytrinox
  • 1,846
  • 5
  • 25
  • 46
8
votes
6 answers

embedding pascal

Is anyone aware of a Pascal interpreter/compiler which is embeddable in C++ (or anything else other than Pascal) applications? I am cloning (for lack of a better word) an application which uses an Object-Pascal compatible scripting language and…
Sam P
  • 131
  • 3
8
votes
2 answers

Why we cannot declare local const variables in inno-setup [Code]?

Do you know why when declaring local const vars, the script cannot compile? Sorry, I know very little pascal and cannot figure out why this is not working! This example (see function CircleArea) shows that my syntax should be…
fubar
  • 338
  • 1
  • 6
  • 20
8
votes
2 answers

Loading pre-compiled script in RemObjects Pascal Script (Delphi)

I am trying to load a pre-complied RemObjects Pascal Script in Delphi at run-time. However when I try to load it Delphi excepts with 'Cannot Import VALUE_TEAMCODE.' Value_TeamCode is a function in my Delphi app that I have already registered with…
Peter Mayes
  • 133
  • 8
8
votes
4 answers

Automatically create Delphi/Freepascal interface unit from C header file

Is it possible to automatically generate interface units from C header files? In particular, I want to wrap the HDF5 library, and it would be great if I could avoid writing the interface unit manually.
andreas-h
  • 10,679
  • 18
  • 60
  • 78
8
votes
6 answers

Type Checking In Pascal

I'm just wondering how it's possible to do type checking in pascal? I have been searching for hours now but I haven't been able to find anything useful. Example: var number: Integer; begin write('Enter a number: '); read(number); if {How…
Radix
  • 1,317
  • 2
  • 17
  • 32
7
votes
4 answers

What are good Lazarus/FPC Resources?

I want to learn to develop applications in Lazarus, but I need resources, preferably books, to Lazarus. Keep in mind that I know 0 of Pascal. Thanks.
dsocolobsky
  • 275
  • 2
  • 5
  • 13
7
votes
5 answers

Is it possible to use a class declared in Implementation section from Interface section

If I understand correctly, the interface section is visible to other units, and the implementation section is visible only in the current .pas file. I have two classes, class TA should be visible to the outside, other class TB should not, but I need…
Bruice
  • 543
  • 3
  • 11
7
votes
3 answers

D3D9 Hook - Overlay with Direct3D9

OK, so I'm trying to do some overlay for some extra buttons on a Direct X game. I found a c++ sample that overlays quite nicely here: http://www.gamedev.net/topic/359794-c-direct3d-hooking-sample/ So I began to convert it to Delphi. With some…
ThievingSix
  • 1,044
  • 1
  • 11
  • 23
7
votes
5 answers

How can I perform the equivalent of shellexecute() in Lazarus for a Mac?

How can I perform the equivalent of shellexecute() in Lazarus for a Mac?
Jamey McElveen
  • 18,135
  • 25
  • 89
  • 129