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

1338 questions
7
votes
2 answers

Simple Delphi 3d functions

Could anyone help me with examples of some bare-bone, old school 3d methods in Delphi? Not using openGL or firemonkey or any external library (vanilla canvas coding). What i want to do is to be able to rotate X number of points around a common…
Jon Lennart Aasenden
  • 3,920
  • 2
  • 29
  • 44
7
votes
2 answers

Get Linux system info with Lazarus and FreePascal

I am really new to Lazarus/FreePascal and I have no prior Delphi experience. I want to be able to get OS version information and user account type on both WIndows and Linux. I saw that there is a Windows system API, but could not find anything…
Shade
  • 9,936
  • 5
  • 60
  • 85
7
votes
1 answer

How can I use anonymous methods in Free Pascal?

I tried to use Delphi's syntax for anonymous methods: type fun = reference to function(): Integer; Fpc shows a syntax error: Error: Identifier not found "reference" What's the Free Pascal equivalent to Delphi's anonymous methods, if any?
mcandre
  • 22,868
  • 20
  • 88
  • 147
7
votes
2 answers

Instance reference in Delphi?

What's the Delphi equivalent of 'this' in C++? Could you please give some examples of its use?
W.K.S
  • 9,787
  • 15
  • 75
  • 122
7
votes
1 answer

FreePascal 64 bit DLL and calling C# Application

I am trying to compile a 64bit dll for use with a 64bit C# application. I have a simple class and a simple app to try and test it and it falls over no matter what I try and do. Here is the code: Delphi library project1; {$mode objfpc}{$H+} uses …
Jon
  • 38,814
  • 81
  • 233
  • 382
7
votes
2 answers

Will const parameters and typecasting work as before under Delphi 64bit?

As a general rule I have circumvented a lot of classical design traps when using pointers by taking advantage of Const (untyped) parameters rather than hard coded types. This gives me the benefit of speed when executing advanced graphical functions…
Jon Lennart Aasenden
  • 3,920
  • 2
  • 29
  • 44
7
votes
7 answers

Why do Pascal control structures appear to be inconsistent?

Most Pascal control structures make sense to me, like: for ... do {statement}; if (condition) then {statement}; while (condition) do {statement}; where the {statement} is either a single statement, or a begin ... end block. I have a problem…
70Mike
  • 304
  • 2
  • 12
7
votes
3 answers

Can Identifiers be duplicated across cases of a variant record in FreePascal?

Here's my problem: I want to create a record type where among the cases of a variant record, some, but not all, will have a certain field. According to the wiki, this is perfectly legal. And yet, when I tried to compile the following code: program…
junius
  • 570
  • 3
  • 14
7
votes
3 answers

Memory leak in Free Pascal caused by methods with 'pointer' parameter

After replacing hard type casts of AnsiString to TBytes (array of string) with a ToBytes method (see below), Delphi reported no memory leaks - Free Pascal 2.6.2 however shows a leak in case the TBytes value is passed to a method with a parameter of…
mjn
  • 36,362
  • 28
  • 176
  • 378
7
votes
1 answer

fpcmake and Makefile.fpc, where can I get some training?

I've never used any of these, but they are listed on the main Free Pascal site and I would really like to get my hands on: Beginners guide, to get me started Advanced guide, to help me grow All this in case it's still used/standard. Thanks
Gustavo Carreno
  • 9,499
  • 13
  • 45
  • 76
7
votes
3 answers

How to switch between Win32/64 code generation in Lazarus?

I installed 64-bit Lazarus and want to generate 32-bit code. When I try to set Target OS to Win32 I get error message Compiler "C:\Programs\lazarus\fpc\2.6.0\bin\x86_64-win64\fpc.exe" does not support target x86_64-win32 so I guess I need to…
kludg
  • 27,213
  • 5
  • 67
  • 118
7
votes
1 answer

Is there a library for sanitizing query parameters for PostgreSQL or SQL in general, for FreePascal and Delphi?

I got bitten my first sql escaping error (it was long overdue) when I tried to execute the PostgreSQL query below with a value containing an apostrophe eg. O'Brien, using FreePascal and Lazarus SQL.Add(format('select * from zones where…
vfclists
  • 19,193
  • 21
  • 73
  • 92
7
votes
1 answer

Why does gdb think my x86-64 program is i386?

I am attempting to debug a 64-bit program but gdb seems to think it has an i386 architecture. # file /usr/local/bin/foo /usr/local/bin/foo: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux…
Matt Hulse
  • 5,496
  • 4
  • 29
  • 37
7
votes
4 answers

Is there a central FreePascal/Lazarus Component repository?

I'm looking to find something like Torry but instead of being Delphi centric, it should be Lazarus centric. I'm aware of the Source Forge Project Code and Component Repository but I'm looking for something with more span and a bit more searching…
Gustavo Carreno
  • 9,499
  • 13
  • 45
  • 76
6
votes
1 answer

OpenCV pointer to bitmap processing

I've created a shared library for contour detection that is loaded from a Delphi/Lazarus application. The main app, passes a pointer to a bitmap to be processed by a function inside the library. Here's the function inside the library. The parameter…
leonardorame
  • 1,131
  • 4
  • 18
  • 35
1 2
3
89 90