Re: [fpc-pascal] Generics vs templates

2018-01-08 Thread Sven Barth via fpc-pascal
Am 08.01.2018 08:50 schrieb "Ryan Joseph" : I was talking with a c++ developer who explained how templates are implemented in c++ and how use some recursive method which causes them to totally murder compile times. This isn’t the first I’ve heard of the problem though

Re: [fpc-pascal] First pas2js public release

2018-01-07 Thread Sven Barth via fpc-pascal
On 07.01.2018 15:03, Ingemar Ragnemalm wrote: > and here is an (almost) fully working snake game: > > http://ragnemalm.se/images/santa/snake/snake.html > Perhaps you should write somewhere how the snake is controlled. I personally am used to using all four cursor keys to control the snake's

Re: [fpc-pascal] Final Methods support

2018-01-06 Thread Sven Barth via fpc-pascal
Am 06.01.2018 17:31 schrieb "Marcos Douglas B. Santos" : Does FPC have support for final methods? Please see -> http://docwiki.embarcadero.com/RADStudio/Tokyo/en/ Methods_(Delphi)#Final_Methods Should be supported since 2009, so that would be from at least 2.6.0. Regards,

Re: [fpc-pascal] String message methods and the self parameter

2018-01-06 Thread Sven Barth via fpc-pascal
Am 06.01.2018 17:25 schrieb "Ewald" : Hi, When reading https://www.freepascal.org/docs-html/ref/refsu31.html# x82-1040006.5.7 I stumbled on the following text at the bottom of the page: "In addition to this mechanism, a string message method accepts a self parameter:

Re: [fpc-pascal] Translate C code

2018-01-06 Thread Sven Barth via fpc-pascal
Am 06.01.2018 12:23 schrieb "Ryan Joseph" : > On Jan 6, 2018, at 5:25 PM, Karoly Balogh (Charlie/SGR) < char...@scenergy.dfmk.hu> wrote: > > So it doesn't crash, because it never loads from this "invalid" address it > calculates. Are we talking about the address on

Re: [fpc-pascal] Possible Memory Leak in TThread.Synchronize

2018-01-03 Thread Sven Barth via fpc-pascal
Am 03.01.2018 12:32 schrieb "Tony Whyman" : function CheckSynchronize(...) and this ends with: else begin { for Queue entries we dispose the entry and raise the exception } Dispose(tmpentry); if Assigned(exceptobj) then raise

Re: [fpc-pascal] Why win64 program are considerably bigger in exe size than win 32?

2017-12-31 Thread Sven Barth via fpc-pascal
Am 31.12.2017 00:19 schrieb "Martok" : Am 22.12.2017 um 09:30 schrieb Dennis: > I am upgrading my program from win 32 to win 64 using the new Lazarus 1.8. > I discovered my program exe size increased from 6M to 9M. Just for fun, I wrote a small program to parse Linker

Re: [fpc-pascal] Cannot find entry point of a routine inside a windows 64 dll

2017-12-17 Thread Sven Barth via fpc-pascal
On 15.12.2017 16:10, Dennis wrote: >> >> Okay, that explains things a bit more. >> >> May I ask you to provide a small example consisting of program and >> library (source only) that works in 32-bit, but fails in 64-bit? Try >> way I can check myself what is going on as I have a Delphi starter on

Re: [fpc-pascal] First pas2js public release

2017-12-17 Thread Sven Barth via fpc-pascal
Am 17.12.2017 08:01 schrieb "code dz" : good news & thanks for the effort is it similar to Emscripten ? Not really. Emscripten (and WebAsm) has the goal to convert native programs that rely on pointers. It is essentially an assembly language in JavaScript. Pas2JS is on the

Re: [fpc-pascal] Cannot find entry point of a routine inside a windows 64 dll

2017-12-13 Thread Sven Barth via fpc-pascal
Am 13.12.2017 18:13 schrieb "Dennis" <de...@avidsoft.com.hk>: Sven Barth via fpc-pascal wrote: > Am 13.12.2017 11:39 schrieb "Dennis Poon" <den...@avidsoft.com.hk den...@avidsoft.com.hk>>: > > > > Just for clarification: is the excel_xp.

Re: [fpc-pascal] Cannot find entry point of a routine inside a windows 64 dll

2017-12-13 Thread Sven Barth via fpc-pascal
Am 13.12.2017 11:39 schrieb "Dennis Poon" <den...@avidsoft.com.hk>: Sven Barth via fpc-pascal wrote: Am 13.12.2017 03:04 schrieb "Dennis" <de...@avidsoft.com.hk de...@avidsoft.com.hk>>: > > I am converting my windows 32 program to 64 bit. >

Re: [fpc-pascal] Overloading IN operator

2017-12-12 Thread Sven Barth via fpc-pascal
Am 13.12.2017 02:37 schrieb "Fabio Luis Girardi" : Hi all! I want to extend some operators in Freepascal. I want to achieve something like this: if aStr in ['string item 1', 'string item 2', 'string item 3'] then ... else ...; Following the examples to overload

Re: [fpc-pascal] Cannot find entry point of a routine inside a windows 64 dll

2017-12-12 Thread Sven Barth via fpc-pascal
Am 13.12.2017 03:04 schrieb "Dennis" : I am converting my windows 32 program to 64 bit. It compiled with lazarus without any problem.(fpc 3.0.2) I also compile the dll that is used, into a 64 bit dll. However, when I ran the 64 bit program, windows reported 'cannot find

Re: [fpc-pascal] How is EntryInformation.OS.haltproc assigned?

2017-12-04 Thread Sven Barth via fpc-pascal
On 04.12.2017 21:15, Juha Manninen wrote: > I am testing with a 64-bit Manjaro Linux. > I get an access violation when closing any LCL application built with > QT bindings using FPC trunk. When using FPC 3.0.2 there was no access > violation, and neither with other widgetsets. Only FPC trunk + QT

Re: [fpc-pascal] Is there a way to execute code after 'initialization' and before 'main', i. e. AddExitProc complement?

2017-11-28 Thread Sven Barth via fpc-pascal
Am 28.11.2017 20:04 schrieb "Роман via fpc-pascal" < fpc-pascal@lists.freepascal.org>: 'Initialization' sections are executed in poorly predictable order, so I want to partially order them according to some form of explicit prioritization and execute before control flow enters main block (so I

Re: [fpc-pascal] fpc procedure modifier []

2017-11-16 Thread Sven Barth via fpc-pascal
On 16.11.2017 20:25, Maciej Izak wrote: > > > 2017-11-16 20:17 GMT+01:00 Sven Barth via fpc-pascal > <fpc-pascal@lists.freepascal.org <mailto:fpc-pascal@lists.freepascal.org>>: > > One other point to differentiate them: the modifier one always ends with >

Re: [fpc-pascal] fpc procedure modifier []

2017-11-16 Thread Sven Barth via fpc-pascal
On 16.11.2017 14:12, Sven Barth wrote: > Am 16.11.2017 14:01 schrieb "Mattias Gaertner" > <nc-gaert...@netcologne.de <mailto:nc-gaert...@netcologne.de>>: > > On Thu, 16 Nov 2017 11:49:59 +0100 > Maciej Izak <hnb.c...@gmail.com <mailto:hnb.c...@

Re: [fpc-pascal] fpc procedure modifier []

2017-11-16 Thread Sven Barth via fpc-pascal
On 16.11.2017 15:10, Mattias Gaertner wrote: > On Thu, 16 Nov 2017 14:12:18 +0100 > Sven Barth via fpc-pascal <fpc-pascal@lists.freepascal.org> wrote: > >> [...] >> So, how will FPC distinguish the two []? >> >> >> The only idea I have is to check w

Re: [fpc-pascal] fpc procedure modifier []

2017-11-16 Thread Sven Barth via fpc-pascal
Am 16.11.2017 14:01 schrieb "Mattias Gaertner" : On Thu, 16 Nov 2017 11:49:59 +0100 Maciej Izak wrote: > 2017-11-16 11:39 GMT+01:00 Mattias Gaertner : > > > What $modes support this? > > The reason I ask is I'm trying to

Re: [fpc-pascal] installing cross fpc in parallel to systems fpc

2017-11-10 Thread Sven Barth via fpc-pascal
Am 10.11.2017 18:59 schrieb "Marc Santhoff" : On Fr, 2017-11-10 at 18:22 +0100, Karoly Balogh (Charlie/SGR) wrote: > Hi, > > On Fri, 10 Nov 2017, Marc Santhoff wrote: > > > What is that, is ppc used for bootstrapping the cross compiler > > regardless of any other fpc maybe

Re: [fpc-pascal] WinHTTP.h Translation

2017-11-09 Thread Sven Barth via fpc-pascal
Am 10.11.2017 04:06 schrieb "African Wild Dog" : Hello, Does Free Pascal has any header translations for WinHTTP.h ? Yes, unit WinHTTP in packages/winunits-base. Regards, Sven

Re: [fpc-pascal] MINIX 3 support

2017-11-09 Thread Sven Barth via fpc-pascal
Am 10.11.2017 00:05 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: Does FPC support the MINIX 3 target platform? Or has somebody attempted to port FPC to that platform? No, FPC does not support MINIX 3 though I did play around with the idea some years ago (not that there had been

Re: [fpc-pascal] InitThread/DoneThread

2017-10-27 Thread Sven Barth via fpc-pascal
Am 27.10.2017 11:08 schrieb "Ryan Joseph" : > On Oct 27, 2017, at 4:02 PM, Michael Van Canneyt wrote: > > Why you were advised to include these calls explicitly ? > > The only reason I can think of is when your code runs in a DLL, called by

Re: [fpc-pascal] Generic compiler error

2017-10-23 Thread Sven Barth via fpc-pascal
Am 23.10.2017 14:37 schrieb "Maciej Izak" <hnb.c...@gmail.com>: 2017-10-23 14:33 GMT+02:00 Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org>: > Don't know. Only time will tell. > Did we have new team member? I would like to meet him! ;) Sadly time

Re: [fpc-pascal] Generic compiler error

2017-10-23 Thread Sven Barth via fpc-pascal
Am 23.10.2017 12:55 schrieb "Marcos Douglas B. Santos" <m...@delfire.net>: On Mon, Oct 23, 2017 at 6:50 AM, Sven Barth via fpc-pascal <fpc-pascal@lists.freepascal.org> wrote: > Am 23.10.2017 08:29 schrieb "Marco van de Voort" <mar...@stack.nl>: > &

Re: [fpc-pascal] Callbacks as nested functions

2017-10-23 Thread Sven Barth via fpc-pascal
Am 23.10.2017 11:49 schrieb "Ryan Joseph" : Is there anyway to get callbacks to work as nested functions? I get crashes when I try this and I assume it’s because the the compiler is replacing the first parameter with another value. What exactly are you trying? If the

Re: [fpc-pascal] Generic compiler error

2017-10-23 Thread Sven Barth via fpc-pascal
Am 23.10.2017 08:29 schrieb "Marco van de Voort" <mar...@stack.nl>: In our previous episode, Sven Barth via fpc-pascal said: > > Type aliases are currently not supported in mode Delphi. In mode ObjFPC > they might work, but I'm not sure about that either... > > Tha

Re: [fpc-pascal] Generic compiler error

2017-10-23 Thread Sven Barth via fpc-pascal
Am 23.10.2017 04:14 schrieb "Marcos Douglas B. Santos" : Hi, In Pascal we can do this: type TXStream = TStream; Now, TXStream is just an alias to TStream. How do the same with generic classes, using mode delphi? TBar = TFoo; Type aliases are currently not supported

Re: [fpc-pascal] Plans to support various ISO modes

2017-10-22 Thread Sven Barth via fpc-pascal
Am 22.10.2017 10:51 schrieb "Dominik Rappaport" : Hi, I hope this question is not part of the FAQ list. What are the plans for FPC as to the support of the various ISO modes of Pascal? At the moment, there is a switch to enable "ISO" mode, but it's unclear to me which ISO

Re: [fpc-pascal] State of Extended RTTI

2017-10-21 Thread Sven Barth via fpc-pascal
Am 21.10.2017 04:16 schrieb "Nicholas Ring" : > > Hi, > > I am just wondering where eRTTI is at for Free Pascal. I have found this 5 year old thread ( http://fpc-devel.freepascal.narkive.com/4OnA5HH5/state-of-extended-rtti), so I am hoping that it is just around the

Re: [fpc-pascal] Printing types in generics

2017-10-19 Thread Sven Barth via fpc-pascal
Am 19.10.2017 08:41 schrieb "Ryan Joseph" <r...@thealchemistguild.com>: > > > > > On Oct 19, 2017, at 12:58 PM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > > > And your case for tkSString crashes, because that is a Sh

Re: [fpc-pascal] Printing types in generics

2017-10-18 Thread Sven Barth via fpc-pascal
Am 19.10.2017 07:45 schrieb "Ryan Joseph" : > > How should you print types in generics for debugging? here’s an example of how I’m doing it now but it’s hacky (forced type casting pointers) and tkSString crashes like it is. There should be a better solution I think.

Re: [fpc-pascal] Initializing constant (translate from C)

2017-10-17 Thread Sven Barth via fpc-pascal
Am 16.10.2017 21:36 schrieb "Darius Blaszyk" : > > Here's an interesting one. In C I have this code: > > #define ID1 MAKE_ID('A', 'B') > > Where MAKE_ID is a macro that depending on the endianness of the target will create either AB or BA. > > How would I be able to

Re: [fpc-pascal] AbstractError in 3.1.1

2017-10-12 Thread Sven Barth via fpc-pascal
Am 12.10.2017 13:59 schrieb "Ryan Joseph" : > > > > > On Oct 12, 2017, at 5:35 PM, Michael Van Canneyt wrote: > > > > Normally not :) > > > > What Sven wanted to ascertain was why you get this error, which is totally abnormal. > > Ok did some

Re: [fpc-pascal] AbstractError in 3.1.1

2017-10-12 Thread Sven Barth via fpc-pascal
Am 12.10.2017 10:37 schrieb "Ryan Joseph" <r...@thealchemistguild.com>: > > > > > On Oct 12, 2017, at 12:59 PM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > > > AbstractError() is the name of the function the c

Re: [fpc-pascal] AbstractError in 3.1.1

2017-10-12 Thread Sven Barth via fpc-pascal
Am 12.10.2017 04:34 schrieb "Ryan Joseph" : > > I just built the ppcx64 trunk version 3.1.1 so I could try the memory management operator overloads we talked about but I’m getting a compiler error in my project that doesn’t make sense. > > On the last line of one unit

Re: [fpc-pascal] FPC attributes / annotations support

2017-10-11 Thread Sven Barth via fpc-pascal
Am 11.10.2017 14:45 schrieb "Graeme Geldenhuys" < mailingli...@geldenhuys.co.uk>: > > Bringing a discussion from the Lazarus mailing list to here. > > > On 2017-09-24 09:13, Michael Van Canneyt via Lazarus wrote: > > It's called Attributes. FPC has it too, but it is not yet in trunk. > > Is there

Re: [fpc-pascal] Const params question

2017-10-11 Thread Sven Barth via fpc-pascal
Am 11.10.2017 15:28 schrieb "Ryan Joseph" : > > > > > On Oct 11, 2017, at 5:01 PM, Michael Van Canneyt wrote: > > > > No, you need constref then. > > Ok, so constref/var are the same in terms of copying. The docs say const reduces stack size? I

Re: [fpc-pascal] where's the glyph?

2017-10-11 Thread Sven Barth via fpc-pascal
Am 11.10.2017 13:13 schrieb : > > Hi, > > LCL provides the usual Delphi equivalent components like TBitBtn and TSpeedButton but there do not seem to be any glyphs to go with them. > > Do I really have to make my own or are there some resources I have not found ? Lazarus/LCL

Re: [fpc-pascal] Resource compilation

2017-10-11 Thread Sven Barth via fpc-pascal
Am 11.10.2017 08:11 schrieb "Martok" <list...@martoks-place.de>: > > Am 25.09.2017 um 14:24 schrieb Sven Barth via fpc-pascal: > > The RC language itself isn't *that* difficult. Main difficulty would be to > > essentially implement a C-preprocessor-compati

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

2017-10-11 Thread Sven Barth via fpc-pascal
Am 11.10.2017 05:12 schrieb "Mr Bee via fpc-pascal" < fpc-pascal@lists.freepascal.org>: > > 2017-10-10 13:28 GMT+07:00 Marco van de Voort : >> >> >> Since it is already largely uploaded, no. We are only waiting on some >> targets. > > > I thought such a minor fix that don't break

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

2017-10-11 Thread Sven Barth via fpc-pascal
Am 11.10.2017 07:00 schrieb "Mr Bee via fpc-pascal" < fpc-pascal@lists.freepascal.org>: > > 2017-10-10 16:21 GMT+07:00 Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org>: >> >> They were used mainly back at TP times to have procedure local static

Re: [fpc-pascal] alternative name fpc cross

2017-10-10 Thread Sven Barth via fpc-pascal
Am 10.10.2017 15:21 schrieb "turro75" : > > Well, > > I think my problem is easier > when I compile fpc for arm-android target I get ppccrossarm and units > arm-android (with binutils arm-linux-android-*) > > when I compile fpc for arm-embedded target I get

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

2017-10-10 Thread Sven Barth via fpc-pascal
Am 10.10.2017 08:08 schrieb : > $make all NOGDB=1 OS_TARGET=linux CPU_TARGET=x86_64 INSTALL_PREFIX=/usr > Makefile:2914: *** The only supported starting compiler version is 3.0.0. You are trying to build with 3.1.1.. Stop. > > BTW is that msg is correct? I just

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

2017-10-10 Thread Sven Barth via fpc-pascal
Am 10.10.2017 08:49 schrieb : > BTW why would anyone want > {$WRITEABLECONST ON} > > writable constants is an oxymoron and goes against the whole philosophy of strict types which is central to Pascal. They were used mainly back at TP times to have procedure local static

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 >

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

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" <m...@delfire.net>: > > On Fri, Oct 6, 2017 at 4:17 PM, Sven Barth via fpc-pascal > <fpc-pascal@lists.freepascal.org> wrote: > > Am 06.10.2017 20:52 schrieb "Marcos Douglas B. Santos" <m..

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: > > > >

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 sugges

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

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

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

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

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

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-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

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

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 t

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

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

Re: [fpc-pascal] Inclocked/declocked

2017-09-11 Thread Sven Barth via fpc-pascal
Am 12.09.2017 06:54 schrieb "Ryan Joseph" <r...@thealchemistguild.com>: > > > > 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 IncLock

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 >> <fpc-pascal@lists.freepascal.org> wrote: >> >> They're used for the reference counter of the array (or string or >> interface). The reference counte

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

2017-09-07 Thread Sven Barth via fpc-pascal
Am 07.09.2017 03:48 schrieb "Ryan Joseph" <r...@thealchemistguild.com>: > > > > 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. >

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

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; > >

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

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

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

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

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

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

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" <mschn...@lumino.de>: > > 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 deprecate

Re: [fpc-pascal] Freepascal Floating Point Issue

2017-08-28 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

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" <mar...@stack.nl>: >>> The GTK headers also use a 0/1 boolean, and for that the boolean8/16/32 >>

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

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-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 >

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" <mich...@freepascal.org>: > > > > On Sat, 26 Aug 2017, Sven Barth via fpc-pascal wrote: > >> Am 26.08.2017 07:25 schrieb <nore...@z505.com>: >>> >>> >>> What about the BOO

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: >

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" <xhaj...@hajny.biz>: > > 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" <pwna...@gmai

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

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

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 -

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 >

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 > <fpc-pascal@lists.freepascal.org> wrote: >> On 23.08.2017 19:57, Marcos Douglas B. Santos wrote: >>> Would we have any problem of memory leaks using In

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 > <fpc-pascal@lists.freepascal.org> wrote: >> Am 23.08.2017 19:39 schrieb "Marcos Douglas B. Santos" <m...@delfire.net>: >>> >

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:

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

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.

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'

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); > > > >

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.

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

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

2017-08-23 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] 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

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

Re: [fpc-pascal] TStringHelper missing

2017-08-21 Thread Sven Barth via fpc-pascal
Am 21.08.2017 13:51 schrieb "Sven Barth" <pascaldra...@googlemail.com>: > > Am 21.08.2017 08:23 schrieb "Michael Van Canneyt" <mich...@freepascal.org >: > > > > > > > > On Mon, 21 Aug 2017, Ryan Joseph wrote: > > > >&g

Re: [fpc-pascal] TStringHelper missing

2017-08-21 Thread Sven Barth via fpc-pascal
t;> >> parts := str.Split(' ‘); >> >> >> What am I doing wrong? > > > Try > > var > Str : AnsiString; > or > Str : WideString; > > I believe the compiler has some trouble finding the helper if you use the > 'string' alias. I th

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 -

<    5   6   7   8   9   10   11   12   13   14   >