Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal

fpc-pascal · 2023-06

  1. Legitimate use of for and break

    Is http://sprunge.us/MOJIg4 a legitimate use of a for loop with break? I know there are better ways to do it, but I'm just wondering whether it's legitimate. SteveT…

    Steve Litt, Bernd Oppolzer, Dennis Lee Bieber
    27
  2. Pchar from constant string

    What is really happening in this snippet? I think it must be implicitly taking the address of the constant string but is it also adding the null terminator…

    Hairy Pixels, Mattias Gaertner, Michael Van Canneyt
    8
  3. Microsoft SAPI on Freepascal

    I am trying to get Microsoft speech synthesis to work with Freepascal. I am trying to follow the guide here: I don't know what I am doing wrong. SAPI is working on my…

    James Richters, Jean SUZINEAU, Marco van de Voort
    32
  4. SDL2 Event Registration (and case statements)

    The SDL2 documentation recommends you to register constants with: Uint32 SDL_RegisterEvents(int numevents); numevents = the number of events to be allocated. Returns the…

    Rafael Picanço, Guillermo Martínez Jiménez
    3
  5. Subscript pointers

    I've forgotten entirely, what does subscripting a pointer do in Pascal? p[0] returns 100 but after that garbage. Seems like a c-style array which doesn't feel right in…

    Hairy Pixels, Michael Van Canneyt, Steve Litt
    8
  6. Parse JSON

    I've hardly done anything with JSON in Freepascal before, so apologies for the trivial question. I want to traverse an array in JSON and retrieve the elements (which I…

    Darius Blaszyk, Michael Van Canneyt, Thomas Kurz
    2
  7. 3123 inherited not supported inside inline

    With development fpc I get a lot of messages like: fgl.pp(1112,1) Note: (3123) "inherited" not yet supported inside inline procedure/function Since most users can't do…

    Mattias Gaertner, Hairy Pixels, Martin Frb
    12
  8. LoadLibrary, FreeLibrary & Threads (win32)

    I have spent 2 days now tracking an access violation in my app which I couldn't debug well because it occured somewhere where no debug info was available, but obviously…

    Thomas Kurz
    0
  9. EyeLink-for-Pascal

    Hi everyone! I am sharing my free pascal bindings for eyelink headers. https://github.com/cpicanco/EyeLink-for-Pascal If you find it useful, please let me know. R

    Rafael Picanço
    0
  10. Wrong assignment detected only run time without warning

    I made a stupid error. My code: TFileObj = Class(TObject) [snip] Size: Integer; [snip] end; .... procedure TForm1.FillDir(FileData : TSearchRec); ... FFIleObj.Size :=…

    Giuliano Colla, Peter B, Tomas Hajny
    4
  11. What is -CO ?

    What is -CO? In the docs I can only find this sentence: "Check for possible overflow of integer operations" Mattias

    Mattias Gaertner, Jonas Maebe, Martin
    4
  12. Re: fpc-pascal Digest, Vol 228, Issue 17

    On top of your suggestion, the only way to make FPC happy is to assign nil to the type constants and then assign the corresponding pointers to them somewhere: unit…

    Rafael Picanço
    0
  13. Passing around Pascal strings vs AnsiString

    I was curious, if you had a Pascal (short) string and it was going to be passed around often would that be slower than using an AnsiString since its size is that of a…

    Hairy Pixels, Michael Van Canneyt, Peter B
    3
  14. Free Pascal bindings for EyeLink C code (with a god-cast)

    First of all, I am sorry if this is not the best place for this interoperability issue. The problem I want to solve is how to make a Free Pascal binding for to the…

    Rafael Picanço, Marco van de Voort, Tomas Hajny
    5
  15. Non-initialized member access warning

    I'm curious, why doesn't the following code give a warning? Shouldn't the compiler know you're assigning to "r" which hasn't been initialized yet? type TMyClass = class…

    Hairy Pixels, Steve Litt, Sven Barth
    4
  16. fpc isn't optimised for tail recursion, is it?

    Tail recursion is recursion in which absolutely nothing gets executed after the return statement. Some programming languages, including Guile, optimize for tail…

    Steve Litt, Jean SUZINEAU, Marco van de Voort
    8
  17. LibXML2

    I upgraded to Debian 12 today and I've noticed some weird behaviour with libxml2. Free Pascal Compiler version 3.2.2+dfsg-20 [2023/03/30] for x86_64 program xml; uses…

    David Connolly, gabor
    2
  18. General FOSS discussion, 6/7/2023

    Sorry for the late notice. GoLUG's mailing list is down so I couldn't get input on a topic earlier. Tonight at 7:00 Eastern Daylight time, 6/7/2023, GoLUG is having an…

    Steve Litt
    0
  19. Function to create a record ?

    I'm trying to create a function (called newperson()) that creates a new instance of a record. The following compiles with no errors or warnings in FPC, but multiple…

    Steve Litt, Henry Vermaak, Jean SUZINEAU
    9
  20. Error: Argument cannot be assigned to

    Why the following code fails to compile? type TMyRec = record ss: String; ii: Integer; end; TMyClass = class private fName: String; fRecInstance: TMyRec; property…

    Juha Manninen, Martin, Martin Frb
    10
  21. Choice of exceptions to use?

    I'm working on code where the function take a (x, y) set of coordinates. If the coordinates are out of range/bounds, I want to raise an exception with a message…

    Graeme Geldenhuys, Bart
    1
  22. Make a distinct pointer type

    What's the best way to make a pointer type which is distinct so that the following snippet would give an error. I thought "type pointer" would do it but it doesn't seem…

    Hairy Pixels, Michael Van Canneyt, Sven Barth
    5