fpc-pascal · 2023-06
- Legitimate use of for and break27
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…
- Pchar from constant string8
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…
- Microsoft SAPI on Freepascal32
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…
- SDL2 Event Registration (and case statements)3
The SDL2 documentation recommends you to register constants with: Uint32 SDL_RegisterEvents(int numevents); numevents = the number of events to be allocated. Returns the…
- Subscript pointers8
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…
- Parse JSON2
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…
- 3123 inherited not supported inside inline12
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…
- LoadLibrary, FreeLibrary & Threads (win32)0
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…
- EyeLink-for-Pascal0
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
- Wrong assignment detected only run time without warning4
I made a stupid error. My code: TFileObj = Class(TObject) [snip] Size: Integer; [snip] end; .... procedure TForm1.FillDir(FileData : TSearchRec); ... FFIleObj.Size :=…
- What is -CO ?4
What is -CO? In the docs I can only find this sentence: "Check for possible overflow of integer operations" Mattias
- Re: fpc-pascal Digest, Vol 228, Issue 170
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…
- Passing around Pascal strings vs AnsiString3
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…
- Free Pascal bindings for EyeLink C code (with a god-cast)5
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…
- Non-initialized member access warning4
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…
- fpc isn't optimised for tail recursion, is it?8
Tail recursion is recursion in which absolutely nothing gets executed after the return statement. Some programming languages, including Guile, optimize for tail…
- LibXML22
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…
- General FOSS discussion, 6/7/20230
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…
- Function to create a record ?9
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…
- Error: Argument cannot be assigned to10
Why the following code fails to compile? type TMyRec = record ss: String; ii: Integer; end; TMyClass = class private fName: String; fRecInstance: TMyRec; property…
- Choice of exceptions to use?1
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…
- Make a distinct pointer type5
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…
