Questions tagged [freepascal]

Free Pascal is a multi-dialect, multi-platform Object Pascal compiler. Originally started to replace the retired Turbo Pascal compiler, it now attempts to follow the Delphi dialect still being developed by Embarcadero Technologies. It has compiler modes for Delphi, Turbo Pascal and Mac Pascal. It also has two modes for its own superset dialect: One mode with exceptions, classes and interfaces, and mode one without.

Free Pascal is a multi-dialect, multi-platform Object Pascal compiler. Its main focus are the Delphi and Turbo Pascal dialect, but a substantial Mac Pascal subset and a minor ISO Pascal mode exist as well.

Free Pascal is available for most common architectures and operating systems.

http://www.freepascal.org

1236 questions
224
votes
4 answers

Why would introducing useless MOV instructions speed up a tight loop in x86_64 assembly?

Background: While optimizing some Pascal code with embedded assembly language, I noticed an unnecessary MOV instruction, and removed it. To my surprise, removing the un-necessary instruction caused my program to slow down. I found that adding…
tangentstorm
  • 6,851
  • 2
  • 26
  • 37
73
votes
2 answers

Webview not displaying in MacOS using Delphi XE2

I have started to convert the Webview interfaces to be consumed in Delphi. I have managed to get the webkit library to load, and the interface methods that is called appears to work correctly, however, I cannot seem to display the Webview on the…
Phillip Roux
  • 1,009
  • 7
  • 12
25
votes
1 answer

Difference between armeabi and armeabi-v7a

As far as I can tell from the docs, the difference between the two supported flavors of ARM architecture in Android NDK is only in the set of supported CPU instructions. Is that really so? Is there no difference in calling conventions, or system…
Seva Alekseyev
  • 55,897
  • 22
  • 151
  • 252
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,191
  • 13
  • 33
16
votes
5 answers

Is there a simplistic way to extract numbers from a string following certain rules?

I need to pull numbers from a string and put them into a list, there are some rules to this however such as identifying if the extracted number is a Integer or Float. The task sounds simple enough but I am finding myself more and more confused as…
Craig
  • 1,774
  • 9
  • 37
14
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
  • 585
  • 3
  • 10
  • 19
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
12
votes
2 answers

How to detect memory leaks in Free Pascal/Lazarus?

In Delphi, I usually write a simple leak test like this: program MemLeak; {$APPTYPE CONSOLE} uses SysUtils; procedure Leak; begin { Put leaking code here. } end; begin ReportMemoryLeaksOnShutdown:= True; try Leak; …
kludg
  • 26,590
  • 4
  • 63
  • 115
11
votes
1 answer

Delphi Dependency Injection: Framework vs Delegating Constructor

Why would you use a Dependency Injection Framework when you can simple use the following pattern? unit uSomeServiceIntf; interface type ISomeService = interface procedure SomeMethod; end; var CreateSomeService: function:…
11
votes
2 answers

Why Pascal const arrays aren't actually constants?

Program ConstTest; Const constVar = 1; Begin constVar := 3; WriteLn(constVar); End. It's pretty obvious that the above code will not compile, because it's not right to change the value of a constant. However, following code will…
Aleksejs Popovs
  • 840
  • 2
  • 12
  • 18
11
votes
8 answers

Where can I find a "Turbo" or "Lite" version of Delphi?

I have a co-worker with a strong background in Ruby that is interested in getting started with Delphi and native development. However, I understand that Turbo Delphi (based on Delphi 2006) is no longer available for download. So...where does that…
Mick
  • 12,760
  • 9
  • 61
  • 118
11
votes
2 answers

What is Free Pascal's equivalent of Delphi's TStopWatch?

I need to implement simple performance benchmarking in Free Pascal. In Delphi I am using TStopWatch record from Diagnostics unit, what can I use in Free Pascal/Lazarus?
kludg
  • 26,590
  • 4
  • 63
  • 115
10
votes
2 answers

How to call a list of the physically attached hard disks using Free Pascal, or, failing that, Delphi?

Further to this question and this one that I asked more recently but without the correct specifics...and lastly this one that I asked at the Free Pascal forum specifically.... Can anyone provide me with guidance, examples or a link to something…
Gizmo_the_Great
  • 959
  • 13
  • 27
10
votes
3 answers

Single-source unit tests for Free Pascal and Delphi

Is there a way to write unit tests so that they can be compiled and run both with Delphi and Free Pascal? There are different unit test frameworks for Delphi and Free Pascal, which causes duplicate work for developers who target both compilers (for…
mjn
  • 35,561
  • 24
  • 160
  • 351
9
votes
6 answers

Which should I learn first: Boost or Qt

I'm primarily a hobbyist programmer. I learnt the basics of C++ and then moved to Java which I loved because of it's simplicity. Now I'm coming back to C++, and I'd really like to learn GUI with the Qt API but i've heard a lot of talk about the…
W.K.S
  • 8,845
  • 13
  • 67
  • 115
1
2 3
82 83