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
0
votes
0 answers

FPC JSON-unit: don't re-sort

Every time I save file using JSONConf unit, json file is sorted in new order. E.g. "myname: {...}" can be saved to end of file or to middle of file (middle of key order). How to set one sort order forever, e.g. sort by ABC. This way text editor can…
Prog1020
  • 4,530
  • 8
  • 31
  • 65
0
votes
0 answers

How to apply multiple filters on TSQLQuery

Singular filter on some column works, for example: SQLQuery.Filter := 'ColumnName="some_filtered_text"'; // OK But how to apply filter to many columns? For example this doesn't work: SQLQuery.Filter := 'ColumnName1="some_filtered_text1", …
TSr
  • 331
  • 1
  • 12
0
votes
1 answer

FileWrite doesn't write all bytes

I'm using the write method to directly write pixels which is an array of array[(R, G, B)] of byte;. The pixels is properly allocated like so: setlength(pixels, 750000); what I do is as follows: f := TFileStream.create(FileName, fmCreate); written :=…
Imobilis
  • 1,475
  • 8
  • 29
0
votes
1 answer

EBusError on assigning PageControl fpc/Lazaurs

I am trying to create dynamic TTabSheets for my program. Written in FPC/Lazarus being built for ARM/WinCE Everything works, including design time created tabsheets but the following code try Tab := TTabSheet.Create(PageControl1); …
Christopher Chase
  • 2,840
  • 6
  • 36
  • 57
0
votes
1 answer

Why is LocalTimeToUniversal(Now) two hours later with Lazarus 1.6 / FPC 3.0?

My local time zone is UTC+1, so when it is 16:30 here, this line ShowMessage(DateTimeToStr(LocalTimeToUniversal(Now))); displays the correct value "12.12.2015 15:30" with Lazarus 1.4.2 / Free Pascal 2.6.4. With Free Pascal 3.0.0 (Lazarus 1.6RC1) it…
mjn
  • 36,362
  • 28
  • 176
  • 378
0
votes
0 answers

Direct3D 11 FreePascal Create Device

I have just want to test direct3d 11, but it crashes at D3D11CreateDeviceAndSwapChain call with error message project raise exception class 'external: ?' at address. Video Card supports Directx 11. What is wrong? D3D11CreateDeviceAndSwapChain( nil,…
0
votes
0 answers

Custom TEdit with input restrictions

What methods should TEdit descendant override in order to react to the OnKeyPressed event itself, instead of some external function? For clarification: my TEdit have certain symbols that can be typed in, but not all. The most simple solution is to…
RomaValcer
  • 2,786
  • 4
  • 19
  • 29
0
votes
1 answer

Reading VB6 three-dimensional array in FreePascal/Lazarus

I wonder how to decode a three-dimensional dynamic array of a custom type written to a binary file in VB6. The custom type is defined as follows: Type XYByte X As Byte Y As Byte End Type It represents two coordinates of a contact point. The…
Cigydd
  • 93
  • 1
  • 8
0
votes
1 answer

SIGILL Exception in Lazarus

After working fine for a while, my code started to raise a SIGILL exception when used. I didn't understand the documentation. What does the SIGILL exception means in practical therms? This is the code that is raising the exception, could you help me…
Tiago Duque
  • 1,956
  • 1
  • 12
  • 31
0
votes
1 answer

Cast or convert AnsiString to NSMutableData in Objective Pascal unit over Cocoa classes

Writing a Lazarus unit with Objective Pascal to interface with Cocoa classes on Mac OS X. I want to pass an AnsiString from the FreePascal caller to a Cocoa class requiring an NSMutableData parameter value. How can I cast or convert the AnsiString…
Lor
  • 141
  • 10
0
votes
2 answers

Updating StringGrid from Thread

Work is done in a number of threads and a TListView is updated from these threads. They each have a reference to their associated TListItem in the ListView, so it doesn't matter if the listview gets sorted later. The right cell will be updated…
Rimfire
  • 378
  • 1
  • 3
  • 12
0
votes
1 answer

Truncating a TMemo in Lazarus by removing first X lines

I'm using a TMemo in Lazarus to display a rolling log, but I want to limit it to the last 500 entries. What I'd like to do is (in pseudo-code): if (log_TMemo.Lines.Count > 500) then log_TMemo.Lines := log_TMemo[LinesCount - 500 to…
Fat Monk
  • 2,077
  • 1
  • 26
  • 59
0
votes
1 answer

What versions of lazarus and free pascal are stable and compatible

AFAIK the installation of Lazarus consists from downloading it and FPC from SVN and compiling. There's a problem(*) with the newest versions and I'd like to install a stable version. However, all I have are the SVN revision numbers and I couldn't…
maaartinus
  • 44,714
  • 32
  • 161
  • 320
0
votes
1 answer

Running Freepascal compiler in a docker container

I want to use the Freepascal compiler inside a docker container, came from ubuntu 14.10 image. When I want to install it via apt-get install fp-compiler or fp-compiler-2.6.2 I got the error package not found. But if I browse the package list online…
Stefc
  • 73
  • 6
0
votes
1 answer

How can I receive a string from FPC DLL?

How can I receive a string from a FPC DLL? I would like to send two pointers concat them and receive the result in another string in Delphi. library Test; {$mode Delphi} uses Classes; function Concat(const S1, S2: PWideChar): String;…