Re: [fpc-pascal] Very odd case parsing problem

2013-12-29 Thread Martin Frb
On 29/12/2013 07:33, Mark Morgan Lloyd wrote: Saunders, Rich wrote: On 2013-12-28 15:47, Mark Morgan Lloyd wrote: quit_: if High(lexemeListArray) = 1 then begin end; nop: begin end else Drat- a dangling else in a case! I should have spotte

Re: [fpc-pascal] Very odd case parsing problem

2013-12-29 Thread Martin Frb
On 29/12/2013 16:37, Sven Barth wrote: Does Lazarus recognize "otherwise" as an alternative for "else" inside a "case"-statement as well? Not yet ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinf

Re: [fpc-pascal] Very odd case parsing problem

2013-12-29 Thread Martin Frb
On 29/12/2013 17:08, Martin Frb wrote: On 29/12/2013 16:37, Sven Barth wrote: Does Lazarus recognize "otherwise" as an alternative for "else" inside a "case"-statement as well? Not yet Now 1.3 does ___ fpc-

[fpc-pascal] overload question (variant vs enum subrange)

2014-01-26 Thread Martin Frb
TFoo1 is a sub range of FFoo And it seems to match both TFoo and variant. project1.lpr(24,3) Error: Can't determine which overloaded function to call project1.lpr(15,11) Hint: Found declaration: Bar(TFoo); project1.lpr(11,11) Hint: Found declaration: Bar(Variant); No other type seems to be

Re: [fpc-pascal] overload question (variant vs enum subrange)

2014-02-02 Thread Martin Frb
Anybody? Is this designed? Or is this a bug? Shall I put it on Mantis? On 26/01/2014 19:48, Martin Frb wrote: TFoo1 is a sub range of FFoo And it seems to match both TFoo and variant. project1.lpr(24,3) Error: Can't determine which overloaded function to call project1.lpr(15,11)

Re: [fpc-pascal] weird compiler(?) problem

2014-02-13 Thread Martin Frb
On 13/02/2014 15:42, Xiangrong Fang wrote: Hi All, I encountered a very strange problem. The code looks like this: //In Unit1.pas: //sel is an object of TIntVector and //TIntVector = specialize TVector *sel.Sort([soEliminateNA, soReversed]); * //In vector.pas: procedure TVector.Sort(Options

Re: [fpc-pascal] weird compiler(?) problem

2014-02-13 Thread Martin Frb
On 13/02/2014 16:36, Xiangrong Fang wrote: blue dots comes back after I switch back to O1... Sorry for the false alarm... but this seems a debugger problem in lazarus anyway... With -O2 and above the debugger does not always work. In case of such optimization the debug info compiled into t

Re: [fpc-pascal] weird compiler(?) problem

2014-02-13 Thread Martin Frb
On 14/02/2014 01:36, Xiangrong Fang wrote: Hi Martin, 2014-02-14 1:14 GMT+08:00 Martin Frb <mailto:laza...@mfriebe.de>>: With -O2 and above the debugger does not always work. In case of such optimization the debug info compiled into the exe by fpc is not always accurate

Re: [fpc-pascal] Dynamic arrays, yet another pitfall

2014-02-17 Thread Martin Frb
On 17/02/2014 16:40, Jürgen Hestermann wrote: Am 2014-02-17 10:38, schrieb Lukasz Sokol: > To 'write' usually means : changing DATA element(s). That's it. What else is it when adding or removing elements? The array is modified. That can only mean it was written to it. > SetLength is /not/ a

Re: [fpc-pascal] Dynamic arrays, yet another pitfall

2014-02-17 Thread Martin Frb
On 17/02/2014 16:40, Jürgen Hestermann wrote: But changing the size it is a modification! When an array can be resized then the resizing means that I have to write to it (in contrast to reading, where no data is modified). I am astonished that everybody here seems not to see this. Maybe becau

Re: [fpc-pascal] Dynamic arrays, yet another pitfall

2014-02-17 Thread Martin Frb
On 17/02/2014 17:28, Jürgen Hestermann wrote: Am 2014-02-17 18:01, schrieb Martin Frb: > On 17/02/2014 16:40, Jürgen Hestermann wrote: > It appears, that the copy-on-setlength is intended. So in that the documentation is right. It is intended but is was not mentioned in the documen

Re: [fpc-pascal] Dynamic arrays, yet another pitfall

2014-02-17 Thread Martin Frb
On 17/02/2014 18:19, Jürgen Hestermann wrote: Am 2014-02-17 18:49, schrieb Martin Frb: Then why does this discussion continue, now that it is documented? Does it matter what other people consider a write and what not? (Unless that part made it into the docs, but there was no mention it did

Re: [fpc-pascal] Dynamic arrays, yet another pitfall

2014-02-17 Thread Martin Frb
On 17/02/2014 19:34, Marco van de Voort wrote: In our previous episode, Martin Frb said: Just because there is a function, that includes copying (when modifying the array), does not mean there is copy on write. So basically, if for a given size x, setlength(x,1) always reallocates, then it is

Re: [fpc-pascal] Dynamic arrays, yet another pitfall

2014-02-17 Thread Martin Frb
On 17/02/2014 19:50, Jonas Maebe wrote: On 17 Feb 2014, at 20:41, Martin Frb wrote: "Dynamic arrays have no copy-on-write. But SetLength perform a copy-on-write on dynamic arrays." I am not sure, if that makes to much sense either It doesn't, because even if you don't

Re: [fpc-pascal] Dynamic arrays, yet another pitfall

2014-02-17 Thread Martin Frb
On 17/02/2014 20:10, Florian Klämpfl wrote: Am 16.02.2014 17:16, schrieb Michael Van Canneyt: 2) SetLength enforces unique ref. count. I'am against stating this in the docs. It is an implementation detail. The proper way to do a deep copy is using copy. IMHO, it must be documented, even if it

Re: [fpc-pascal] RTL debuginfo on GDB 7.4+ and OSX Mavericks

2014-03-12 Thread Martin Frb
On 12/03/2014 11:27, Joao Morais wrote: However, RTL which I compiled with "-gl" doesn't show filenames, procnames and line numbers anymore in the heaptrc output or stacktraces. If I compile RTL with "-gl -gw", GDB crashes with the following messages. Using FPC_2_6 and Laz_1_2 from yesterday.

Re: [fpc-pascal] fpc in symlinked directory

2014-03-26 Thread Martin Frb
On 26/03/2014 14:30, Tomas Hajny wrote: It makes no sense to use absolute paths in debug information, because it would make distribution of units compiled with debug information to other machines impossible (or more precisely - it would be possible to distribute them, but debugging would not work

Re: [fpc-pascal] Free pascal candidate for project of the month

2014-04-01 Thread Martin Frb
On 26/03/2014 20:44, Marco van de Voort wrote: FYI: Free Pascal is candidate for SF project of the month april, up against strong candidates as subversion for windows (the server, not tortoise) and smplayer. Note that you need a SF login to vote: https://sourceforge.net/p/potm/discussion/vote/

Re: [fpc-pascal] lazarus not reachable

2014-04-06 Thread Martin Frb
On 06/04/2014 19:37, m...@rpzdesign.com wrote: Help: Would somebody from the USA and someone from Europe please run a tracert on their connection to: lazarus.freepascal.org. I am not able to reach anything lazarus but I can get freepascal. I want to ask a question in the lazarus list and sur

Re: [fpc-pascal] lazarus not reachable

2014-04-06 Thread Martin Frb
On 06/04/2014 22:44, m...@rpzdesign.com wrote: Martin: Can you translate what "lower MPU" means? Sorry a typo. MTU http://answers.microsoft.com/en-us/windows/forum/windows_7-networking/how-do-i-change-the-mtu-setting-in-windows-7/ec01f5d0-7082-4a9d-97b5-1d1dccb121d2 or google See here to fi

Re: [fpc-pascal] lazarus not reachable

2014-04-06 Thread Martin Frb
On 07/04/2014 03:52, m...@rpzdesign.com wrote: Well, I cannot subscribe to the lazarus mailing list and I can not enter the forums at forums.lazarus.freepascal.org or www.lazarus.freepascal.org because I can not make an http connection to either. Just keep timing out. FYI for list managers.

Re: [fpc-pascal] lazarus not reachable

2014-04-06 Thread Martin Frb
On 07/04/2014 03:52, m...@rpzdesign.com wrote: Well, I cannot subscribe to the lazarus mailing list and I can not enter the forums at forums.lazarus.freepascal.org or www.lazarus.freepascal.org because I can not make an http connection to either. You may be able, if your mail server can conn

Re: [fpc-pascal] Lazarus 1.2.2 Release

2014-04-24 Thread Martin Frb
On 24/04/2014 11:27, Mattias Gaertner wrote: On Thu, 24 Apr 2014 10:20:19 + (UTC) Virgo Pärna wrote: On Thu, 24 Apr 2014 12:04:14 +0200, Mattias Gaertner wrote: See the announcement: Windows x64 users: please use the 32 bit installer if possible. See http://wiki.lazarus.freepascal.org

Re: [fpc-pascal] Lazarus 1.2.2 Release

2014-04-24 Thread Martin Frb
On 24/04/2014 16:44, Mattias Gaertner wrote: It is not about the default download. When you manually select "Windows 64bit" you get the 32bit too. Ah I see. Need to see how much work it takes to fix the website, so it can deliver different urls for auto detect and manual selection. Also th

Re: [fpc-pascal] Lazarus 1.2.2 Release

2014-04-24 Thread Martin Frb
On 24/04/2014 17:19, Martin Frb wrote: On 24/04/2014 16:44, Mattias Gaertner wrote: It is not about the default download. When you manually select "Windows 64bit" you get the 32bit too. Ah I see. And the download for win 64 is the 32 bit IDE. Please note that (and that

Re: [fpc-pascal] Lazarus 1.2.2 Release

2014-04-25 Thread Martin Frb
On 25/04/2014 13:52, Krzysztof wrote: I noticed something weird in 1.2.2. When finishing debugging (by pressing Stop icon) codeeditor can't restore position cursor. I need to switch tab and back again and then it is ok. Kubuntu 14.04 64bit You mean it does not show the flashing (blinking) vert

Re: [fpc-pascal] Lazarus 1.2.2 Release

2014-04-25 Thread Martin Frb
On 25/04/2014 17:07, Krzysztof wrote: Cursor is not blinking. I don't know where it is Does the window have focus, can you type? Because when I press stop, then the window with the stop button (the main IDE bar) is focused. ANd yes in that case the caret (text cursor) is no blinking. If y

Re: [fpc-pascal] Create class descendant at runtime?

2014-04-29 Thread Martin Frb
On 29/04/2014 02:58, Craig Peterson wrote: Hi guys, Does Free Pascal or any of the included packages have a way to create a descendant of a class at runtime? Before anyone tells me it's a bad idea, I know. I have an existing class-based registration scheme that I'm adding some dynamically load

Re: [fpc-pascal] StrToDate bug?

2014-05-10 Thread Martin Frb
On 10/05/2014 13:55, Bart wrote: Hi, I'm using fpc 2.6.4. While i was playing a bit with issue http://bugs.freepascal.org/view.php?id=20522 I stmbled upon unexpected behaviour of StrToDate function. StrToDate('6-12-2011 ') (note the space at the end) actually gives me 6-12-2014. ... Could so

Re: [fpc-pascal] Can not cross compile from Win64 to Win32 using fpcup

2014-05-20 Thread Martin Frb
On 20/05/2014 09:28, Reinier Olislagers wrote: 7. Please help me to solve this. I think this can be fixed, because the Lazarus has its lazarus-1.2.2-fpc-2.6.4-cross-i386-win32-win64.exe, So can I? That's a cross compiler from 32 bit to 64 bit. I'd suggest doing the same with fpcup and using the

Re: [fpc-pascal] Debug information

2015-01-13 Thread Martin Frb
On 13/01/2015 14:40, Rainer Stratmann wrote: Can not get debug information -g -gl -gw switched on but no further information (line nr) is displayed when an error occured. -gl has a "feature" it prints the stack info, until it finds an address for which there is no stack info (e.g. in the r

Re: [fpc-pascal] character escaping with ^LETTER

2015-01-19 Thread Martin Frb
On 19/01/2015 13:17, Dmitry Boyarintsev wrote: CodeTools syntax highlighter won't recognize the syntax as characters either (delphi 7 highlighter doesn't recognize it as a character escaping as well) Add that to the bugtracker please (as synedit HL issue). It is probably easy to fix, sim

Re: [fpc-pascal] TThread.FreeOnTerminate

2018-12-13 Thread Martin Frb
On 13/12/2018 19:52, Yuriy Sydorov wrote: On 12/13/2018 1:06 PM, Martin wrote: Is there a way to use FreeOnTerminate other that setting it in the constructor (or before the thread starts / or in the rather complex manner below)? The doc does not mention any limitations https://www.freepascal

Re: [fpc-pascal] TThread.FreeOnTerminate

2018-12-14 Thread Martin Frb
On 14/12/2018 10:30, Michael Van Canneyt wrote: (or as Martin says, it should be documented as such?) This is a valid point and I intend to elaborate the TThread documentation somewhat, with this in mind. I did have an error in my initial example:   t := TThread.create(false); // create  no

Re: [fpc-pascal] SetLength warnings - request

2019-01-02 Thread Martin Frb
On 29/12/2018 22:35, Jonas Maebe wrote: 1) Dynamic arrays are initialised with nil, but that is an implementation detail (required by the fact that they are reference counted: if they would contain random data, that would cause crashes) Is it? Because according to https://www.freepascal.org

Re: [fpc-pascal] Question: Is there a global callback, when a thread gets terminated?

2019-02-05 Thread Martin Frb
On 04/02/2019 14:49, Michael Schnell wrote: Are threadvar variables being freed like regular managed vars Threadvars are not freed at all. They are like global vars, only that each running thread automatically has its own copy. Yes, I know this. (did my google). Even managed vars are not rele

Re: [fpc-pascal] Question: Is there a global callback, when a thread gets terminated?

2019-02-07 Thread Martin Frb
On 06/02/2019 11:32, Michael Schnell wrote: Anything else? Maybe the other thread could set a callback event property provided by the TThread sibling with a function it defines, and the thread that is associated with the TThread sibling calls this property in it's OnTerminate handler. There

Re: [fpc-pascal] Question: Is there a global callback, when a thread gets terminated?

2019-02-08 Thread Martin Frb
many short lived threads. 07.02.2019, 15:17, "Martin Frb" : As for the question, why create an object, why not just "threadvar indent". User code can create (within the same thread) more than one instance of the logger. This I something that can be used in testcase, where the

Re: [fpc-pascal] Question: Is there a global callback, when a thread gets terminated?

2019-02-10 Thread Martin Frb
On 08/02/2019 10:09, Michael Schnell wrote: There are no "siblings". The use case here would be LazLogger. User code can call a function "Debugln" this calls a method on a global object. The object provides storage for log-level (by name), and indentation, and others. So the logger software c

Re: [fpc-pascal] Question: Is there a global callback, when a thread gets terminated?

2019-02-12 Thread Martin Frb
On 11/02/2019 11:21, Michael Schnell wrote: Yes, but how do I get notified, when the thread is gone, and I can free the memory (of the object that was created)? Ah, now I finally see the problem :) The only idea that comes in my mind is creating yet another thread or a TTimer (by means of "Que

Re: [fpc-pascal] Question: Is there a global callback, when a thread gets terminated?

2019-02-12 Thread Martin Frb
On 12/02/2019 16:56, Marc Santhoff wrote: ".DeregisterThread()" method. So you now the threads and their lifetime inside the logger. Yes, I wanted to avoid that. Put as little on the user as possible. The user may use some THttpRequest.OnProgress which may be in a thread, but the user does no

Re: [fpc-pascal] Question: Is there a global callback, when a thread gets terminated?

2019-02-12 Thread Martin Frb
On 12/02/2019 19:46, Marc Santhoff wrote: On Tue, 2019-02-12 at 17:36 +0100, Sven Barth via fpc-pascal wrote: Not every LazLogger user knows that their code is run in a thread. And not every thread user knows that the code they are using is using LazLogger in turn. Ok. But if used that way, w

Re: [fpc-pascal] Need Advice: Teaching a Child Programming

2019-03-06 Thread Martin Frb
On 06/03/2019 20:04, Anthony Walter wrote: How does this sound to you guys? Like a good deal of work. - Adding a menu, and a form in a new package are trivial. - Storing your settings - Make an encrypted connection - The main bit of work: SourceEditorInteface allows you to be notified of chan

Re: [fpc-pascal] Need Advice: Teaching a Child Programming

2019-03-06 Thread Martin Frb
On 06/03/2019 20:26, Martin Frb wrote: On 06/03/2019 20:04, Anthony Walter wrote: How does this sound to you guys? Like a good deal of work. - Adding a menu, and a form in a new package are trivial. - Storing your settings - Make an encrypted connection - The main bit of work

Re: [fpc-pascal] Need Advice: Teaching a Child Programming

2019-03-06 Thread Martin Frb
I cc / reply-to the Lazarus list, since this is not an fpc topic. On 06/03/2019 20:49, Anthony Walter wrote: I agree that the hardest part would be detecting project changes. That is files opened, new files added, packages added or removed and so on. I think if I could or someone could write so

Re: [fpc-pascal] Optional param modifier

2019-04-13 Thread Martin Frb
On 13/04/2019 18:40, Benito van der Zander wrote: Hi, the parameter is already optional without any modifier, since you can always pass nil for it. Perhaps there could be the opposite modifier, so the function cannot be called with nil. Like procedure DoThis(nonnil var obj: TObject); and t

Re: [fpc-pascal] Optional param modifier

2019-04-13 Thread Martin Frb
On 13/04/2019 19:04, Ryan Joseph wrote: Ok, here’s a historic real work example which is all too common: int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine) (void *), void *arg); Can you pass null for attr? Well you need to read the man page and read th

Re: [fpc-pascal] Optional param modifier

2019-04-13 Thread Martin Frb
On 13/04/2019 21:07, Ryan Joseph wrote: Already today the author could add a comment (even pasdoc) to the declaration. And it serves the same effect. Sure, if it’s not used then it’s not very helpful. :) Comments are the same effect? Then why not prefer comments for “const” params or even pu

Re: [fpc-pascal] Optional param modifier

2019-04-13 Thread Martin Frb
On 13/04/2019 22:34, Ryan Joseph wrote: I can find many hundreds of examples like the one above in the Cocoa frameworks since Apple retroactively added them in. I don’t understand why you think this is a minor subset of cases. That "minor set" referred to compiler warnings you get, inside a f

Re: [fpc-pascal] Optional param modifier

2019-04-13 Thread Martin Frb
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 https://en.wikipedia.org/wiki/Design_by_contract look at pre/post-conditions. It

Re: [fpc-pascal] Optional param modifier

2019-04-13 Thread Martin Frb
On 14/04/2019 00:01, Sven Barth via fpc-pascal wrote: Well, there is Oxygene's concept of Class Contracts (see https://docs.elementscompiler.com/Concepts/ClassContracts/ ), so if anything in that direction would be done I'd be inclined towards their syntax (and I've played with the idea to imple

Re: [fpc-pascal] Optional param modifier

2019-04-14 Thread Martin Frb
On 14/04/2019 16:05, Ryan Joseph wrote: 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 are neede

Re: [fpc-pascal] Optional param modifier

2019-04-14 Thread Martin Frb
On 14/04/2019 18:04, Martin Frb wrote: On 14/04/2019 16:05, Ryan Joseph wrote: 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

Re: [fpc-pascal] Optional param modifier

2019-04-14 Thread Martin Frb
On 14/04/2019 19:53, Ryan Joseph wrote: On Apr 14, 2019, at 1:38 PM, Sven Barth via fpc-pascal wrote: As already said by Martin: the compiler *can not* determine all cases whether the parameter is Nil or not, so it *must* be done at runtime to ensure this. Otherwise the feature is just as

Re: [fpc-pascal] Optional param modifier

2019-04-14 Thread Martin Frb
On 14/04/2019 22:08, Ryan Joseph wrote: Per my example, currently we know that GetThing() COULD return nil so unless we know what the function does by reading the documentation or looking at the implementation we need to test for nil. Right? I suggest the modifier simply to enforce that check

Re: [fpc-pascal] Optional param modifier

2019-04-14 Thread Martin Frb
On 14/04/2019 23:48, Martin Frb wrote: I admit the contract/assert stuff may have made it seem different. But that is because this approach does not hold up (IMHO). And therefore the closest alternative was presented. In the very end it is to avoid crashing on nil de-ref. And the contract

Re: [fpc-pascal] Optional param modifier

2019-04-14 Thread Martin Frb
On 14/04/2019 22:08, Ryan Joseph wrote: function FindThing: TThing; optional; means you MUST check for nil. If the value is nil that’s not an error. “optional” is probably a bad name for this I know. function MakeThing: TThing; this means maybe check for nil or maybe not check

Re: [fpc-pascal] Optional param modifier

2019-04-14 Thread Martin Frb
On 15/04/2019 00:53, Ryan Joseph wrote: Here’s what I imagine that would look like: procedure CreateHero (name: string; hp: integer); requires name <> ''; (hp > 0) and (hp < 100); begin // compilers parses the conditions and inserts as if statements: // if name <> ‘’ then // as

Re: [fpc-pascal] Optional param modifier

2019-04-14 Thread Martin Frb
On 15/04/2019 01:19, Ryan Joseph wrote: 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 <> ''

[fpc-pascal] class contracts [[was: Re: Optional param modifier]]

2019-04-15 Thread Martin Frb
On 15/04/2019 09:41, Sven Barth via fpc-pascal wrote: Am 14.04.2019 um 23:48 schrieb Martin Frb: type   TFoo= class function DoTheFooThing(Foo1, Foo2: TFoo): Tbar;     requires    assigned(Foo1) or assigned(Foo2): 'Need at least 1 foo, for the connection';    

Re: [fpc-pascal] class contracts [[was: Re: Optional param modifier]]

2019-04-15 Thread Martin Frb
On 15/04/2019 09:41, Sven Barth via fpc-pascal wrote: 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.

[fpc-pascal] MacOS wrong timestamp in debug map object file

2019-04-15 Thread Martin Frb
I don't know the Mac well enough... What could cause the below? From https://forum.lazarus.freepascal.org/index.php/topic,44950.msg317604.html#msg317604 The logfile tells that the units have been compiled right before lldb was launched. So the date 15.4 should be correct. LLDB complains error

Re: [fpc-pascal] Lazarus Release 2.0.2 - suggestions (screen reader)

2019-04-16 Thread Martin Frb
About ctrl+shift+arrow key: Do you know any documentation on how to implement this. What API to call, to let the screen reader know? Also for other modifications needed, any documentation? -- On 16/04/2019 14:31, Mgr. Janusz Chmiel wrote: For now, I would like to thank you, that you have allow

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

2019-04-16 Thread Martin Frb
On 16/04/2019 22:03, Ralf Quint wrote: Schwachfug. (Bollocks for the Anglophiles around here) And for those with American English: B*S* But I really dont see where to put 2nd, let alone a 3rd  50 inch screen. ;) ;) ;) ... not (unfortunately) SCNR ___

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

2019-04-16 Thread Martin Frb
On 16/04/2019 22:17, Ralf Quint wrote: On 4/16/2019 1:11 PM, Martin Frb wrote: On 16/04/2019 22:03, Ralf Quint wrote: Schwachfug. (Bollocks for the Anglophiles around here) And for those with American English: B*S* But I really dont see where to put 2nd, let alone a 3rd  50 inch screen

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

2019-07-08 Thread Martin Frb
On 08/07/2019 14:09, James Richters wrote: I'm on windows Generics.Collections seems to be something that was added after 3.0.4, I've downloaded the current FPC source code, but I’m not sure how to build it.. can someone point me in the right direction on how to compile the current source

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

2019-07-08 Thread Martin Frb
On 08/07/2019 14:09, James Richters wrote: I'm on windows Generics.Collections seems to be something that was added after 3.0.4, I've downloaded the current FPC source code, but I’m not sure how to build it.. can someone point me in the right direction on how to compile the current source

Re: [fpc-pascal] Very vague gettickcount64 description?

2019-09-07 Thread Martin Frb
On 07/09/2019 21:42, Zoe Peterson wrote: GetTickCount and GetTickCount64 are Windows API functions that are explicitly documented as returning milliseconds, and FPC on Unix up to now is has matched that. Why in the world would you think that changing that behavior would be a good idea, *especiall

Re: [fpc-pascal] Very vague gettickcount64 description?

2019-09-07 Thread Martin Frb
On 08/09/2019 02:07, Alexander Grotewohl wrote: but the resolution is not a ms at all. every call to gettickcount is something like 10-15ms or so off. you'd be lucky to call it a ms after it was updated by the os. do we document that too? As I said: "The minimum resolution may vary, and may be

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

2020-02-01 Thread Martin Frb
On 02/02/2020 04:22, fredvs via fpc-pascal wrote: Hello everybody. Good time to go back with that problem and fix it forever the right way! The problem is isolated and is fixed "hardcoded". From rev 42375, in msegui function dynarrayelesize(const typinfo: pdynarraytypeinfo): sizeint; inline; t

Re: [fpc-pascal] Prevent full unit path in ppu files? together with -Ur

2020-04-12 Thread Martin Frb
On 12/04/2020 16:31, Martin wrote: When building packages for an installer, one uses -Ur. Yet (on Windows) I noted, that the ppu contain the full path to the source file used to build that ppu. Not a major issue, but slightly awkward. - The files (ppu, and maybe sources) will be packed into a

Re: [fpc-pascal] Debug-Adapter-Protocol support for fpDebug

2020-04-25 Thread Martin Frb
On 23/04/2020 22:10, Joost van der Sluis wrote: But maybe it should become a separate package now. Lazarus can use is as a dependency. We'll see. That would then reverse the burden As it is part of bigide, it must be shipped with the installer. And also having it in the Lazarus repro means

Re: [fpc-pascal] Debug-Adapter-Protocol support for fpDebug

2020-04-25 Thread Martin Frb
On 25/04/2020 16:07, Ryan Joseph via fpc-pascal wrote: On Apr 24, 2020, at 3:10 AM, Joost van der Sluis wrote: I'm working on the support of the debug-adapter-protocol for fpDebug. It's quite easy to implement, as there already is a json-based tcp/ip interface. (https://microsoft.github.io/

Re: [fpc-pascal] Debug-Adapter-Protocol support for fpDebug

2020-04-26 Thread Martin Frb
On 26/04/2020 20:58, Mattias Gaertner via fpc-pascal wrote: On Sat, 25 Apr 2020 15:49:30 +0200 Martin Frb wrote: On 23/04/2020 22:10, Joost van der Sluis wrote: But maybe it should become a separate package now. Lazarus can use is as a dependency. We'll see. That would then revers

Re: [fpc-pascal] fpDebug extension for Visual Studio Code

2020-05-18 Thread Martin Frb
On 18/05/2020 23:43, Joost van der Sluis wrote: All the basics should work, if someone could test it a bit that would be nice. Threading-support is still very lacking, and how variables are presented is not really nice. I'll be working on that. While this can be changed in PascalBuilder, the

Re: [fpc-pascal] fpDebug extension for Visual Studio Code

2020-05-19 Thread Martin Frb
On 19/05/2020 10:42, Joost van der Sluis wrote: Yes, you write about it earlier. Now it's time to discuss things. Looking at the DAB-protocol I came to some new insights. Microsoft managed to create a simple interface which makes it possible for all kinds of debuggers to work with the same GU

Re: [fpc-pascal] fpDebug extension for Visual Studio Code

2020-05-19 Thread Martin Frb
On 19/05/2020 12:59, Martin Frb wrote: Where is that documented? Assuming this is part of the API? The closest I could find: https://microsoft.github.io/debug-adapter-protocol/specification#Types_Variable I would much prefer if "Flags: TStringArray" could be a "set of (...)&qu

Re: [fpc-pascal] fpDebug extension for Visual Studio Code

2020-05-19 Thread Martin Frb
On 19/05/2020 15:55, Joost van der Sluis wrote: On 5/19/20 12:59 PM, Martin Frb wrote: Where is that documented? Assuming this is part of the API? E.g. what goes into Flags/AdditionalInfo? You misunderstood me. The class above is my own design. The variable-definition of DAB is even simpler

Re: [fpc-pascal] fpDebug extension for Visual Studio Code

2020-05-20 Thread Martin Frb
On 20/05/2020 17:50, Joost van der Sluis wrote: I was very disappointed when i (re?)-discovered that fpDebug has a dependency on DebuggerIntf. It is a bit of a catch22: - On the one hand, FpDebug is/should be stand alone. - On the other hand, it would be a pity to have to copy all the used types

Re: [fpc-pascal] fpDebug extension for Visual Studio Code

2020-05-20 Thread Martin Frb
On 20/05/2020 19:54, Martin Frb wrote: If you look at using FpDebug directly, then you use TFpValue. (returned by PascalParser, or any Parser you want to add) All you need is to encapsulate PascalBuilder into a class. And stick the value and the builder into yet another object, holding both of

Re: [fpc-pascal] fpDebug extension for Visual Studio Code

2020-05-20 Thread Martin Frb
Ok, here are some of my ideas/hopes/dreams/wishes for the IDE They are all "ideas only", with on knowledge of when/if they may be done. I provide them, in the hope they will help choosing a path for the backend. The IDE should receive a "TWatchWhateverValue" from any of the backend, that pr

Re: [fpc-pascal] FpDebug hands-on: AnsiStrings

2020-05-21 Thread Martin Frb
On 21/05/2020 17:29, Joost van der Sluis wrote: I've added codepage-support for ansistrings, compiled with -gw3. This is done in the TFpValueDwarfV3FreePascalString class, which does the heavy work regarding the formatting of strings. Although there is also some code in TFpDebugDebugger.Evaluat

Re: [fpc-pascal] FpDebug hands-on: AnsiStrings

2020-05-21 Thread Martin Frb
On 21/05/2020 20:19, Joost van der Sluis wrote: Might be, you could see this as a saveguard. But my goal is to cut-out the middle part of the string. That's formatting Well, we should have the safeguard. And make it configurable. ... See below Part 2 is formatting related  In most cases

[fpc-pascal] properties // Re: fpDebug function-call proof-of-concept

2020-07-07 Thread Martin Frb
On 07/07/2020 15:04, Joost van der Sluis wrote: Op 07-07-2020 om 12:41 schreef Christo Crause via fpc-pascal: Great news! I guess this is a step towards evaluating object properties via get methods? That is the final goal, yes. For this, we will need to start looking at improving the DWAR

Re: [fpc-pascal] How to implement a circular buffer object in pascal?

2020-09-03 Thread Martin Frb via fpc-pascal
On 03/09/2020 10:09, Bo Berglund via fpc-pascal wrote: I would like to create a buffer into which a thread can push incoming data and the main thread can extract it for processing. Data are coming from the serial port in a worker thread and should be consumed by the main thread. The data is a byt

Re: [fpc-pascal] How to implement a circular buffer object in pascal?

2020-09-03 Thread Martin Frb via fpc-pascal
On 03/09/2020 14:54, Bo Berglund via fpc-pascal wrote: Now to my question: Is there some *example* around for using TLazThreadedQueue as a circular buffer? In the examples dir are only examples for LazUnicode and LookUpStringList... And when reading the sources I cannot really say I understand wh

Re: [fpc-pascal] How to implement a circular buffer object in pascal?

2020-09-03 Thread Martin Frb via fpc-pascal
On 03/09/2020 16:36, Bo Berglund via fpc-pascal wrote: A "simplest case" usage example would be nice to have. True. Once you got enough info from this thread, please write one. I still when looking at the sources have no clue as to how it would be used... It seems to me like at the very least

Re: [fpc-pascal] How to implement a circular buffer object in pascal?

2020-09-03 Thread Martin Frb via fpc-pascal
On 03/09/2020 17:44, Martin Frb via fpc-pascal wrote: type   TMyData = class       FData: array of byte;    end;   TMyThreadedQueue = specialize TLazThreadedQueue; Of course you can do   TMyData = array of byte;  // or record end if you want   TMyThreadedQueue = specialize

[fpc-pascal] Off topic Re: TurboVision is reborn as FOSS (again)

2020-12-22 Thread Martin Frb via fpc-pascal
On 21/12/2020 10:26, Markus Greim via fpc-pascal wrote: Hello Nikolay, I am a German - so may be we are both "lost in translation" Sent from Front English and German tenses are very much alike. Except for English having the progressive forms, which do not exist in German (...ing form) past p

Re: [fpc-pascal] GetClipboardFormatName causing an Error 216

2020-12-30 Thread Martin Frb via fpc-pascal
On 31/12/2020 01:09, James Richters via fpc-pascal wrote: I'm trying to write a programs to get data from the windows clipboard that was put into it with Notepad++ using vertical editing. Just for Info, SynEdit (trunk) can handle notepad++ column selection See the code at. There are 2 common f

Re: [fpc-pascal] GetClipboardFormatName causing an Error 216

2020-12-30 Thread Martin Frb via fpc-pascal
On 31/12/2020 01:09, James Richters via fpc-pascal wrote: Var FN : LPTSTR; Begin FN:=''; Writeln(Format_ID); GetClipboardFormatName(Format_Id,FN,250); Check the msdn help. https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuse

Re: [fpc-pascal] GetClipboardFormatName causing an Error 216

2020-12-30 Thread Martin Frb via fpc-pascal
I missed you have FN:=StrAlloc (255); in that case see Alexanders response. On 31/12/2020 02:00, Martin Frb via fpc-pascal wrote: FN must point to an existing buffer (allocated mem) that receives the result. FN : Array [0..255]of Byte; GotLen := GetClipboardFormatName(Format_Id, LPTSTR(@FN

Re: [fpc-pascal] GetClipboardFormatName causing an Error 216

2020-12-31 Thread Martin Frb via fpc-pascal
On 31/12/2020 18:11, James Richters via fpc-pascal wrote: Thanks for the info on SynEdit. Where can I find the synedit source related to the clipboard? I think the link you indtended ater 'See the code at.' Didn't come though, can you pleaese send it again? Sorry, I assumed SynEdit would be

Re: [fpc-pascal] Traits Proposal

2021-02-10 Thread Martin Frb via fpc-pascal
On 10/02/2021 16:59, Ryan Joseph via fpc-pascal wrote: • PHP (trait): https://www.php.net/manual/en/language.oop5.traits.php The example exposes another aspect: |trait SayWorld { public function sayHello() { parent::sayHello();| |In this case the trait has access to the object/class in

Re: [fpc-pascal] Traits Proposal

2021-02-10 Thread Martin Frb via fpc-pascal
On 10/02/2021 20:17, Ryan Joseph via fpc-pascal wrote: On Feb 10, 2021, at 11:09 AM, Ryan Joseph wrote: type TSomeTrait = trait public parent: TObject; procedure DoThis; end; procedure TSomeTrait .DoThis; begin // ??? here is our issue. Is this good enough to call the TBaseC

Re: [fpc-pascal] Traits Proposal

2021-02-10 Thread Martin Frb via fpc-pascal
On 10/02/2021 21:17, Ryan Joseph via fpc-pascal wrote: On Feb 10, 2021, at 12:40 PM, Martin Frb via fpc-pascal wrote: type TSomeTrait = trait public procedure DoTraitFoo; end; TSomeClass = class(TObject) private trait: TSomeTrait; // whatever syntax is used so that

Re: [fpc-pascal] Traits Proposal

2021-02-10 Thread Martin Frb via fpc-pascal
On 11/02/2021 03:07, Ryan Joseph via fpc-pascal wrote: We get the shared namespace So basically, we get the compiler to automatically create forwarder methods for us (or at least that behaviour). And that is all there is. right? In that case IIRC, it was said traits are not allowed construct

Re: [fpc-pascal] Traits Proposal

2021-02-10 Thread Martin Frb via fpc-pascal
On 11/02/2021 04:20, Ryan Joseph via fpc-pascal wrote: On Feb 10, 2021, at 7:47 PM, Martin Frb via fpc-pascal wrote: I understand it is for conflict resolution only. But see my example => as soon as you need to repeat a trait with just a change in name, you always need conflict resolut

Re: [fpc-pascal] Traits Proposal

2021-02-10 Thread Martin Frb via fpc-pascal
On 11/02/2021 04:13, Ryan Joseph via fpc-pascal wrote: On Feb 10, 2021, at 7:47 PM, Martin Frb via fpc-pascal wrote: In that case IIRC, it was said traits are not allowed constructors. Why? Traits are meant to be a way to import fields/methods and is based off of "object" (so i

Re: [fpc-pascal] Windows Defender considers fp.exe a malicious program

2021-02-12 Thread Martin Frb via fpc-pascal
On 12/02/2021 22:48, James Richters via fpc-pascal wrote: I have no idea how to register a legitimate program as not having a virus. I've had this issue before but managed to track down the section of code that caused it... after a completely exhaustive search. Anti virus providers normal

  1   2   >