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

Python+Numpy modules in free pascal

Developing a module (.pyd) for Python in free pascal is fairly easy, see Developing Python Modules with Pascal. But if I want to interface with numpy, this is not that easy. When using C to interface with numpy, you have to add #include…
hdrz
  • 461
  • 6
  • 12
5
votes
3 answers

How to set the value of an enum type?

I have the following: TDirection = (dirNorth, dirEast, dirSouth, dirWest); TDirections = set of TDirection; In a seperate class I have it declared as a property: property Directions: TDirections read FDirections write FDirections; What I want is…
user1175743
5
votes
3 answers

GUI Only By Using FPC

I want to know how I can develop GUI applications(32 Bits) without using Delphi language(Object Pascsl), only by using FPC with Lazarus installed(Pascal). Thanks.
Nathan Campos
  • 28,769
  • 59
  • 194
  • 300
5
votes
1 answer

Trying to understand Wirth's Pascal pl/0 compiler code

Is there a simple explanation of Wirth's source code or even a version with a little more commenting so that I can figure out how it works? Wirths pl/0 compiler is here: http://www.moorecad.com/standardpascal/plzero.pas My main goal is to modify it…
Jason M.
  • 692
  • 2
  • 8
  • 24
5
votes
1 answer

Get pixel color under mouse cursor - FAST way

Is there ANY way to get pixel color under mouse cursor really FAST? I have a mouse hook and I try to read pixel color during mouse move. Its kind of ColorPicker Any attempts with getPixel and BitBlt were terribly slow. UPDATE - ADDED CODE unit…
Jan Pfeifer
  • 2,854
  • 25
  • 35
5
votes
4 answers

How do I play a wav file from a Free Pascal application running on Linux?

I have a multi-platform application written in Free Pascal. This application plays a short sound on some event. On Windows, I can do this by MMSystem and sndPlaySound('sound.wav'). However, I don't know how to do this on Linux without external…
Dibo
  • 1,159
  • 17
  • 34
5
votes
2 answers

Delphi TFrame Create/Destroy

How to create (when I want to show it) and destroy (when I want to hide it) frames on the main TForm? Frames' align = alClient. I tried this: The form: unit main; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls,…
Alex P.
  • 3,697
  • 9
  • 45
  • 110
4
votes
1 answer

How do I use CreateFile to access a physical disk?

I asked on the Lazarus programming forum how to open a physical disk. I want to allow the user to select physical disks from their system when they click a "Select Disk" button. There are some examples here at Stack Overflow that are similar but not…
Gizmo_the_Great
  • 979
  • 13
  • 28
4
votes
3 answers

Does Free Pascal have type variables like Haskell?

Haskell lets you define functions like thrice, which accepts an element of type a and returns a list of the element repeated three times, for any data type a. thrice :: a -> [a] thrice x = [x, x, x] Does Free Pascal allow type variables? If not, is…
mcandre
  • 22,868
  • 20
  • 88
  • 147
4
votes
2 answers

Any lib for multi-threading cross-platform for Delphi AND FreePascal?

I'm aware of some Windows Thread Libs for Delphi(OmniThread Lib, BMThreads, etc). But is there a lib that is built to be cross-platform and that can both be used under Delphi and FreePascal?
Gustavo Carreno
  • 9,499
  • 13
  • 45
  • 76
4
votes
3 answers

Casting between parent and child classes in delphi

I'm writing some software that targets two versions of very similar hardware which, until I use the API to initialize the hardware I'm not able to know which type I'll be getting back. Because the hardware is very similar I planned to have a parent…
RobS
  • 3,807
  • 27
  • 34
4
votes
1 answer

How to set ConnectTimeout/ReadTimeout in Indy SSL

How i can set ConnectTimeout/ReadTimeout in Indy when using SSL ? MCVE: program mcve; uses {$IFDEF UNIX}{$IFDEF UseCThreads} cthreads, {$ENDIF}{$ENDIF}SysUtils, IdHTTP, IdSSLOpenSSL, DateUtils; var HTTP : TIdHTTP; SSL :…
RepeatUntil
  • 2,272
  • 4
  • 32
  • 57
4
votes
3 answers

Does Free Pascal have a way to implement SHA256 or SHA512?

In the Free Pascal libraries there's a hash library that enables use of MD5 and SHA1 hashing algorithms (http://wiki.freepascal.org/hash). But what if I wanted to use a higher one, such as SHA256 or SHA512? Could I achieve this using Free Pascal?…
Gizmo_the_Great
  • 979
  • 13
  • 28
4
votes
1 answer

Why this C to Pascal conversion crash?

I have this C code: /* WARNING: The order of this table must also match the order of a table located in AcquireResizeFilter() in "resize.c" otherwise the users filter will not match the actual filter that is setup. */ typedef enum { …
zeus
  • 12,173
  • 9
  • 63
  • 184
4
votes
3 answers

How to define operator in pascal

In my program I have a need to get percent often in code. For now i have this function to solve it function percent(whole, part: double):double; begin percent:= whole * part / 100; end; I was wondering is there any way I could make new…