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
4
votes
1 answer

Duplicate identifier of property and method parameter of a class

I transferred my project from Delphi to Lazarus. In a form I have a private method with parameter var Active: Boolean. In Delphi it was ok, but Lazarus give an error Error: Duplicate identifier "Active" and Hint: Identifier already defined in unit…
4
votes
1 answer

Add Free Pascal Compiler in Heroku

I have a Rails application where some features need the Free Pascal Compiler to work. Everything works fine localy, but I want to deploy this in Heroku now. There is any way to install the compiler there? EDIT: I tried these steps. As result, I…
rwehresmann
  • 1,108
  • 2
  • 11
  • 27
4
votes
1 answer

Three digits real number in Pascal

I have code in Free pascal, I have real number 3.285714287142857E+000 from a/b. program threedigits; var a,b:real; begin a:=23; b:=7; writeln(a/b); end. How to change the number to three digits after comma (3.286)?
user7271590
4
votes
0 answers

How to pass struct from Lua to Pascal

I have Lua tables that have to pass data to Pascal. Below is the method that I'm currently using. Lua Code: local ffi=require("ffi") ffi.cdef[[ void __cdecl Print(char * S); void __cdecl Func1(struct structLIST *struct1); #pragma pack(1) typedef…
user2032083
  • 313
  • 2
  • 4
  • 14
4
votes
1 answer

How do install OmniPascal into vscode

From the OmniPascal page on Visual Studio Marketplace: How to install Install Visual Studio Code and open it. Open View -> Command Palette... and type ext install OmniPascal Restart Visual Studio Code and open File -> Preferences -> User…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
4
votes
4 answers

Is there a SAX Parser for Delphi and Free Pascal?

Besides MSXML and SAX for Pascal, can you recommend a SAX parser for Delphi? It would be great if it could be used in cross-platform applications with Free Pascal.
mjn
  • 36,362
  • 28
  • 176
  • 378
4
votes
2 answers

Overloading the assignment operator for Object Pascal

What happens when the assign operator := gets overloaded in Object Pascal? I mainly mean what gets evaluated first and more importantly how (if possible) can I change this order. Here is an example that bugs me: I declare TMyClass thusly: TMyClass =…
N00BKING
  • 41
  • 4
4
votes
0 answers

How does the Freepascal Memory Manager work on enlarging arrays

I recently stumbled over an issue within a FreePascal project I'm developing: The application requires a look-up array which may become very large during the runtime (a few million entries). Each array element is about 8 bytes in size. I observed…
user5362185
4
votes
1 answer

Fpgui and lcl and qt, what are the advantages and disadvantages?

Lazarus Ide can use several gui libraries. I am on Windows. I wonder what are difference among them... It is clear that lcl is most stable. Why would anyone use Qt and fpgui once they will be of good quality?
Aftershock
  • 5,205
  • 4
  • 51
  • 64
4
votes
0 answers

Spearmans rank with ties in pascal

I'm working on a project where I need to calculate the spearman's rank of some data, Currently my program can calculate the spearmans rank as long as their are no tied rankings. I would use an existing unit but I need to display the ranked values in…
Confused
  • 41
  • 1
4
votes
1 answer

Static code analysis for Free Pascal

Are there any tools available that allow static code analysis for Free Pascal sources? I would prefer a solution that allows for checking a whole Lazarus project.
jwdietrich
  • 474
  • 6
  • 17
4
votes
3 answers

Using windows command line from Pascal

I'm trying to use some windows command line tools from within a short Pascal program. To make it easier, I'm writing a function called DoShell which takes a command line string as an argument and returns a record type called ShellResult, with one…
Jordan
  • 41
  • 1
  • 1
  • 2
4
votes
3 answers

Exchanging strings (PChar) between a Freepascal compiled DLL and a Delphi compiled EXE

After a lot of experimentations, I found a way to exchange PChar from a FreePascal compiled DLL with a Delphi compiled EXE. I'm in charge of both the DLL and EXE source code but one MUST BE in FreePascal and the other one in Delphi. My solution…
jonjbar
  • 3,896
  • 1
  • 25
  • 46
4
votes
1 answer

Get an SIGSEGV error when add a PNGImage in TGLCompositeImage

I am usings Lazarus 1.2.4 and GLSCENE svn 6462 (1.2 svn version) I add material with this function below function AddMaterial(aMatLib: TGlMaterialLibrary; aFileName, aMaterialName: string): TGlLibMaterial; overload; begin result :=…
azrael11
  • 417
  • 6
  • 18
4
votes
2 answers

Timer Queue in Windows Service

For a Windows Service, I need a timer to perform a certain task regularly. Of course, there are many options that seem superior to a timer (multithreading, calling method directly from the service's main thread), but they all have their…
LeRookie
  • 311
  • 3
  • 12