Re: [fpc-pascal] named parameter

2017-05-27 Thread Sven Barth via fpc-pascal
2017-05-27 9:54 GMT+02:00 Michael Van Canneyt : > > > On Sat, 27 May 2017, Mr Bee via fpc-pascal wrote: > >> Hi, >> >> As Pascal mostly well known as a safe, easy to read, and elegant language, >> don't you think Pascal needs named parameter? I mean for ALL kind of >> parameters, not just for Varia

Re: [fpc-pascal] named parameter

2017-05-27 Thread Sven Barth via fpc-pascal
2017-05-27 16:12 GMT+02:00 Michael Van Canneyt : > > > On Sat, 27 May 2017, Sven Barth via fpc-pascal wrote: > >> 2017-05-27 9:54 GMT+02:00 Michael Van Canneyt : >>> >>> >>> >>> On Sat, 27 May 2017, Mr Bee via fpc-pascal wrote: >>> &g

Re: [fpc-pascal] Why casting interface as Tobject will result in a different reference?

2017-05-27 Thread Sven Barth via fpc-pascal
2017-05-27 18:10 GMT+02:00 Dennis Poon : > > > Sven Barth via fpc-pascal wrote: >> >> The idea itself is valid, cause "(IMyInterfaceVar as TObject) as >> IMyInterface = IMyInterfaceVar" is true if and only if IMyInterface is >> a COM interface. If IMyInte

Re: [fpc-pascal] named parameter

2017-05-28 Thread Sven Barth via fpc-pascal
Am 29.05.2017 07:13 schrieb "Ryan Joseph" : > > > > On May 28, 2017, at 5:22 PM, Mark Morgan Lloyd < markmll.fpc-pas...@telemetry.co.uk> wrote: > > > >> IMO though it does improve readability in long functions with lots of > >> parameters, like windows api style procedures that have 5 or more > >>

Re: [fpc-pascal] named parameter

2017-05-29 Thread Sven Barth via fpc-pascal
Am 29.05.2017 10:26 schrieb "Ryan Joseph" : > > > > On May 29, 2017, at 1:01 PM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > > > If anything like this would be implemented, then the already existing syntax (for variant

Re: [fpc-pascal] GDBServer

2017-06-01 Thread Sven Barth via fpc-pascal
Am 01.06.2017 16:49 schrieb "Dimitrios Chr. Ioannidis via fpc-pascal" < fpc-pascal@lists.freepascal.org>: > > Hi, > > I'm trying to "convince" gdbserver ( not gdb ) to attach to a windows service, but I'm always get the "Attach to process failed (error 5): Access is denied. " . > > Did anyone s

Re: [fpc-pascal] SIGSEGV in fpc_check_object

2017-06-14 Thread Sven Barth via fpc-pascal
Am 14.06.2017 11:13 schrieb "Gabor Boros" : > > 2017. 06. 14. 10:28 keltezéssel, José Mejuto írta: >> >> That's wrong for sure, x is not initialized to nil, not in Linux nor in Windows. > > > With the below code caption of the form not changed on Linux for me. > > > procedure TForm1.FormCreate(Send

Re: [fpc-pascal] Running Freepascal programs on other computers

2017-06-29 Thread Sven Barth via fpc-pascal
Am 28.06.2017 20:32 schrieb "James Richters" : > > >Are you by chance running it from a shared smb folder or something like that? > > Yes I am running them on a network share… If I copy the file to my laptop hard drive then I don’t get the warning anymore. However I still get the secutiy warning i

Re: [fpc-pascal] Running Freepascal programs on other computers

2017-06-29 Thread Sven Barth via fpc-pascal
Am 29.06.2017 23:27 schrieb "Bo Berglund" : > > On Thu, 29 Jun 2017 11:08:40 +0200, Sven Barth via fpc-pascal > wrote: > > >- open "Internet Options" > > The wording on these option pages seem to indicate that they are for > websites. That is all the

Re: [fpc-pascal] Food for thought - language string improvement

2017-07-06 Thread Sven Barth via fpc-pascal
On 06.07.2017 16:13, Graeme Geldenhuys wrote: > Imagine if FPC had type inference and multi-line strings, neither very > exotic features. The code then becomes: > > = > var query := '''SELECT Customers.CustomerName, Orders.OrderID > FROM Customers > FULL OUT

Re: [fpc-pascal] If vs case or something else?

2017-07-06 Thread Sven Barth via fpc-pascal
On 06.07.2017 18:33, James Richters wrote: > I can use case statement with strings apparently now, but the thing is, I > create this file myself in an earlier stage, so I do not need to create the > file with strings at all, I could use some codes and do something like this: "case of String" is

Re: [fpc-pascal] Food for thought - language string improvement

2017-07-06 Thread Sven Barth via fpc-pascal
Am 06.07.2017 23:34 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > On 2017-07-06 20:07, Dmitry Boyarintsev wrote: >> >> The thread of discussion: >> http://lists.freepascal.org/pipermail/fpc-devel/2016-February/036709.html > > > > Thanks for the link. Seems this topic has already

Re: [fpc-pascal] Food for thought - language string improvement

2017-07-10 Thread Sven Barth via fpc-pascal
Am 10.07.2017 13:19 schrieb "Michael Van Canneyt" : > > > > On Mon, 10 Jul 2017, Felipe Monteiro de Carvalho wrote: > >> On Mon, Jul 10, 2017 at 1:08 PM, Michael Van Canneyt >> wrote: >>> >>> The code is definitely not the same. In each case, it was measured. There is >>> a 10% performance loss. >

Re: [fpc-pascal] Food for thought - language string improvement

2017-07-10 Thread Sven Barth via fpc-pascal
Am 10.07.2017 15:46 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > On 2017-07-10 13:34, Dmitry Boyarintsev wrote: >> >> are you referring to "Catching More Than One Type of Exception with One >> Exception Handler" in >> https://docs.oracle.com/javase/tutorial/essential/exceptions

Re: [fpc-pascal] Delete and Add for TBytes?

2017-07-12 Thread Sven Barth via fpc-pascal
Am 12.07.2017 16:08 schrieb "Bo Berglund" : > To remove Count processed bytes from the beginning: > > Buffer: AnsiString; > > Delete(Buffer, 1, Count) > or worse: > Buffer := Copy(Buffer, Count+1, Length(Buffer)); FPC trunk supports Delete() and Insert() on dynamic arrays (TBytes is merely a dynam

Re: [fpc-pascal] Subclassing generic records?

2017-07-17 Thread Sven Barth via fpc-pascal
Am 17.07.2017 18:24 schrieb "Ryan Joseph" : > > I’m trying to find a way to extend generic records since (as far as I know) there is no subclassing of records. I could use variant records here but these don’t work with generics so I tried record helpers and properties to basically rename the x/y va

Re: [fpc-pascal] Semaphores removed from the rtl?

2017-07-19 Thread Sven Barth via fpc-pascal
Am 19.07.2017 18:45 schrieb "Anthony Walter" : > > Nah thanks, I can implement them with native functions on windows, mac, and linux easily enough and with $ifdefs. I am just surprised by the thought process involved in removing them. As Charlie said, that functionality was never intended for publ

Re: [fpc-pascal] Static local variables available?

2017-07-20 Thread Sven Barth via fpc-pascal
On 20.07.2017 11:11, Maciej Izak wrote: > 2017-07-20 11:03 GMT+02:00 Bo Berglund >: > > So since I don't really want to use a global, is it possible to > declare a local variable static in the sense that it retains its > values across calls to the procedu

Re: [fpc-pascal] Subclassing generic records?

2017-07-20 Thread Sven Barth via fpc-pascal
On 17.07.2017 19:20, Ryan Joseph wrote: > >> On Jul 17, 2017, at 10:58 AM, Sven Barth via fpc-pascal >> wrote: >> >> I'll need to check whether Delphi allows that for helpers (doesn't matter >> whether the extended type is a specialization or no

Re: [fpc-pascal] Static local variables available?

2017-07-20 Thread Sven Barth via fpc-pascal
Am 20.07.2017 13:01 schrieb "Bo Berglund" : > > On Thu, 20 Jul 2017 11:11:50 +0200, Maciej Izak > wrote: > > >2017-07-20 11:03 GMT+02:00 Bo Berglund : > > > >> So since I don't really want to use a global, is it possible to > >> declare a local variable static in the sense that it retains its > >>

Re: [fpc-pascal] Static local variables available?

2017-07-21 Thread Sven Barth via fpc-pascal
Am 21.07.2017 10:44 schrieb "Santiago A." : > > El 20/07/2017 a las 15:50, Sven Barth via fpc-pascal escribió: >> >> Am 20.07.2017 13:01 schrieb "Bo Berglund" : >> > >> > On Thu, 20 Jul 2017 11:11:50 +0200, Maciej Izak >&g

Re: [fpc-pascal] Sistema grande em CGI

2017-07-21 Thread Sven Barth via fpc-pascal
Am 21.07.2017 13:33 schrieb "Rogério Martins" : > > Bom dia pessoal ! > > Alguém aí já desenvolveu algum sistema grande em cgi ? (muitos acessos simultâneos, etc) > > Queria saber se ele dá conta, ou até onde se pode ir. > Eu só fiz aplicações pequenas. > > Obrigado This is an English list, so ple

Re: [fpc-pascal] Subclassing generic records?

2017-07-21 Thread Sven Barth via fpc-pascal
Am 21.07.2017 23:36 schrieb "Ryan Joseph" : > > Thanks Sven, that’s one way around it. > > So is it by design that records don’t have inheritance or is this planned? Yes, that's by design and there are no plans to change this. > and is it also by design that classes don’t allow operator overloads

Re: [fpc-pascal] Best way to insert bytes into a TBytes variable?

2017-07-26 Thread Sven Barth via fpc-pascal
Am 26.07.2017 10:59 schrieb "Martok" : > > > Ideally the function should be portable between FPC and Delphi XE5... > You'd only need your own functions for Delphi, FPC's intrinsics such as Insert() > can already work with arrays: > > var > b, c: TBytes; > begin > b:= TBytes.Create(1,2,3); > c

Re: [fpc-pascal] Best way to insert bytes into a TBytes variable?

2017-07-27 Thread Sven Barth via fpc-pascal
Am 27.07.2017 17:18 schrieb : > > On 2017-07-25 11:00, Martok wrote: >>> >>> Ideally the function should be portable between FPC and Delphi XE5... >> >> You'd only need your own functions for Delphi, FPC's intrinsics such as Insert() >> can already work with arrays: >> >> var >> b, c: TBytes; >>

Re: [fpc-pascal] XML: Differences between Delphi and FPC

2017-07-30 Thread Sven Barth via fpc-pascal
Am 30.07.2017 02:01 schrieb "Marcos Douglas B. Santos" : > > Hi, > > FPC/Lazarus always tried stay compatible with Delphi... thus, why the > FPC XML classes is so different than Delphi classes? > > Delphi XML is interface-based. There exists IXMLDocument, IXMLNode and so on. > FPC has just classes.

Re: [fpc-pascal] XML: Differences between Delphi and FPC

2017-07-30 Thread Sven Barth via fpc-pascal
Am 30.07.2017 09:30 schrieb "Sven Barth" : > > Am 30.07.2017 02:01 schrieb "Marcos Douglas B. Santos" : > > > > Hi, > > > > FPC/Lazarus always tried stay compatible with Delphi... thus, why the > > FPC XML classes is so different than Delphi classes? Addendum: FPC's XML library probably also comes

Re: [fpc-pascal] Best way to insert bytes into a TBytes variable?

2017-07-30 Thread Sven Barth via fpc-pascal
Am 30.07.2017 08:07 schrieb "Bo Berglund" : > > On Fri, 28 Jul 2017 16:35:05 +0200, Michael Schnell > wrote: > > >On 25.07.2017 10:54, Bo Berglund wrote: > >> so I need to write efficient replacements for certain string functions (Delete, Insert, Copy etc). > >Why do you think the string functio

Re: [fpc-pascal] BlockWrite of dynamic arrays

2017-07-30 Thread Sven Barth via fpc-pascal
Am 30.07.2017 08:21 schrieb "Bo Berglund" : > 3) Change the BlockWrite command from > BlockWrite(F, Buffer[1], Length(Buffer)); > to > BlockWrite(F, Buffer, Length(Buffer)); > > Note that I would like to *not* specify the index of the first element > of the array so that the same code can work for

Re: [fpc-pascal] Best way to insert bytes into a TBytes variable?

2017-07-30 Thread Sven Barth via fpc-pascal
Am 30.07.2017 12:37 schrieb "Bo Berglund" : > > On Sun, 30 Jul 2017 09:33:59 +0200, Sven Barth via fpc-pascal > wrote: > > >> The application was started back in Delphi7 times when "string" > >> actually meant AnsiString and was a 1-byte

Re: [fpc-pascal] Const attributes

2017-07-30 Thread Sven Barth via fpc-pascal
On 30.07.2017 20:55, Marcos Douglas B. Santos wrote: > On Sun, Jul 30, 2017 at 1:46 PM, Maciej Izak wrote: >> 2017-07-30 18:37 GMT+02:00 Marcos Douglas B. Santos : >>> >>> 1. Is this by design? >> >> >> Yes. To disallow this you need to use {$J-} directive. > > I know that we can use this "hack"

Re: [fpc-pascal] inline callback functions?

2017-08-08 Thread Sven Barth via fpc-pascal
Am 09.08.2017 06:21 schrieb "Ryan Joseph" : > > > > On Aug 7, 2017, at 1:47 PM, Mattias Gaertner wrote: > > > > What you mean are "anonymous functions" or "closures". > > > > State in FPC: > > http://lists.freepascal.org/pipermail/fpc-devel/2016-August/037328.html > > Yes, closures. Seems like dev

Re: [fpc-pascal] Defining sonames?

2017-08-13 Thread Sven Barth via fpc-pascal
Am 13.08.2017 17:42 schrieb "Fred van Stappen" : > > Hello Martin. > > Description of libx11-dev package (in /DEBIAN/control). > > Package: libx11-dev > ... > Description: > > This package contains the development headers for the library found in libx11-6. > Non-developers likely have little use fo

Re: [fpc-pascal] TInifile does not handle " " (space) as a value.

2017-08-15 Thread Sven Barth via fpc-pascal
Am 15.08.2017 11:17 schrieb "Michael Van Canneyt" : > > > > On Mon, 14 Aug 2017, Graeme Geldenhuys wrote: > >> On 2017-08-04 08:47, Michael Van Canneyt wrote: Is this considered a bug or "by design"? >>> >>> This is by design. >>> As you said, whitespace is not so well defined. >> >> >> >

Re: [fpc-pascal] TInifile does not handle " " (space) as a value.

2017-08-15 Thread Sven Barth via fpc-pascal
Am 15.08.2017 11:57 schrieb "Michael Van Canneyt" : > > > > On Tue, 15 Aug 2017, Sven Barth via fpc-pascal wrote: > >> Am 15.08.2017 11:17 schrieb "Michael Van Canneyt" : >>> >>> >>> >>> >>> On Mon, 14 Aug

Re: [fpc-pascal] Defining sonames?

2017-08-16 Thread Sven Barth via fpc-pascal
On 14.08.2017 15:19, Fred van Stappen wrote: > A concrete example. > > A Linux/FreeBSD fpc release was compiled using the pascal headers for > libX11.so.6 and using symlink libX11.so >> libX11.so.6.0.8. > > This release was installed on a system (with libX11-dev too to make it > work). > > If, s

Re: [fpc-pascal] Defining sonames?

2017-08-17 Thread Sven Barth via fpc-pascal
Am 17.08.2017 15:49 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > On 2017-08-16 18:14, Sven Barth via fpc-pascal wrote: >> >> As you can see the program will work correctly as long as the >> libX11.so.6 file exists (even though that is

Re: [fpc-pascal] Defining sonames?

2017-08-17 Thread Sven Barth via fpc-pascal
Am 17.08.2017 22:20 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > On 2017-08-17 16:52, Martin Schreiber wrote: >> >> Exactly. So why not use the SONAME in the Pascal binding unit instead to use >> the base name as Free Pascal currently does in xlib.pp for example? > > > I forked

Re: [fpc-pascal] Defining sonames?

2017-08-17 Thread Sven Barth via fpc-pascal
Am 18.08.2017 01:17 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > On 2017-08-17 21:47, Henry Vermaak wrote: >> >> You can use -l:libgreat.so.1 with gcc to link to a specific library version >> (iirc). > > > I'll have to take your word for it Henry, as I don't know GCC much - onl

Re: [fpc-pascal] TStringHelper missing

2017-08-21 Thread Sven Barth via fpc-pascal
Am 21.08.2017 08:23 schrieb "Michael Van Canneyt" : > > > > On Mon, 21 Aug 2017, Ryan Joseph wrote: > >> I’m trying to split a string by a delimiter and see there is a type helper called TStringHelper ( https://www.freepascal.org/docs-html/rtl/sysutils/tstringhelper.html). The compiler version I’m

Re: [fpc-pascal] TStringHelper missing

2017-08-21 Thread Sven Barth via fpc-pascal
Am 21.08.2017 13:51 schrieb "Sven Barth" : > > Am 21.08.2017 08:23 schrieb "Michael Van Canneyt" : > > > > > > > > On Mon, 21 Aug 2017, Ryan Joseph wrote: > > > >> I’m trying to split a string by a delimiter and see there is a type helper called TStringHelper ( https://www.freepascal.org/docs-html/

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-21 Thread Sven Barth via fpc-pascal
Am 22.08.2017 00:02 schrieb "James Richters" : The others already wrote about floating point precision, so I won't repeat that. > The reason I noticed this is because I have some conditional statements like > If Draw_GX_Min<>99.999 then > Something *DON'T* compare floating point numbers

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-22 Thread Sven Barth via fpc-pascal
Am 22.08.2017 18:11 schrieb "Peter" : > > Hi James, > > Its unlikely that 999.999 has an EXACT representation in floating point. > > 999.999002 maybe the closest value at your chosen precision. > > Extended type has more precision, but still probably won't be exact. Additionally Extended

Re: [fpc-pascal] Check In Interface Type Helpers

2017-08-22 Thread Sven Barth via fpc-pascal
Am 23.08.2017 02:04 schrieb "Anthony Walter" : > > I just wanted to point out that revision 37023 Sven added type helper support for interfaces. > > Good job and thank you Sven! You're welcome. I wanted to add them for some time already :) Regards, Sven ___

Re: [fpc-pascal] Check In Interface Type Helpers

2017-08-23 Thread Sven Barth via fpc-pascal
Am 23.08.2017 09:42 schrieb "Michael Van Canneyt" : > > > > On Tue, 22 Aug 2017, Anthony Walter wrote: > >> I just wanted to point out that revision 37023 Sven added type helper >> support for interfaces. >> >> Good job and thank you Sven! >> > > I'm having trouble understanding why this could be u

Re: [fpc-pascal] Check In Interface Type Helpers

2017-08-23 Thread Sven Barth via fpc-pascal
Am 23.08.2017 16:58 schrieb "Marcos Douglas B. Santos" : > > On Wed, Aug 23, 2017 at 11:00 AM, Anthony Walter wrote: > > Marcos, it doesn't work that way. > > > > Type helpers simply allow you to extend an existing type with new methods > > and/or properties. When you declare a type helper you ext

Re: [fpc-pascal] Check In Interface Type Helpers

2017-08-23 Thread Sven Barth via fpc-pascal
Am 23.08.2017 16:59 schrieb "Marcos Douglas B. Santos" : > > On Wed, Aug 23, 2017 at 11:07 AM, Anthony Walter wrote: > > Here is another example: > > > > type > > TDay = (Monday = 0, Tuesday, Wednesday, Thursday, Friday, Saturday, > > Sunday); > > > > TDayHelper = record helper for TDay > >

Re: [fpc-pascal] Check In Interface Type Helpers

2017-08-23 Thread Sven Barth via fpc-pascal
Am 23.08.2017 16:01 schrieb "Anthony Walter" : > > Marco, it doesn't work that way. > > Type helpers simply allow you to extend an existing type with new methods and/or properties. When you declare a type helper you extend all instances of said type given that: > > A) You 'use' the unit declaring t

Re: [fpc-pascal] Check In Interface Type Helpers

2017-08-23 Thread Sven Barth via fpc-pascal
Am 23.08.2017 19:39 schrieb "Marcos Douglas B. Santos" : > > On Wed, Aug 23, 2017 at 11:00 AM, Anthony Walter wrote: > > Marco, it doesn't work that way. > > > > Type helpers simply allow you to extend an existing type with new methods > > and/or properties. When you declare a type helper you exte

Re: [fpc-pascal] Check In Interface Type Helpers

2017-08-23 Thread Sven Barth via fpc-pascal
Am 23.08.2017 19:40 schrieb "Anthony Walter" : > > Sven, multiple helpers would be greatly appreciated, especially considering everyone wants to add their own helpers for types like string. At least in FPC modes they can use inheritance to solve this (see below) or by putting their units after the

Re: [fpc-pascal] Check In Interface Type Helpers

2017-08-23 Thread Sven Barth via fpc-pascal
Am 23.08.2017 16:01 schrieb "Anthony Walter" : > > As to what they are useful for, consider the following: > > type > // IShellLink is define by Microsoft > IShellLinkHelper = record helper for IShellLink > public > procedure Save(const Target, Description, Link: string); > end; > > pro

Re: [fpc-pascal] Check In Interface Type Helpers

2017-08-23 Thread Sven Barth via fpc-pascal
On 23.08.2017 19:57, Marcos Douglas B. Santos wrote: > On Wed, Aug 23, 2017 at 2:45 PM, Sven Barth via fpc-pascal > wrote: >> Am 23.08.2017 19:39 schrieb "Marcos Douglas B. Santos" : >>> >>> Wait a minute. Now I realize that procedure IShellLinkHelper.Sa

Re: [fpc-pascal] Check In Interface Type Helpers

2017-08-23 Thread Sven Barth via fpc-pascal
On 23.08.2017 20:38, Marcos Douglas B. Santos wrote: > On Wed, Aug 23, 2017 at 3:25 PM, Sven Barth via fpc-pascal > wrote: >> On 23.08.2017 19:57, Marcos Douglas B. Santos wrote: >>> Would we have any problem of memory leaks using Interface helper with >>> COM int

Re: [fpc-pascal] Inline ASM code

2017-08-24 Thread Sven Barth via fpc-pascal
Am 24.08.2017 08:32 schrieb "LacaK" : > > Hi *, > > I need store result of floating point calculation (in my example arctan()) in memory pointed by some variable. See this code: > var a: single; pa: PSingle; > asm > fild dy > fild dx > fpatan > fstp a > fwait > end

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-24 Thread Sven Barth via fpc-pascal
Am 23.08.2017 02:16 schrieb "Paul Nance" : > > Turbo Pascal also had a BCD unit. Free Pascal also has a BCD unit: FmtBCD. It provides a BCD type and operators as well operator overloads. Regards, Sven ___ fpc-pascal maillist - fpc-pascal@lists.freepas

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-24 Thread Sven Barth via fpc-pascal
Am 24.08.2017 14:00 schrieb "James Richters" : > > Thanks everyone for the explanation and solutions. I can work around it well enough now that I understand what’s happening, but I’m still curious if there is a way to define fixed point variables? In a C++ Project I was helping with recently, the

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-24 Thread Sven Barth via fpc-pascal
Am 24.08.2017 23:46 schrieb "Ched" < charles.edouard.des.vastes.vig...@gmail.com>: > > And under "modern" Windows, the extended type, which is fully supported by the FPU, is *degraded* to double. So, I can't do high precision computation with fpc even if the native hardware permits such computation

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-24 Thread Sven Barth via fpc-pascal
Am 25.08.2017 01:33 schrieb "Ralf Quint" : > > On 8/24/2017 2:45 PM, Ched wrote: > > And under "modern" Windows, the extended type, which is fully > > supported by the FPU, is *degraded* to double. So, I can't do high > > precision computation with fpc even if the native hardware permits > > such c

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-25 Thread Sven Barth via fpc-pascal
Am 24.08.2017 23:26 schrieb "Tomas Hajny" : > > On Thu, August 24, 2017 22:25, Ralf Quint wrote: > > On 8/24/2017 2:18 AM, Sven Barth via fpc-pascal wrote: > >> > >> Am 23.08.2017 02:16 schrieb "Paul Nance" >> <mailto:pwna...@

Re: [fpc-pascal] H2pas tool vs others, C header translation

2017-08-26 Thread Sven Barth via fpc-pascal
Am 26.08.2017 07:25 schrieb : > > What about the BOOL issue.. > > We know that Boolean in fpc/delphi is not compatible with a C bool > > But it gets worse than that: even fpc/delphi's bool is not always compatible (but is sometimes). > > For example: > http://blog.delphi-jedi.net/2008/09/25/bool-bo

Re: [fpc-pascal] H2pas tool vs others, C header translation

2017-08-26 Thread Sven Barth via fpc-pascal
Am 26.08.2017 09:50 schrieb "Michael Van Canneyt" : > > > > On Sat, 26 Aug 2017, Sven Barth via fpc-pascal wrote: > >> Am 26.08.2017 07:25 schrieb : >>> >>> >>> What about the BOOL issue.. >>> >>> We know that Boolean

Re: [fpc-pascal] H2pas tool vs others, C header translation

2017-08-26 Thread Sven Barth via fpc-pascal
On 26.08.2017 12:57, Michael Van Canneyt wrote: > > > On Sat, 26 Aug 2017, Sven Barth wrote: > >>> >>> Sorry for being naive. Why not simply use a boolean ? >>> >>> I thought all this BOOL mess was just meant to be able to interface >>> with C >>> libs slightly easier. >>> >>> Instead of >>> >>>

Re: [fpc-pascal] H2pas tool vs others, C header translation

2017-08-26 Thread Sven Barth via fpc-pascal
On 26.08.2017 13:43, Michael Van Canneyt wrote: > > > On Sat, 26 Aug 2017, Sven Barth via fpc-pascal wrote: > >>> >>> I did read it. >>> >>> I think the programmer *must* worry about the details and must >>> definitely >>&

Re: [fpc-pascal] H2pas tool vs others, C header translation

2017-08-27 Thread Sven Barth via fpc-pascal
Am 27.08.2017 00:10 schrieb "Marco van de Voort" : > The GTK headers also use a 0/1 boolean, and for that the boolean8/16/32 > types were created. I couldn't quickly find docs, so I filed a bug for that. Please note that there is no Boolean8 as that one is simply Boolean. But there is also a Boole

Re: [fpc-pascal] H2pas tool vs others, C header translation

2017-08-27 Thread Sven Barth via fpc-pascal
On 27.08.2017 19:27, Marco van de Voort wrote: > In our previous episode, Sven Barth via fpc-pascal said: >> Am 27.08.2017 00:10 schrieb "Marco van de Voort" : >>> The GTK headers also use a 0/1 boolean, and for that the boolean8/16/32 >>> types were create

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-27 Thread Sven Barth via fpc-pascal
Am 28.08.2017 00:32 schrieb "Ched" < charles.edouard.des.vastes.vig...@gmail.com>: > > Hello, > > I agree that the extended type is not portable and not as fast as double. > > But sometimes, we absolutely need numerical precision, so we have to assume the costs in terms of runtime and possibly nonp

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-29 Thread Sven Barth via fpc-pascal
Am 29.08.2017 08:35 schrieb "Michael Schnell" : > > On 28.08.2017 08:04, Sven Barth via fpc-pascal wrote:I don't understand why we will have no more the right to use it under x64 OS... >> >> >> Because Microsoft declared it as deprecated. That means that s

Re: [fpc-pascal] TP compatibility: procedural type

2017-08-29 Thread Sven Barth via fpc-pascal
Am 29.08.2017 11:10 schrieb "Anton Shepelev" : > > Hello, all. > > According to Borland's official language guide to > Turbo Pascal 7.0, > > To be used as procedural values, procedures and > functions must be declared with a 'far' directive > or compiled in the '{$F+}' state. > > where

Re: [fpc-pascal] TP compatibility: procedural type

2017-08-29 Thread Sven Barth via fpc-pascal
Am 29.08.2017 14:26 schrieb "Anton Shepelev" : > > Karoly Balogh to Anton Shepelev: > > >>According to Borland's official language guide to > >>Turbo Pascal 7.0, > >> > >> To be used as procedural values, procedures and > >> functions must be declared with a 'far' directive > >> or compiled in

Re: [fpc-pascal] TP compatibility: procedural type

2017-08-29 Thread Sven Barth via fpc-pascal
Am 29.08.2017 18:48 schrieb "Anton Shepelev" : > I now see from other replies that the -Mtp mode > helps compile TP programs in FPC but not vice versa, > which makes me wonder why pointer arithmetics is so > limited in -Mtp that one must use Inc and Dec in- > stead of the direct '+' and '-

Re: [fpc-pascal] implements

2017-09-02 Thread Sven Barth via fpc-pascal
Am 02.09.2017 06:34 schrieb "Ryan Joseph" : > > I think I asked this some years ago but I came across it again I just don’t get what the point of this is. There is an “implements” property but it seems like yet another half-baked feature from Delphi that wasn’t implemented completely or is broken.

Re: [fpc-pascal] implements

2017-09-02 Thread Sven Barth via fpc-pascal
Am 02.09.2017 10:38 schrieb "Ryan Joseph" : > > > > On Sep 2, 2017, at 3:27 PM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > > > > Please search the internet about Interfaces and probably Design Patterns too. Have ever heard the phrase: "Code to an Interface, not an Implementation".

Re: [fpc-pascal] implements

2017-09-06 Thread Sven Barth via fpc-pascal
Am 06.09.2017 10:34 schrieb "Ryan Joseph" : > > > > On Sep 6, 2017, at 2:50 PM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > > > > There is NO need to make Hook public, because you can always get access to that functionality via the Supports() call and get a reference to IHook. > > T

Re: [fpc-pascal] Where and Why is there a memory leak?

2017-09-06 Thread Sven Barth via fpc-pascal
Am 06.09.2017 10:31 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > type > IHook = interface > ['{4BCAEDD8-92D8-11E7-88D3-C86000E37EB0}'] > procedure DoIt; > end; > > type > THook = class(TInterfacedObject, IHook) > private > procedure DoIt; > end; > > proced

Re: [fpc-pascal] Where and Why is there a memory leak?

2017-09-06 Thread Sven Barth via fpc-pascal
Am 06.09.2017 17:03 schrieb "Ryan Joseph" : > > > > On Sep 6, 2017, at 8:03 PM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > > > > I couldn't call .Free because FHook was a interface reference type of type IHook, not THook. > > But TInterfacedObject is a class isn’t it? Then you call

Re: [fpc-pascal] Where and Why is there a memory leak?

2017-09-06 Thread Sven Barth via fpc-pascal
Am 07.09.2017 03:48 schrieb "Ryan Joseph" : > > > > On Sep 6, 2017, at 10:20 PM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > > > You're missing that FHook was declared as IHook, not THook. > > > > In terms of memo

Re: [fpc-pascal] Inclocked/declocked

2017-09-11 Thread Sven Barth via fpc-pascal
Am 11.09.2017 11:14 schrieb "Ryan Joseph" : > > I was time profiling some code and saw these 2 functions taking up large amounts of time. They’re coming from dynamic arrays and SetLength I believe but I was curious what they are exactly because I don’t believe I’ve seen them before. Is this normal

Re: [fpc-pascal] Inclocked/declocked

2017-09-11 Thread Sven Barth via fpc-pascal
On 11.09.2017 11:46, Ryan Joseph wrote: > >> On Sep 11, 2017, at 4:20 PM, Sven Barth via fpc-pascal >> wrote: >> >> They're used for the reference counter of the array (or string or >> interface). The reference counter changes each time you assign

Re: [fpc-pascal] Inclocked/declocked

2017-09-11 Thread Sven Barth via fpc-pascal
Am 12.09.2017 06:54 schrieb "Ryan Joseph" : > > > > On Sep 12, 2017, at 2:35 AM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > > > I've rechecked and the thing is as follows: > > - the IncLocked call happens each tim

Re: [fpc-pascal] Comparison operator for generics

2017-09-11 Thread Sven Barth via fpc-pascal
Am 12.09.2017 06:49 schrieb "Ryan Joseph" : > > This is a common pattern I’m finding when working with generics in FPC. In the example below there is an equals comparison that needs to be checked but for some types such as records there is no default operator overload so I need to add one for every

Re: [fpc-pascal] Booleans vs sets

2017-09-22 Thread Sven Barth via fpc-pascal
Am 22.09.2017 12:56 schrieb "Ryan Joseph" : > > Got it, thanks guys. > > Btw, how can I know what the size in bytes these 2 options are? You could use SizeOf(YourType) and output the values in a simple test program :) Regards, Sven ___ fpc-pascal mailli

Re: [fpc-pascal] Resource compilation

2017-09-24 Thread Sven Barth via fpc-pascal
On 24.09.2017 12:12, Graeme Geldenhuys wrote: > On 2017-09-23 21:31, Martok wrote: >> the $R directive accepts resource scripts (RC) and compiles the RES >> file from it >> on demand. > > Also note that that is only true for Windows. FPC doesn't include a > resource compiler for any other platform

Re: [fpc-pascal] Resource compilation

2017-09-24 Thread Sven Barth via fpc-pascal
On 23.09.2017 22:31, Martok wrote: > Hi all, > > the $R directive accepts resource scripts (RC) and compiles the RES file from > it > on demand. > > However, that only happens if the RES file does not exist - if it does, the > resource compiler is never invoked. Even clean-building the unit from

Re: [fpc-pascal] Resource compilation

2017-09-24 Thread Sven Barth via fpc-pascal
On 24.09.2017 17:15, Graeme Geldenhuys wrote: > On 2017-09-24 13:50, Sven Barth via fpc-pascal wrote: >> You are aware that FPC supports resources on basically all platforms? > > I know that. What I meant is that FPC only ships with a Windows resource > compiler - ability to c

Re: [fpc-pascal] Resource compilation

2017-09-24 Thread Sven Barth via fpc-pascal
Am 24.09.2017 18:14 schrieb "Giulio Bernardi" : > > I think that what Sven meant is that fpc's Windows installers include binutils, > while this is not true for other platforms: that is, you need to have ld on your > system if you want to use it as a linker, fpc does not provide it. Exactly. Rega

Re: [fpc-pascal] Syntax to select constant or variable with function call

2017-09-24 Thread Sven Barth via fpc-pascal
On 24.09.2017 21:07, James Richters wrote: > Thank you for explaining how to achieve this. > I am curious about the meaning behind the prefixes you used: >> TVGA256Array = Array[0..255] of VGARGBRec; >> PVGA256Array = ^TVGA256Array; > Do the T and P in front of VGA256Array have a special mean

Re: [fpc-pascal] Resource compilation

2017-09-24 Thread Sven Barth via fpc-pascal
On 24.09.2017 22:55, Graeme Geldenhuys wrote: > On 2017-09-24 19:02, Sven Barth via fpc-pascal wrote: >>> system if you want to use it as a linker, fpc does not provide it. >> Exactly. > > Exactly my point! Why? Why does the official FPC installer for Windows > give a

Re: [fpc-pascal] Syntax to select constant or variable with function call

2017-09-25 Thread Sven Barth via fpc-pascal
Am 25.09.2017 08:13 schrieb : > I have 2 arrays that are not [0..255], one is [1..14] the other is [0..15] is there a way I could expand this scheme to use those arrays as well? The For loop would need to adjust to the size of the arrays somehow. See what I wrote yesterday :) Regards, Sven ___

Re: [fpc-pascal] Resource compilation

2017-09-25 Thread Sven Barth via fpc-pascal
Am 25.09.2017 08:11 schrieb "Martok" : > > > Also note that that is only true for Windows. FPC doesn't include a > > resource compiler for any other platforms. So if no resource compiler > > exists, you will get a compilation error until you make other plans. > AFAIK, windres is available for lots

Re: [fpc-pascal] Managed properties idea

2017-10-04 Thread Sven Barth via fpc-pascal
Am 05.10.2017 05:04 schrieb "Ryan Joseph" : > I’ve been wanting to learn how to contribute to the compiler for years now but maybe this is an easy enough project to start with. I don’t know if this is a problem people have though but I assume it may be since Objective-C had a system like for memor

Re: [fpc-pascal] Finding long file names

2017-10-05 Thread Sven Barth via fpc-pascal
Am 05.10.2017 01:49 schrieb "James Richters" : > > I'm trying to use findfirst()/findnext to obtain a list of files. Here's my code: > Searchfile:=Tap_Drive+Tap_Path+'\'+Tap_SubDirectory+'\*.TAP'; > If FindFirst(Searchfile, FAAnyfile-FAHidden, FileDirInfo)=0 then > .. > > It finds most files, even

Re: [fpc-pascal] Managed properties idea

2017-10-06 Thread Sven Barth via fpc-pascal
Am 06.10.2017 20:52 schrieb "Marcos Douglas B. Santos" : > > And reference counting like in e.g. C++ "shared pointers", that can wrap any > > class, without any additional feature (in Pascal we may get this with > > "management operators"). > > I don't know about "management operators". Could you

Re: [fpc-pascal] getting cross with the cross compiler

2017-10-07 Thread Sven Barth via fpc-pascal
Am 07.10.2017 10:57 schrieb : > > Hi, > > I am having trouble getting fpc to cross-compiler for win64 target. > > I'm using fedora 26 which supplies 3.0.2 > > I used instructions here to create the cross compiler using trunk fpc since the fedora fpc-src does not seem to have the full Makefile struc

Re: [fpc-pascal] getting cross with the cross compiler

2017-10-07 Thread Sven Barth via fpc-pascal
Am 07.10.2017 11:11 schrieb "Karoly Balogh (Charlie/SGR)" < char...@scenergy.dfmk.hu>: > > Hi, > > On Sat, 7 Oct 2017, Sven Barth via fpc-pascal wrote: > > > > So where is my cross compiler ?? > > > > > > Thanks for any help and suggestion

Re: [fpc-pascal] Obtain file size?

2017-10-07 Thread Sven Barth via fpc-pascal
Am 07.10.2017 01:13 schrieb "James Richters" : > > I am wondering how to get the file size reported by the OS for a particular file without opening it. I tried to search for ‘Free Pascal File Size’ and variations but all I get are things like this: > > > > https://www.freepascal.org/docs-html/rtl

Re: [fpc-pascal] Managed properties idea

2017-10-07 Thread Sven Barth via fpc-pascal
Am 07.10.2017 17:15 schrieb "Marcos Douglas B. Santos" : > > On Fri, Oct 6, 2017 at 4:17 PM, Sven Barth via fpc-pascal > wrote: > > Am 06.10.2017 20:52 schrieb "Marcos Douglas B. Santos" : > >> > And reference counting like in e.g. C++ "shar

Re: [fpc-pascal] Obtain file size?

2017-10-07 Thread Sven Barth via fpc-pascal
Am 07.10.2017 21:08 schrieb "Paul Nance" : > > I've always (since Turbo Pascal and now with Free Pascal) used FILESIZE. It works like a charm. > Even if you do it in assembly its done the same as its done in pascal. FileSize() has the disadvantage that you need to open the file. But what if you do

Re: [fpc-pascal] getting cross with the cross compiler

2017-10-08 Thread Sven Barth via fpc-pascal
Am 08.10.2017 01:51 schrieb : > firstly may I take the opportunity to congratulate you on what have managed to do in creating fpc and lazarus. Despite what seems like a few outstanding quirks it is an amazing achievement. Note: Florian only developed FPC. Lazarus is done by a different though som

Re: [fpc-pascal] compiler option for $J directive

2017-10-08 Thread Sven Barth via fpc-pascal
Am 08.10.2017 06:39 schrieb "Mr Bee via fpc-pascal" < fpc-pascal@lists.freepascal.org>: > > Hi, > > Is there any FPC command line option for writable constanst directive {$J} or {$WRITEABLECONST} ? No, there is not. Regards, Sven ___ fpc-pascal maillist

Re: [fpc-pascal] compiler option for $J directive

2017-10-09 Thread Sven Barth via fpc-pascal
Am 08.10.2017 22:24 schrieb "leledumbo via fpc-pascal" < fpc-pascal@lists.freepascal.org>: > > > There is my old feature request about it > > https://bugs.freepascal.org/view.php?id=30344 :) You can monitor it. > > No one seems to care to implement it, so if you badly need it: sj.patch >

<    1   2   3   4   5   6   7   8   9   10   >