Recent Posts

Pages: [1] 2 3 ... 10
Beginners / Re: Initialize Form Variable?
« Last post by cdbc on Today at 11:17:43 am »
I haven't got the foggiest...
But... In fpc and lazarus, if you create a class, all the memberfields are initialized to 0/nil/'' etc. in "InitInstance". If you desire a variable/memberfield to have another value on startup, you can do so in the class' constructor, usually called "Create". In TForm regi, you'd fill in an event-handler, namely "TForm1.FormCreate" like this:
Code: Pascal  [Select][+][-]
  1. TForm1 = class(TForm)
  2.   ...
  3. private
  4.   fMemoChanges: integer; // NO '= 0;'
  5.   ...
  6. end;
  8. implementation
  10. TForm1.FormCreate(Sender: TObject);
  11. begin
  12.   // here fMemoChanges has been initialized to 0 beforehand...
  13.   fMemoChanges:= 4711;
  14. end;
Regards Benny
Packages and Libraries / VisualPlainIT and Postgress old problem returned
« Last post by kkuba on Today at 11:13:53 am »
I'm afraid the old bug in VisualPlainIt version 1.82 has returned again.  When autocreate is set, an error message appears This involves Postgress. The message comes from ZEOS, about the unsupported word AUTOINCREMENT. This is the same error that was there last year, probably in code added somewhere along the way. For Postgres, you need to set the SERIAL type, not AUTOINCREMENT. @WP, could you look at where this happened? I am attaching the error message.
The Miscelaneous forum is still on topic about Pascal/Lazarus, just not fitting in the other categrories.

So this thread is locked and will be removed in time.
FPC development / Re: Poor optimization of constant folding
« Last post by marcov on Today at 10:50:37 am »
A plugin systems means a stable API. We don't want to support something like that. We want to build an open source compiler that compiles (Object) Pascal code and not maintain some API for plugins that would have to change every other day, because we extended/changed/fixed something in the compiler.
I realize that what follows is a discussion on "hot air" since a plug-in facility is unlikely to be in FPC's future but, creating a stable  plug-in API isn't that difficult.  MS figured out long ago that one way to extend functionality without changing the API is to have structures/records that declare their size and the recipient function returns data corresponding to the record size.  IOW, the API does not need to change to provide additional functionality.

From 10km in the air everything seems small. Conceptualizing on the back of a beer coaster is not the hurdle. The nitty-gritty of implementing it in an useful way and then maintaining that.

But it is all academic because besides compiler developer resistance, for non GPL client plugins there also would be a licensing hurdle. So even if magically a plugin system got donated and accepted, it still would have to be GPL compatible as re-licensing is difficult.

But the main problem is that it requires the project developers to bend over backwards to support people that want to avoid to contribute for various reasons. (Laziness, not being the cooperative sort or commercial considerations)
Hello, forum members! I'm specifically interested in Custom 3D Heat Transfer Labels for clothing. Has anyone had experience using these labels, and can you share any insights into the design and application process? I'm looking for tips and recommendations to make my clothing line stand out.
There is const missing.
Beginners / Initialize Form Variable?
« Last post by TfUG2Zt6tFyqUG on Today at 10:17:56 am »
Hello all, I'm sure this is a simple question but I can't seem to find an answer.  I can find documentation on initializing variables in general, but the syntax doesn't seem to work for my code.

I'm going through the "simple editor" tutorial and wanted to adjust the label for changes to show 0 instead of 1.

Below is what I'd _like_ to do, but it doesn't compile with the initialization to 0.

Code: Pascal  [Select][+][-]
  1. private
  2.     fMemoChanges: Integer = 0;

How do I accomplish this?
LCL / Re: Custom PopUp Menu with Colors, Graphics etc.
« Last post by madref on Today at 09:38:50 am »
But if you change a few lines it's not the same source anymore :)
Linux / Re: failed to create named pipe
« Last post by MarkMLl on Today at 08:49:40 am »
Check your error return value.

Hi, is it possible to use an anonymous function with TFPGList.Sort? (And specifically in {$mode delphi}, too)

This does not compile:

Code: Pascal  [Select][+][-]
  1.    procedure FindClose;
  2.    var
  3.       CompareGroup: function(const Item1, Item2: PGroup): Integer;
  4.    begin
  5.       CompareGroup := function(a, b: PGroup): Integer;
  6.       begin
  7.          Result :=  0;
  8.       end;
  9.       ...
Pages: [1] 2 3 ... 10

TinyPortal © 2005-2018