Questions tagged [fpc]

FPC (Free Pascal Compiler) is a 32/64-bit multi-architecture Object Pascal compiler with both Turbo Pascal, Apple Pascal and Delphi dialects.

FPC (Free Pascal Compiler) is a 16/32/64-bit multi-architecture Object Pascal compiler with both Turbo Pascal, Apple Pascal and Delphi dialects.

Free Pascal is the compiler core under the Lazarus RAD project, which provides a portable Delphi-like IDE and RAD. Lazarus has its own tag on Stackoverflow.

However Free Pascal is used directly for server/web/control apps too.

Free Pascal currently supports x86/x86_64, powerpc/powerpc64, sparc and assorted ARMs, and most popular OSes.

8086 (16-bit x86), m68k and Mips are in advanced stages of preparation in the development branch.

164 questions
1
vote
1 answer

Can anyone point me to a AMF library in either Delphi or FreePascal?

I've done a simple search on the usual suspects(Google Code, Source Forge, SO) but did not find any hints of a project for AMF or Flash/Flex remoting. Has anyone stumbled on a project of this nature?
Gustavo Carreno
  • 9,499
  • 13
  • 45
  • 76
1
vote
3 answers

Empty main form in GUI app converted from Delphi to Lazarus

I have converted my 2 GUI apps from Delphi to Lazarus. Both apps compile for Win32 platform, i386 and with GUI. Main form were converted using Lazarus tool and can be edited from IDE. But when I run such application main form does not appear, only…
Michał Niklas
  • 53,067
  • 18
  • 70
  • 114
1
vote
1 answer

How parse JSON from string in Lazarus 1.x

Lazarus is not my favorite dev tool :) i have a string with json data, how i can parse it, and output specified key,value? use ...., fpJSON, JSONParser; ... var jsonstring:string; jsonstring:='[{"id":11,"text":"TEST","description":"Some…
Anton Shevtsov
  • 1,279
  • 4
  • 16
  • 34
1
vote
2 answers

loop through ip address pascal

In Freepascal, how can I loop through a range of IP addresses? Any units that do ip specific stuff that might handle this? I've tried one called inetaux, but it's flawed and doesn't work.
1
vote
1 answer

Console application never returns when ran with TProcess

I am using Windows Server 2008 and I want to get the DNS Server. So I tought that the fastest way should be executing ipconfig and then parsing it's output using TProcess. I have came up with this code : var proces : TProcess; begin ... …
opc0de
  • 11,557
  • 14
  • 94
  • 187
1
vote
2 answers

How can I use complex types referencing generic type

Consider the following types type TRecs = array[0..100000] of TRec; PRecs = ^TRecs; TRecObject = class private fRecs: PRecs; public constructor Create; property Recs: PRecs read fRecs; end; I would like to make TRec a…
Maksee
  • 2,311
  • 2
  • 24
  • 34
1
vote
2 answers

What is the standard practice of organizing programs in files in Pascal?

I want to know how source file trees are organized in Pascal. From the Language Reference Guide from FPC, it seems that programs and units must be entirely contained in single files (unless the ${INCLUDE} directive is used). I can think of several…
Staven
  • 3,113
  • 16
  • 20
1
vote
1 answer

Cannot modify params in EnumWindows callback

I try to get the main window handle using following code in Lazarus (Free Pascal): function FindMainWindow(Pid: LongWord): LongWord; type TParam = record Window: HWnd; Test: Integer; Pid: LongWord; end; PParam = ^TParam; var …
Maximilian Ruta
  • 518
  • 7
  • 18
1
vote
0 answers

Registering required units on adding a component onto a form fails under Lazarus

Lazarus 0.9.30.4 I am developing a component that requires several units to be added into the unit uses clause when the component is dropped onto a form. From this article I discovered the way to set the designer hooks and add required files into a…
AlexeyDaryin
  • 903
  • 6
  • 15
1
vote
1 answer

How to obtain the config folder/file across platforms under Free Pascal/Lazarus?

Is there a set of functions that give you the file and/or the folder where to place an application's config? I would like it to return the folder only and/or the file only on the appropriate place for each system.
Gustavo Carreno
  • 9,499
  • 13
  • 45
  • 76
0
votes
2 answers

Can TStringList.Sort return sorted indexes?

Using TStringList.Sort to sort a collection of strings in free pascal, I need to remember the initial order. Is there a possibility to return the sorted indexes? If not, how can this be done efficiently?
hdrz
  • 461
  • 6
  • 12
0
votes
1 answer

XCode Command Line App and Free Pascal Compiler

I need to build a quick command line app on my mac using xcode and I want to use the free pascal compiler instead of the c/c++ in XCode how do I change XCode's settings to use this. (sorry if its a basic question I'm used to developing in Delphi on…
Barry
  • 1,084
  • 1
  • 8
  • 22
0
votes
1 answer

How To Detect Which OS Is Running The Program?

I'm building an application that might have some different tasks depending of the OS which is running it, so I want to know if there is any way to detect the OS and store it in a variable.
Nathan Campos
  • 28,769
  • 59
  • 194
  • 300
0
votes
2 answers

Can Pascal units be compiled as executables?

I like my libraries to double as executables. The desired behavior is: $ ./scriptedmain Main: The meaning of life is: 42 $ ./test Test: The meaning of life is: 42 How can I: Get scriptedmain.p to compile into a scriptedmain binary? Prevent test.p…
mcandre
  • 22,868
  • 20
  • 88
  • 147
0
votes
1 answer

Linux linker flag -lXi not finding lib when compiling Lazarus code

After I solved my first problem I got into another one. Looks like I'm missing some kind of library, making the linker complain that the -lXi is not working. I've included most of the Xorg devel packages, what more do I need?
Gustavo Carreno
  • 9,499
  • 13
  • 45
  • 76