Re: [fpc-pascal] for-in loop cast

2019-09-26 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Do., 26. Sep. 2019, 17:37: > Question I’ve always had. Why do I need to cast “value” to “pointer" > otherwise I get: Incompatible types: got "Pointer" expected “TObject” > error?. I don’t find this very helpful and it doesn’t really make sense > even. > > var > list:

Re: [fpc-pascal] FPC docs about FindFirst

2019-09-22 Thread Sven Barth via fpc-pascal
Ched schrieb am So., 22. Sep. 2019, 21:11: > Hello, > > > Le 22.09.19 à 16:59, Michael Van Canneyt a écrit : > > > > > > On Sun, 22 Sep 2019, AlexeyT wrote: > > > >> https://www.freepascal.org/docs-html/rtl/sysutils/findfirst.html > >> > >> 1) add to the list of attribs the value faAnyFile. > >

Re: [fpc-pascal] [Lazarus] It's alive !

2019-09-21 Thread Sven Barth via fpc-pascal
Am 21.09.2019 um 15:22 schrieb Michael Van Canneyt via lazarus: Hello, Finally, the moment has come: https://www.youtube.com/watch?v=xos2MnVxe-c Following up on a bounty offered, Dmitry Boyarintsev has accomplished milestone one in the implementation of FPC's webassembly backend. And:

Re: [fpc-pascal] Overloading Inc and Dec procedures?

2019-09-18 Thread Sven Barth via fpc-pascal
LacaK schrieb am Mi., 18. Sep. 2019, 13:38: > Hi *, > > seems, that overloading of Inc, Dec internal compiler procedures is not > allowed. > Is it by intention or can it be fixed (adding overload keyword to system > function definitions?). > Yes, this is by intention and no, it can't be fixed.

Re: [fpc-pascal] Calculating Pixels to represent 3D coordinates

2019-09-17 Thread Sven Barth via fpc-pascal
James Richters schrieb am Di., 17. Sep. 2019, 16:15: > I'm curious if Freepascal has any package available that would calculate > X,Y screen pixels based on 3D X,Y,Z data at some given rotations. I'm > using Agg-Pas with PTC-Graph in a console application on Windows. I'm not > sure what the

Re: [fpc-pascal] Illegal counter variable?

2019-09-11 Thread Sven Barth via fpc-pascal
James Richters schrieb am Mi., 11. Sep. 2019, 16:24: > How do you get ‘By’ to work? I have downto working but if I try ‘By’ I > get > > > > Fatal: Syntax error, "DO" expected but "identifier BY" found > Did you see anywhere that said that this bug report was resolved and the patch integrated

Re: [fpc-pascal] Illegal counter variable?

2019-09-11 Thread Sven Barth via fpc-pascal
Christo Crause schrieb am Mi., 11. Sep. 2019, 09:54: > > On Wed, Sep 11, 2019 at 7:06 AM Ralf Quint wrote: > >> On 9/10/2019 4:26 PM, wkitt...@windstream.net wrote: >> > On 9/9/19 10:11 AM, James Richters wrote: >> >> Pascal doesn't have things like step... >> > >> > hunh??? i don't think

Re: [fpc-pascal] Compatibility problems with fpc > 3.3.1 rev 42375

2019-08-31 Thread Sven Barth via fpc-pascal
fredvs schrieb am Sa., 31. Aug. 2019, 22:00: > Hello Sven. > > > Just look at the changes: ... > > OK, but before I have to check my stock of aspirin. > I think I'm going to need a lot this time. > > Many thanks Sven to help me in that complete darkness. > Alternatively try alcohol. ;) And I

Re: [fpc-pascal] Compatibility problems with fpc > 3.3.1 rev 42375

2019-08-31 Thread Sven Barth via fpc-pascal
Am 31.08.2019 um 18:24 schrieb fredvs: Hello. Type information contains reference to attribute table Old behavior: The first field of the data represented by TTypeData is whatever the sub branch of the case statement for the type contains. New behavior: The first field of the data represented

Re: [fpc-pascal] Compatibility problems with fpc > 3.3.1 rev 42375

2019-08-31 Thread Sven Barth via fpc-pascal
Am 31.08.2019 um 14:31 schrieb fredvs: Hello everybody and specially Sven Barth. With last trunk of fpc, msegui is no more compatible with fpc. After big fight, it appears that commit of Sven Barth on Jul 13 2019, rev 42375 breaks compatibility ---> "as attributes can be part of

Re: [fpc-pascal] ppc64le ABI problem

2019-08-26 Thread Sven Barth via fpc-pascal
schrieb am Di., 27. Aug. 2019, 01:38: > If anybody would like a near silent POWER9 system at home, > I can really recommend the new Blackbird mainboard with CPU bundles > from Raptor CS. The lower cost 4-core CPU uses so little power you > hardly even need a fan for it. > If only it wouldn't

Re: [fpc-pascal] ppc64le ABI problem

2019-08-26 Thread Sven Barth via fpc-pascal
schrieb am Mo., 26. Aug. 2019, 19:53: > Hello, > > trying to recompile now ... since ppc64le support is not in 3.0.4, I > suppose I need to use a more recent version to compile it. So there is > no advantage in cross-compiling and I might as well try it with the > latest native fpc compiler? > >

Re: [fpc-pascal] ppc64le ABI problem

2019-08-26 Thread Sven Barth via fpc-pascal
Florian Klämpfl schrieb am Mo., 26. Aug. 2019, 14:01: > Am 26. August 2019 00:59:16 schrieb tobiasgie...@gmail.com: > > > Hello, > > > > > > while examining a crash when running Lazarus on ppc64le, I found the > > following issue in function calls. > > > > > > Calls to functions with more than

Re: [fpc-pascal] += property bug?

2019-08-15 Thread Sven Barth via fpc-pascal
Am 15.08.2019 um 00:39 schrieb Jean SUZINEAU: Le 14/08/2019 à 23:18, Martin a écrit : inc(CALL_LVL [ LOCAL_CALL ],1) Yes, "inc" does not work for properties. But neither does +=. I agree and in the case of a property I think it would be cleaner to code an Inc method directly in the class,

Re: [fpc-pascal] += property bug?

2019-08-14 Thread Sven Barth via fpc-pascal
Michael Van Canneyt schrieb am Mi., 14. Aug. 2019, 18:24: > Basically any operation that requires an address is not allowed. > That += is using an address is an implementation detail of the compiler. > Same as Inc() or In/Exclude(). I don't know the exact reason for this > limitation, > but it's

Re: [fpc-pascal] += property bug?

2019-08-13 Thread Sven Barth via fpc-pascal
Martok schrieb am Di., 13. Aug. 2019, 14:44: > Am 12.08.2019 um 11:31 schrieb Sven Barth via fpc-pascal: > > The code you linked converts "a += b" to "tmp := @a; tmp^ := tmp^ + b", > so > > except for using a temp to avoid duplicate calculation of "a&

Re: [fpc-pascal] += property bug?

2019-08-12 Thread Sven Barth via fpc-pascal
Martok schrieb am Mo., 12. Aug. 2019, 10:18: > Am 12.08.2019 um 09:40 schrieb Michael Van Canneyt: > > > > This question pops up from time to time since 15 years if not more. > > Fun fact: questions asking why this doesn't work have a higher Google > ranking > than the manual for "COPERATORS"

Re: [fpc-pascal] += property bug?

2019-08-11 Thread Sven Barth via fpc-pascal
Am 11.08.2019 um 18:33 schrieb Ryan Joseph: Is this a bug? It should resolve to: d.setter(d.getter + 10) but it doesn’t seem to be working. {$mode objfpc} {$modeswitch advancedrecords} program test; type TData = record x: integer; end;

Re: [fpc-pascal] PPCJVM Android JVM target and building to dex

2019-08-03 Thread Sven Barth via fpc-pascal
Mgr. Janusz Chmiel schrieb am Sa., 3. Aug. 2019, 11:48: > Many of advanced users and developers have tried PPCJVM. It is really > possible to create fully functioning Android applications. And because > it is even possible to access methods from previously compiled .jar > files including

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-08-02 Thread Sven Barth via fpc-pascal
fredvs schrieb am Fr., 2. Aug. 2019, 18:32: > > cause the type information is read only. > > Yes, it is why I will not jump into that proposition. > > > And if someone is not able to check for a simple flag then they shouldn't > > work with the RTTI. > > Huh, like in your code-fix? > > ;-) > >

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-08-02 Thread Sven Barth via fpc-pascal
fredvs schrieb am Fr., 2. Aug. 2019, 15:11: > Hello Sven. > > > {$if declared(AlignTParamFlags)} > Excellent! > > If, by chance, you're running out of ideas for new methods for fpc 3.3.1 > trunk and have nothing to do or you're bored... > For people that are not fan of headaches (so not for me),

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-08-02 Thread Sven Barth via fpc-pascal
fredvs schrieb am Fr., 2. Aug. 2019, 13:27: > > No, It's > 030300, but your version of trunk is too old, the function > > was only added a few days ago. > > Ha, ok. (but a few tricky, a new number for a new feature would be ok too). > By definition only the latest version of trunk is considered

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-08-01 Thread Sven Barth via fpc-pascal
Am 02.08.2019 um 03:01 schrieb fredvs: Hello. {$if FPC_FULLVERSION >= 030300} paramlist1 := AlignTParamFlags(paramlist1); {$endif} Hum, with fpc 3.3.1. [2019/04/24] there is that error message: msedesignparser.pas(694,43) Error: Identifier not found "AlignTParamFlags". Could it be that

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-07-29 Thread Sven Barth via fpc-pascal
fredvs schrieb am Mo., 29. Juli 2019, 11:42: > > You should also use 030100 here as that was added at the same time as the > switch to Word size. > > Ha, ok (so Martin only had begin the work for 030100, I was thinking that > fpc > 030100 = fpc > 3.0.0., like fpc 3.0.2. or fpc 3.0.4). > > So the

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-07-29 Thread Sven Barth via fpc-pascal
fredvs schrieb am So., 28. Juli 2019, 22:26: > >. I think it /should/ work however if you add a "{$if > FPC_FULLVERSION >= > 030300} > > Oops, sorry, you writed it already: if > FPC_FULLVERSION >= 030300 > > OK thanks. > > Huh, and for: > > > if FPC_FULLVERSION >= 030200 (not sure of the number)

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-07-28 Thread Sven Barth via fpc-pascal
Am 28.07.2019 um 16:02 schrieb fredvs: It's not beautiful if you mean that, but it will work... OK, I will make it nicer. Well, nicer would be if you'd do it inside the main for-loop. Oh and just in case you want more headaches... Yes, please, I adore it. By the way, about headache, may I

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-07-28 Thread Sven Barth via fpc-pascal
Am 28.07.2019 um 15:10 schrieb fredvs: I'm no fan of those nested with-blocks Same for me. Did you see my fixes, do you agree with it ? It's not beautiful if you mean that, but it will work... Oh and just in case you want more headaches: the current code will bomb on current FPC trunk on

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-07-28 Thread Sven Barth via fpc-pascal
Am 28.07.2019 um 03:02 schrieb fredvs: PS: If you know what makes the problems in your code, I am very curious to know what is the solution. I'm no fan of those nested with-blocks so I definitely won't try to fix that code. Regrds, Sven ___

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-07-27 Thread Sven Barth via fpc-pascal
Am 27.07.2019 um 19:02 schrieb fredvs: Imho, it seems that in your code "if not (pfHidden in flags) then" was placed one "end;" too far. That's what I meant in the mail you replied to. Am 27.07.2019 um 19:07 schrieb fredvs: Sven, did you try a simple code, it seems that "$self" first

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-07-27 Thread Sven Barth via fpc-pascal
fredvs schrieb am Sa., 27. Juli 2019, 17:54: > Hello Sven. > > > That said the code I showed you had an issue which might explain the > > behaviour you got: > > I did try your new code but get that error message at compilation: > > msedesignparser.pas(722,11) Error: Incompatible types: got

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-07-26 Thread Sven Barth via fpc-pascal
Am 26.07.2019 um 14:50 schrieb fredvs: But, imho, there is problem with the behavior of fpc-ptypeinfo and filter in TParamFlags. Dont worry, I will not annoy you with this. There is no problem with PTypeInfo or TParamFlags. The tests for these functionalities pass without any issues on multiple

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-07-26 Thread Sven Barth via fpc-pascal
fredvs schrieb am Fr., 26. Juli 2019, 09:06: > > It would help more if you'd point me exactly at the code in question. > > OK, now that you see the problem, here the code in mse-ide project: > > In msedesignparser.pas, procedure getmethodparaminfo: (Please take a look > at > the // in code that

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-07-25 Thread Sven Barth via fpc-pascal
fredvs schrieb am Do., 25. Juli 2019, 15:08: > Re-re hello. > > Maybe with video it will be more easy to explain the problem. > It would help more if you'd point me exactly at the code in question. Regards, Sven ___ fpc-pascal maillist -

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-07-24 Thread Sven Barth via fpc-pascal
fredvs schrieb am Mi., 24. Juli 2019, 08:10: > Hello. > > > Check for pfHidden. > > Thanks Sven for helping. > But I do not catch how to hide those "self" parameter. > > IMHO, the guilty is here, in Martin's code msedisignparser.pas > (Sadly I did not find any example how to use TParameterFlag.

Re: [fpc-pascal] TParamFlags and fpc 3.2.0.

2019-07-23 Thread Sven Barth via fpc-pascal
fredvs schrieb am Di., 23. Juli 2019, 12:52: > Hello. > > I try to make msegui/mseide compatible with fpc 3.2.0. > > Thanks to Graeme fixes, interfaces of msegui is now compatible with fpc > 3.2.0. > > But there is still problem with the use of TParamFlags with fp 3.2.0 and > mseide. > > Now,

Re: [fpc-pascal] Warning: Symbol "faHidden" is not portable

2019-07-19 Thread Sven Barth via fpc-pascal
James Richters schrieb am Fr., 19. Juli 2019, 19:32: > I'm using Windows 10, but I may in the future want to make a Linux version > of my program. I guess that's what the warning is about.. that fAHidden > won't detect hidden files on some operating systems? > Correct. Regards, Sven >

[fpc-pascal] Initial support for Custom Attributes

2019-07-12 Thread Sven Barth via fpc-pascal
Hello together! Today FPC has finally gained initial support for Custom Attributes. The work had initially been done by Joost van der Sluis almost 6 years ago and Svetozar Belic had adjusted the code for trunk. So thank you both for that work even if it took quite some time until it was

Re: [fpc-pascal] Compile fpc twice or only once during install?

2019-07-12 Thread Sven Barth via fpc-pascal
Christo Crause schrieb am Fr., 12. Juli 2019, 15:30: > > On Fri, 12 Jul 2019, 14:19 Bo Berglund, wrote: > >> When I install FPC/Lazarus on new Linux systems I use a script I wrote >> several years ago. It is cofigured for the actual versions to install >> but otherwise it is self-contained. >>

Re: [fpc-pascal] specify variable name with string variable

2019-07-08 Thread Sven Barth via fpc-pascal
James Richters schrieb am Mo., 8. Juli 2019, 22:44: > SetStoragePinByName('Ini_Opto_Enable_Positive_Pin', True) ; > > And it would somehow get the value of 'Ini_Opto_Enable_Positive_Pin > That indeed sounds like something where you could use classes together with published properties. At least

Re: [fpc-pascal] Implementation of variant records

2019-07-07 Thread Sven Barth via fpc-pascal
Am 07.07.2019 um 12:54 schrieb Sven Barth: Am 07.07.2019 um 02:55 schrieb Ralf Quint: On 7/6/2019 12:21 PM, Florian Klaempfl wrote: Am 05.07.2019 um 13:53 schrieb Ralf Quint: Shouldn't a PACKED Record guarantee that values are aligned at the byte level? It does in TP, but the ISO says only

Re: [fpc-pascal] Implementation of variant records

2019-07-07 Thread Sven Barth via fpc-pascal
Am 07.07.2019 um 02:55 schrieb Ralf Quint: On 7/6/2019 12:21 PM, Florian Klaempfl wrote: Am 05.07.2019 um 13:53 schrieb Ralf Quint: Shouldn't a PACKED Record guarantee that values are aligned at the byte level? It does in TP, but the ISO says only that it shall be economised. Well, the ISO

Re: [fpc-pascal] Developing a mini ERP / web based development

2019-07-07 Thread Sven Barth via fpc-pascal
Graeme Geldenhuys schrieb am So., 7. Juli 2019, 11:45: > Does FPC support annotations yet? > In the Object Pascal world they are called custom attributes, are accessible through the RTTI and their syntax is [AttributeName(Arguments)]. There exists a branch with them and it's "just" a matter of

Re: [fpc-pascal] Virtual object methods

2019-07-02 Thread Sven Barth via fpc-pascal
Am 02.07.2019 um 19:43 schrieb Michael Van Canneyt: On Tue, 2 Jul 2019, Ryan Joseph wrote: On Jul 2, 2019, at 10:32 AM, Michael Van Canneyt wrote: It overwrites the first. There is no such thing as '2 VMT tables'. That’s what I thought. How costly is this? Not sure what it’s doing

Re: [fpc-pascal] Troubles with SQLDBRESTBridge

2019-07-02 Thread Sven Barth via fpc-pascal
Michael Van Canneyt schrieb am Di., 2. Juli 2019, 08:20: > > > On Mon, 1 Jul 2019, Sven Barth via fpc-pascal wrote: > > > Am 01.07.2019 um 23:18 schrieb Michael Van Canneyt: > >> > >>> > >>> By the way: is it correct that the sqldbrestdataset

Re: [fpc-pascal] Troubles with SQLDBRESTBridge

2019-07-01 Thread Sven Barth via fpc-pascal
Am 01.07.2019 um 23:18 schrieb Michael Van Canneyt: By the way: is it correct that the sqldbrestdataset currently does not support editing/inserting/deleting entries? Do you plan to change this? Ehm, no, of course it is supposed to support that. It would not be much good if it didn't :-)

Re: [fpc-pascal] Troubles with SQLDBRESTBridge

2019-07-01 Thread Sven Barth via fpc-pascal
Am 24.06.2019 um 09:30 schrieb Michael Van Canneyt: With the sample module, I tested all possible cases: I updated both FPC and Lazarus and also tested the sample module. However those variants BasePath empty don't work. I get an exception at line 2053 of sqldbrestbridge.pp. It seems that

Re: [fpc-pascal] Wiki: platform defines

2019-06-28 Thread Sven Barth via fpc-pascal
Alexey Tor. schrieb am Fr., 28. Juni 2019, 12:16: > https://wiki.freepascal.org/Platform_defines#Operating_system_defines > > I 've added all defines of OS. You can tell me if it's not ok. Missed > one item: 'nativent' target. Seems some Win32 target? why new? Why it > don't have extradefines

Re: [fpc-pascal] String conversions

2019-06-26 Thread Sven Barth via fpc-pascal
Am 27.06.2019 um 07:10 schrieb Sven Barth: Am 26.06.2019 um 23:36 schrieb Ryan Joseph: On Jun 26, 2019, at 3:28 PM, Ben Grasset wrote: I think Ryan probably meant his own custom types. And certainly, you can do some interesting stuff with operator overloading that mostly avoids the normal

Re: [fpc-pascal] String conversions

2019-06-26 Thread Sven Barth via fpc-pascal
Am 26.06.2019 um 23:36 schrieb Ryan Joseph: On Jun 26, 2019, at 3:28 PM, Ben Grasset wrote: I think Ryan probably meant his own custom types. And certainly, you can do some interesting stuff with operator overloading that mostly avoids the normal AnsiString overhead. Here's an example.

Re: [fpc-pascal] Troubles with SQLDBRESTBridge

2019-06-24 Thread Sven Barth via fpc-pascal
Michael Van Canneyt schrieb am Mo., 24. Juni 2019, 09:30: > > > On Sun, 23 Jun 2019, Sven Barth via fpc-pascal wrote: > > >>>>> - localhost:8080/metadata works > >>>>> - localhost:8080/users returns "INVALID RESOURCE" > >>

Re: [fpc-pascal] why isn't the 'exit' in the finally end clause executed?

2019-06-23 Thread Sven Barth via fpc-pascal
Am 23.06.2019 um 16:33 schrieb Jonas Maebe: On 23/06/2019 09:08, Dennis wrote: Using fpc 3.0.4, Lazarus 2.0, the following simple program program tryfinally; begin   try     Writeln('before finally');   finally Writeln('inside finally. Before Exit'); exit; //

Re: [fpc-pascal] Troubles with SQLDBRESTBridge

2019-06-23 Thread Sven Barth via fpc-pascal
Am 23.06.2019 um 11:31 schrieb Michael Van Canneyt: On Sun, 23 Jun 2019, Sven Barth via fpc-pascal wrote: Okay, independently of whether the REST module is the optimal solution or not, it should work, right? (and shouldn't the Wiki entry then mention the advantages/disadvantages of the two

Re: [fpc-pascal] Troubles with SQLDBRESTBridge

2019-06-23 Thread Sven Barth via fpc-pascal
Am 23.06.2019 um 00:50 schrieb Michael Van Canneyt: On Sat, 22 Jun 2019, Sven Barth via fpc-pascal wrote: The REst Module has the additional disadvantage that you must have an initial /REST/ or whatever part in your URL. With the dispatcher on a datamodule, you can skip this if so desired

Re: [fpc-pascal] Troubles with SQLDBRESTBridge

2019-06-22 Thread Sven Barth via fpc-pascal
Am 22.06.2019 um 10:30 schrieb Michael Van Canneyt: On Fri, 21 Jun 2019, Sven Barth via fpc-pascal wrote: Hello together! I've played around a bit with the SQLDBRESTBridge and encountered some troubles which I wanted to check up here on the list whether those are indeed bugs or not before

[fpc-pascal] Troubles with SQLDBRESTBridge

2019-06-21 Thread Sven Barth via fpc-pascal
Hello together! I've played around a bit with the SQLDBRESTBridge and encountered some troubles which I wanted to check up here on the list whether those are indeed bugs or not before reporting them to Mantis. For the tests I've used FPC 3.0.4 and Lazarus 2.0 with the SQLDBRESTBridge and the

Re: [fpc-pascal] OpenBSD platform define

2019-06-21 Thread Sven Barth via fpc-pascal
Alexey Tor. schrieb am Fr., 21. Juni 2019, 13:10: > I cannot find such in the https://wiki.freepascal.org/Platform_defines - > its missed? > It's missing in the listing as is DragonFlyBSD and some others (e.g. the three supported Nintendo consoles). Regards, Sven >

Re: [fpc-pascal] Class field property access

2019-06-07 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Fr., 7. Juni 2019, 14:00: > > > > On Jun 7, 2019, at 2:51 AM, Michael Van Canneyt > wrote: > > > > What kind of behaviour are you referring to. > > Something wrong with my mail server causing your server to block me (Jonas > said my server didn’t handle greylisting

Re: [fpc-pascal] Class field property access

2019-06-07 Thread Sven Barth via fpc-pascal
Michael Van Canneyt schrieb am Fr., 7. Juni 2019, 08:52: > > This appears to be a regression since 3.0.4 also. Did you specifically > > disable this in 3.3.1? Sorry I’m not understanding this one. > > If it was allowed in previous versions, this was by accident allowed during > parsing and

Re: [fpc-pascal] Error? No range checks in mode delphi?

2019-06-04 Thread Sven Barth via fpc-pascal
Anthony Walter schrieb am Di., 4. Juni 2019, 03:27: > That fixes it, but then the question is why does {$mode delphi} differ > from {$mode objfpc}? > Mode ObjFPC is stricter in some cases. While mode Delphi cares for Delphi compatibility. Regards, Sven

Re: [fpc-pascal] Class field property access

2019-06-03 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Mo., 3. Juni 2019, 16:36: > I found a restriction in properties which is a little disappointing. I get > there’s probably some objective of safety but Pascal is a direct memory > access language so I don’t understand why properties have this unique > restriction when I

Re: [fpc-pascal] Convert codepages back to UTF8

2019-05-28 Thread Sven Barth via fpc-pascal
Alexey Tor. schrieb am Di., 28. Mai 2019, 14:44: > Ok, I got it. But I wonder: if my code changes codepage of a "string" to > e.g. 1250, will all Lazarus string functions work ok with such changed > string? For ex, will Pos('Петя', s) work? > Depends on what you do with the returned value.

Re: [fpc-pascal] Convert codepages back to UTF8

2019-05-28 Thread Sven Barth via fpc-pascal
Martok schrieb am Mo., 27. Mai 2019, 15:14: > Am 27.05.2019 um 14:30 schrieb Sven Barth via fpc-pascal: > > Alexey Tor. > <mailto:aaa5...@ya.ru>> schrieb am Mo., 27. Mai 2019, 13:15: > > > > LazUtils.LConvEncoding can convert utf8 to codepage (not many &g

Re: [fpc-pascal] Convert codepages back to UTF8

2019-05-27 Thread Sven Barth via fpc-pascal
Alexey Tor. schrieb am Mo., 27. Mai 2019, 13:15: > LazUtils.LConvEncoding can convert utf8 to codepage (not many codepages) > and vice versa. > > FPC 3 can convert utf8 to codepage - via SetCodePage(s, codepage, true). > But how can FPC convert back - codepage to utf8? Does such way exist? >

Re: [fpc-pascal] Checking if a TStringList already exists

2019-05-21 Thread Sven Barth via fpc-pascal
James Richters schrieb am Di., 21. Mai 2019, 15:48: > I don’t seem to have FreeThenNil I’m using FPC 3.0.4RC1 I don’t use > Lazarus.. maybe it’s a Lazarus thing… or maybe it’s in a different unit > Correct, it's part of Lazarus. Regards, Sven > ___

Re: [fpc-pascal] Checking if a TStringList already exists

2019-05-20 Thread Sven Barth via fpc-pascal
James Richters schrieb am Mo., 20. Mai 2019, 15:23: > Thank you very much for the explanation and examples of this! I am glad > you pointed out the FreeAndNill() function, I will defiantly be needing > that. > Though you need to keep in mind that only that single variable will be set to Nil.

Re: [fpc-pascal] Detecting console close with red X on windows

2019-05-19 Thread Sven Barth via fpc-pascal
James Richters schrieb am So., 19. Mai 2019, 19:10: > Thanks!That was quite helpful! I have a test program kind of > working. > > I notice I only get 5 seconds to do what I am going to before it closes, > and I also notice that my program can no longer respond to keystrokes after > I hit

Re: [fpc-pascal] unexpected termination with no errors

2019-05-15 Thread Sven Barth via fpc-pascal
Karoly Balogh (Charlie/SGR) schrieb am Mi., 15. Mai 2019, 18:40: > Hi, > > On Wed, 15 May 2019, Sven Barth via fpc-pascal wrote: > > >> (Sidenote: I've been pondering for a while if I should report this as a > >> bug. I think the RTL should put a tr

Re: [fpc-pascal] unexpected termination with no errors

2019-05-15 Thread Sven Barth via fpc-pascal
Karoly Balogh (Charlie/SGR) schrieb am Mi., 15. Mai 2019, 15:25: > Hi, > > On Wed, 15 May 2019, James Richters wrote: > > > Has anyone encountered anything like this before or know how I can make > > sure I always get the maximum amount of debugging info when my program > > crashes? > > Is it a

Re: [fpc-pascal] dot net dll in free pascal?

2019-05-14 Thread Sven Barth via fpc-pascal
Luca Olivetti schrieb am Di., 14. Mai 2019, 09:13: > El 14/5/19 a les 0:15, Sven Barth via fpc-pascal ha escrit: > > > The file command under Linux says: > > Siemens.Engineering.dll: PE32 executable (DLL) (console) Intel 80386 > > Mono/.Net assembly, for MS

Re: [fpc-pascal] dot net dll in free pascal?

2019-05-13 Thread Sven Barth via fpc-pascal
Luca Olivetti schrieb am Mo., 13. Mai 2019, 23:14: > A sizeable part of my day job is to program PLCs in the worst software > environment ever (for the curious, simatic tia portal, actually I'm > mostly using the older, only marginally better, step 7, but the times > they are a-changin'). > Said

Re: [fpc-pascal] Problem linking external libs on Linux

2019-05-12 Thread Sven Barth via fpc-pascal
Anthony Walter schrieb am So., 12. Mai 2019, 20:42: > Okay, so I need to install the dev versions of any package I want to link > against. But when my program is distributed it will link at load time > correctly to the non dev versions. > It links against the version the development version

Re: [fpc-pascal] Problem linking external libs on Linux

2019-05-12 Thread Sven Barth via fpc-pascal
Anthony Walter schrieb am So., 12. Mai 2019, 18:41: > For example suppose I want to write some pascal code linking to an > external functions like so: > > const > libsdl2 = 'libSDL2-2.0.so.0'; > > function SDL_Init(flags: Uint32): LongInt; cdecl; external libsdl2; > procedure SDL_Quit; cdecl;

Re: [fpc-pascal] Feature Announcement: Support for multiple active helpers per type

2019-05-10 Thread Sven Barth via fpc-pascal
Am 10.05.2019 um 22:21 schrieb Mattias Gaertner via fpc-pascal: On Fri, 10 May 2019 21:56:56 +0200 Sven Barth via fpc-pascal wrote: [...] We are pleased to announce that Free Pascal now supports the usage of multiple active helper types per extended type. This feature has been developed

[fpc-pascal] Feature Announcement: Support for multiple active helpers per type

2019-05-10 Thread Sven Barth via fpc-pascal
Hello together! We are pleased to announce that Free Pascal now supports the usage of multiple active helper types per extended type. This feature has been developed by Ryan Joseph, so thank you very much Ryan. To enable this feature you need to use the new modeswitch multihelpers. This

Re: [fpc-pascal] Turbo Pascal 3 graphics

2019-05-08 Thread Sven Barth via fpc-pascal
Kevin Lyda schrieb am Mi., 8. Mai 2019, 10:58: > Amazingly I still have a number of my high school computer science > projects which were written in Turbo Pascal 3. And a few are almost > not horribly embarrassing. > > I'd like to port them to fpc and write up the experience but I know > what

Re: [fpc-pascal] Does FPC require glibc?

2019-05-07 Thread Sven Barth via fpc-pascal
Michael Van Canneyt schrieb am Di., 7. Mai 2019, 08:32: > > > On Mon, 6 May 2019, Nozz via fpc-pascal wrote: > > > On Monday, May 6, 2019 10:48 PM, Sven Barth > wrote: > > > >> Nozz via fpc-pascal schrieb am Mo., > 6. Mai 2019, 22:18: > >> >

Re: [fpc-pascal] Does FPC require glibc?

2019-05-06 Thread Sven Barth via fpc-pascal
Am 07.05.2019 um 00:16 schrieb Nozz via fpc-pascal: On Monday, May 6, 2019 10:48 PM, Sven Barth wrote: Nozz via fpc-pascal <mailto:fpc-pascal@lists.freepascal.org>> schrieb am Mo., 6. Mai 2019, 22:18: Empty Message Depends on what you're using (and the platform). E.g. the

Re: [fpc-pascal] Does FPC require glibc?

2019-05-06 Thread Sven Barth via fpc-pascal
Nozz via fpc-pascal schrieb am Mo., 6. Mai 2019, 22:18: > Empty Message > Depends on what you're using (and the platform). E.g. the compiler itself runs without glibc on Linux, but if you need to use threads for example that changes. Also if you link against libraries like GTK or Qt you also

Re: [fpc-pascal] Improve message "Wrong ppu found"

2019-04-27 Thread Sven Barth via fpc-pascal
leledumbo via fpc-pascal schrieb am Sa., 27. Apr. 2019, 15:14: > > Please provide a real example of a compiler output, cause I can't find > "Wrong ppu found" in the sources. > > I think what he meant is: > > $ grep -i 'wrong ppu version' -r * > pkgutil.pas: Comment(V_Error,'Wrong PPU

Re: [fpc-pascal] TThread.OnTerminate never called

2019-04-26 Thread Sven Barth via fpc-pascal
Dennis schrieb am Sa., 27. Apr. 2019, 05:22: > > > Sven Barth via fpc-pascal wrote: > > Am 21.04.2019 um 18:22 schrieb Dennis: > >> I am using FPC 3.0.4 Lazarus 2.00 on windows 64 > >> > >> I created a subclass of TThread and found out that the > >

Re: [fpc-pascal] Improve message "Wrong ppu found"

2019-04-26 Thread Sven Barth via fpc-pascal
Am 24.04.2019 um 10:14 schrieb Alexey Tor.: Suggestion: in the message $subj, can you add FPC version of that PPU? so it will be "Wrong PPU found [FPC 2.7.8]" when FPC needs PPU for 3.2.0. Please provide a real example of a compiler output, cause I can't find "Wrong ppu found" in the sources.

Re: [fpc-pascal] TThread.OnTerminate never called

2019-04-26 Thread Sven Barth via fpc-pascal
Am 21.04.2019 um 18:22 schrieb Dennis: I am using FPC 3.0.4 Lazarus 2.00 on windows 64 I created a subclass of TThread and found out that the TThread.OnTerminate event was never called (I already assigned it). Also, I search the source code of TThread in classeh.inc and found that there was

Re: [fpc-pascal] fpc 3.2: "Declaration of type TTypeList changed"

2019-04-26 Thread Sven Barth via fpc-pascal
Am 25.04.2019 um 22:23 schrieb Luca Olivetti: Hello, as per the subject, I've been bitten by this change: http://wiki.freepascal.org/User_Changes_Trunk#Declaration_of_type_TTypeList_changed This code (FTasks is a specialization of TFPGList)   for i:=0 to FTasks.Count-1 do   begin    

Re: [fpc-pascal] class operator enumerator

2019-04-24 Thread Sven Barth via fpc-pascal
Am 24.04.2019 um 15:31 schrieb Ryan Joseph: On Apr 24, 2019, at 12:30 AM, Ben Grasset wrote: Seems like it's mixed up in some way with the FPC-style enumerator operator, so the "class" version is recognized but not actually implemented currently or something. The normal way for

Re: [fpc-pascal] Record helper properties

2019-04-24 Thread Sven Barth via fpc-pascal
Am 24.04.2019 um 15:28 schrieb Ryan Joseph: On Apr 24, 2019, at 2:27 AM, Michael Van Canneyt wrote: I would think this should be allowed, yes. I see no reason to disallow it. Agreed but Sven says something about published fields though. The property just acts as simple alias so I don’t

Re: [fpc-pascal] Record helper properties

2019-04-23 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Di., 23. Apr. 2019, 21:54: > So I remember now that any fields are not allowed in helpers. Can anyone > explain why this must be the case or if it could be fixed? > A helper can not access its extended type in its interface, only in its implementation (and yes, this gets

Re: [fpc-pascal] Resolving math expression as input from user

2019-04-23 Thread Sven Barth via fpc-pascal
Am 23.04.2019 um 12:04 schrieb James Richters: I'm trying to figure out if there is some function available that would take a string as input and return a double value that is the complete evaluation of the string? So when asked for a numeric input, the user could just put in a number like

Re: [fpc-pascal] how to customize so Pandroid would be usable from Lazarus for windows

2019-04-18 Thread Sven Barth via fpc-pascal
Am 18.04.2019 um 12:46 schrieb Tomas Hajny: On Thu, April 18, 2019 12:32, Mgr. Janusz Chmiel wrote: . . I have also started to transform build.sh to Windows batch file. Which issues AM I facingnow? . . echo ppcjvm -

Re: [fpc-pascal] Really Strange Speed Problems - FPC & Neural Networks

2019-04-17 Thread Sven Barth via fpc-pascal
Am 17.04.2019 um 10:01 schrieb Joao Schuler: Hello, It's better not to reply to an existing mail with a completely new topic, cause now your mail is burrowed deep in the "Lazarus Release 2.0.2" thread. Better write directly to the list without replying. Regards, Sven

Re: [fpc-pascal] Lazarus Release 2.0.2 - suggestions

2019-04-16 Thread Sven Barth via fpc-pascal
Rainer Stratmann schrieb am Di., 16. Apr. 2019, 13:47: > Are there plans to merge some windows? > > Like here (best solution): > https://cdn.portableapps.com/GeanyPortable.png > > Because I think it is no more up to date. > I don't know any other Software that uses so many windows across the

Re: [fpc-pascal] Can FPC optimize: if (s[i]='a') or ...

2019-04-15 Thread Sven Barth via fpc-pascal
Am 15.04.2019 um 09:06 schrieb Bernd Oppolzer: Am 15.04.2019 um 08:29 schrieb Tomas Hajny: On Mon, April 15, 2019 07:52, Bernd Oppolzer wrote:   .   . On Samstag, 13. April 2019 22:30:55 CEST Alexey Tor. wrote:   .   . Can FPC optimize it so it only reads s[i] once (to register), not 3

Re: [fpc-pascal] Optional param modifier

2019-04-15 Thread Sven Barth via fpc-pascal
Am 14.04.2019 um 23:48 schrieb Martin Frb: As for "documentation". I disagree with the way it is done in oxygen. But I am not sure I have any good alternative. For me a class contract (require/ensure) is part of the interface. So it would have to be like (and similar for plain procedures, no

Re: [fpc-pascal] Optional param modifier

2019-04-15 Thread Sven Barth via fpc-pascal
Am 15.04.2019 um 01:19 schrieb Ryan Joseph: On Apr 14, 2019, at 7:08 PM, Martin Frb wrote: Almost. assert takes the condition itself assert(condition_that_must_be_true, 'error message') so it would be assert(name<>'', 'requires "name <> " failed for CreateHero'); You can already

Re: [fpc-pascal] Optional param modifier

2019-04-14 Thread Sven Barth via fpc-pascal
Am 14.04.2019 um 16:05 schrieb Ryan Joseph: On Apr 14, 2019, at 3:15 AM, Sven Barth via fpc-pascal wrote: Your idea requires exceptions as well. The compiler is not capable checking whether valid entries are passed in at compile time except for simple, constant cases, so runtime checks

Re: [fpc-pascal] mode switch madness

2019-04-14 Thread Sven Barth via fpc-pascal
Am 14.04.2019 um 17:03 schrieb Ryan Joseph: On Apr 13, 2019, at 10:07 PM, Ben Grasset wrote: E.G, I sincerely doubt that anybody has *ever* thought, "man, I sure am glad that {$mode ObjFPC} does not allowed advanced records. It would be specifically bad if it did!" because it just doesn't

Re: [fpc-pascal] mode switch madness

2019-04-14 Thread Sven Barth via fpc-pascal
Am 14.04.2019 um 04:07 schrieb Ben Grasset: I dunno about setting them globally, but generally I do find modeswitches rather annoying, as the combination of features is pretty arbitrary, and they mostly just *disallow* things that couldn't break the code of people who weren't using those

Re: [fpc-pascal] Optional param modifier

2019-04-14 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am So., 14. Apr. 2019, 00:17: > > > > On Apr 13, 2019, at 6:01 PM, Sven Barth via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > Well, there is Oxygene's concept of Class Contracts (see > > https://docs.elementscomp

Re: [fpc-pascal] Optional param modifier

2019-04-13 Thread Sven Barth via fpc-pascal
On 4/13/19 11:39 PM, Martin Frb wrote: > On 13/04/2019 23:17, Ryan Joseph wrote: >> If there was any other way the compiler could make this contract more >> concrete and reliable then comments I’d be happy to hear it. > > I don't know what others think of it, but >

Re: [fpc-pascal] Optional param modifier

2019-04-13 Thread Sven Barth via fpc-pascal
Marco van de Voort schrieb am Fr., 12. Apr. 2019, 20:56: > > Op 2019-04-12 om 17:23 schreef Ryan Joseph: > > > > What do you think of that? Sounds like an easy way to get some support > for nil pointers deref’s and provides self documenting code. > > I think the same as when I read the

Re: [fpc-pascal] mode switch madness

2019-04-12 Thread Sven Barth via fpc-pascal
Ryan Joseph schrieb am Fr., 12. Apr. 2019, 16:37: > > > > On Apr 12, 2019, at 10:15 AM, Michael Van Canneyt < > mich...@freepascal.org> wrote: > > > > That would break with the rule that directives do not cross unit > boundaries. > > It has far-reaching consequences. > > > > Better introduce a

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