Re: [Lazarus] Making sources compatible with Delphi (but Lazarus is priority)

2017-05-01 Thread Marcos Douglas B. Santos via Lazarus
On Mon, May 1, 2017 at 11:06 AM, Juha Manninen via Lazarus wrote: > On Mon, May 1, 2017 at 12:30 PM, Tony Whyman via Lazarus > ... > > No! The good idea is to use "String". I agree. >> 5. Take care when using string literals. >> I added >> {$IFDEF FPC} >> {$codepage UTF8} >> {$ENDIF} > > Yes, st

Re: [Lazarus] Making sources compatible with Delphi (but Lazarus is priority)

2017-05-01 Thread Marcos Douglas B. Santos via Lazarus
On Mon, May 1, 2017 at 8:47 AM, Mattias Gaertner via Lazarus wrote: > Option a) You can use English in sources and load all non ASCII > constants via resourcestrings or similar. Then the codepage is > irrelevant. > Option b) You can store all files as UTF-8 with BOM. Then FPC will > store all non

Re: [Lazarus] Making sources compatible with Delphi (but Lazarus is priority)

2017-05-01 Thread Marcos Douglas B. Santos via Lazarus
On Mon, May 1, 2017 at 6:30 AM, Tony Whyman via Lazarus wrote: > Marcos, > > When I originally created the Firebird Pascal API package, I wrote it with > FPC as the only intended target. However, I then got feedback asking for > Delphi compatibility and I couldn't resist the challenge of seeing ho

Re: [Lazarus] Making sources compatible with Delphi (but Lazarus is priority)

2017-05-01 Thread Juha Manninen via Lazarus
On Mon, May 1, 2017 at 7:40 PM, Tony Whyman via Lazarus wrote: > I am not sure how much your second post rows back from this but I do think > that false is a bit harsh. Yes, sorry, it was correct when using the default types in FPC 3. However making it compatible with Delphi requires some effort,

Re: [Lazarus] Making sources compatible with Delphi (but Lazarus is priority)

2017-05-01 Thread Sven Barth via Lazarus
Am 01.05.2017 18:50 schrieb "Tony Whyman via Lazarus" < lazarus@lists.lazarus-ide.org>: > > > > On 01/05/17 16:33, Sven Barth via Lazarus wrote: >> >> Would you please elaborate on these and which FPC version you targeted? >> >> Regards, >> Sven >> >> >> > I am working with FPC 3.0.x and an example

Re: [Lazarus] Making sources compatible with Delphi (but Lazarus is priority)

2017-05-01 Thread Tony Whyman via Lazarus
On 01/05/17 16:33, Sven Barth via Lazarus wrote: Would you please elaborate on these and which FPC version you targeted? Regards, Sven I am working with FPC 3.0.x and an example of the solution I used follows. Note that with FPC, there is no problem calling a constructor from a placeholde

Re: [Lazarus] Making sources compatible with Delphi (but Lazarus is priority)

2017-05-01 Thread Tony Whyman via Lazarus
On 01/05/17 15:18, Juha Manninen via Lazarus wrote: On Mon, May 1, 2017 at 12:30 PM, Tony Whyman via Lazarus wrote: When I originally created the Firebird Pascal API package, Now I realize your code may have been for FPC but not for Lazarus. Even then the solution provided by LazUtils (2 file

Re: [Lazarus] WMPaint

2017-05-01 Thread Mattias Gaertner via Lazarus
On Sun, 30 Apr 2017 19:06:18 +0300 Alexey via Lazarus wrote: > procedure TCustomControl.WMPaint(var Message: TLMPaint); > begin >if (csDestroying in ComponentState) or (not HandleAllocated) then exit; >Include(FControlState, csCustomPaint); >inherited WMPaint(Message); >Exclude(FC

Re: [Lazarus] Gtk2 log "Refused invalidating during paint msg": how to check

2017-05-01 Thread Mattias Gaertner via Lazarus
On Sun, 30 Apr 2017 18:59:17 +0300 Alexey via Lazarus wrote: > How can I check that im inside Paint code? > > Maybe come control flag, or something, exists. if csCustomPaint in ControlState then Mattias -- ___ Lazarus mailing list Lazarus@lists.laza

Re: [Lazarus] Making sources compatible with Delphi (but Lazarus is priority)

2017-05-01 Thread Sven Barth via Lazarus
Am 01.05.2017 11:31 schrieb "Tony Whyman via Lazarus" < lazarus@lists.lazarus-ide.org>: > 7. Generics > > If you don't have to go here then don't. Unfortunately I had dug a hole for myself and made extensive use of generics. Some of the differences are minor syntax, but others... Delphi and FPC jus

Re: [Lazarus] Making sources compatible with Delphi (but Lazarus is priority)

2017-05-01 Thread Juha Manninen via Lazarus
On Mon, May 1, 2017 at 12:30 PM, Tony Whyman via Lazarus wrote: > When I originally created the Firebird Pascal API package, I wrote it with > FPC as the only intended target ... I guess you used the old Unicode support with explicit UTF-8 conversion functions. Things have improved a lot since th

Re: [Lazarus] Making sources compatible with Delphi (but Lazarus is priority)

2017-05-01 Thread Juha Manninen via Lazarus
On Mon, May 1, 2017 at 12:30 PM, Tony Whyman via Lazarus wrote: > When I originally created the Firebird Pascal API package, Now I realize your code may have been for FPC but not for Lazarus. Even then the solution provided by LazUtils (2 files there) is good because it allows compatible and port

Re: [Lazarus] Making sources compatible with Delphi (but Lazarus is priority)

2017-05-01 Thread Mattias Gaertner via Lazarus
On Sun, 30 Apr 2017 13:37:17 -0300 "Marcos Douglas B. Santos via Lazarus" wrote: > It months ago I realized that Lazarus was saving the sources like that: > > 1- If there is only ANSI chars, save it as ANSI encode; > 2. If there is more than ANSI chars, save it as UTF8 encode; Lazarus saves sou

[Lazarus] Lazarus/Free Pascal wasn't even an option in this "best languages to write a desktop Linux application" list

2017-05-01 Thread Anthony Walter via Lazarus
Over on the slant website Lazarus wasn't even an option for the following question: What are the best languages to write a desktop Linux application in? Link: https://www.slant.co/topics/635/~best-languages-to-write-a-desktop-linux-application-in I added Lazarus/Free Pascal to this list just no

[Lazarus] Gtk2 ShowWindow(..SW_RESTORE)

2017-05-01 Thread Alexey via Lazarus
Hi. Maybe someone can implement it? Gtk2 misses it- case nCmdShow of SW_SHOWNORMAL: begin if B then gtk_widget_show(PGtkWidget(GtkWindow)) else begin if not GTK_WIDGET_VISIBLE(PGtkWidget(GtkWindow)) then gtk_widget_show(PGtkWidget(GtkWindow));

Re: [Lazarus] Making sources compatible with Delphi (but Lazarus is priority)

2017-05-01 Thread Tony Whyman via Lazarus
Marcos, When I originally created the Firebird Pascal API package, I wrote it with FPC as the only intended target. However, I then got feedback asking for Delphi compatibility and I couldn't resist the challenge of seeing how easy it would be to convert the source code. In the end, it was no

Re: [Lazarus] Lazarus Bug: No exception raised when attempting to access an array outside of range.

2017-05-01 Thread Michael Van Canneyt via Lazarus
On Mon, 1 May 2017, Graham Ward via Lazarus wrote: Hi, Apologies if this email has been sent to the wrong location (I'm a brand new user to the Lazarus emailing list). Note I even tried the following line, which is obviously wrong (as the array has a maximum index of 71) ColIndex[175

Re: [Lazarus] Lazarus Bug: No exception raised when attempting to access an array outside of range.

2017-05-01 Thread Mattias Gaertner via Lazarus
On Mon, 1 May 2017 11:53:55 +1200 Graham Ward via Lazarus wrote: >[...] > I recently had a software/compilation bug whereby no exception was > raised when my code was accessing an array outside of its range. Enable runtime range checks: Project / Project Options / Compiler Option / Debugging /