![]() I hope I do not become a pest but I have may more problems, I am getting back into programming after a break, my last medium was Delphi, Lazarus seems to be more top heavy. This has been the longest debug episode since 1985 when I had a problem with 9k of 8085 Assembler code written by someone who did NOT believe in commenting code! NOW, in use, the dot will will be in the temp position for less than one second, but using the incMillisecond parameter solved that so I cannot see were you declare USE dateutils, but I addded it to mine. I believe that the GetTickCount must use some time, but It should NOT prevent the dot being displayed first, that aside, your code does work If you need milliseconds, there is also a incMilliseconds() function in the dateutils unit. procedure TForm1.Button1Click(Sender: TObject) ĮndTime := IncSecond(Now,1) // from unit dateutils, add one second to nowĪnother advantage is that this approach will not freeze or lock your application because we use "application.ProcessMessages " in the loop. I'm using InSecond() from the dateutils unit. So I went a different route, since I suspect GetTickCount is gobbling up some of the time needed to update the position of Shape2. In your code, if I would experience the same issue, I'd do this: procedure TForm1.Button1Click(Sender: TObject) Īpplication.ProcessMessages // Del_Dot_Wait īut I noticed this didn't seem to make a difference either. What I often do, while testing such odd behavior, is add an "Application.ProcessMessages " in one or more places. Not sure what OS you're working with or what version of Lazarus/FPC. Start_Time, Inter_Time, Lapse_time, Del_Dot_Wait : qword Īnd I'm seeing the same thing you're seeing on my machine (running MacOS Mojave 10.14.5, Lazarus 2.1.0 r61305M FPC 3.0.4 x86_64-darwin-cocoa (alpha) - so from trunk/svn). Procedure TForm1.Button1Click(Sender: TObject) unit Unit1 Ĭlasses, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls but I love tinkering with Lazarus PascalĪs for your code I did a test with a slightly modified code since I was missing a few things (always a good idea to upload a small demo/test project). The "backing" field of a property is almost always private, since the idea of a property is to encapsulate all outside access to it.Welcome to the forum! Yes of course this is an appropriate question Make it a function, not a property, if using it has a side effect or returns something random. The value of the property should not change unexpectedly. Again, the good convention is to make it behave like a constant, at least constant for this object instance with this state. The read-only properties are often used to make some field read-only from the outside. The idea is that after M圜lass.MyProperty := 123 the programmer can expect that M圜lass.MyProperty = 123. Do not convert or scale the requested value. Do not reject invalid values silently in the "setter" (raise an exception if you must). The setter function should always set the requested value, such that calling the getter yields it back. This is in fact one of the cool possibilities of a "getter" function. Note that it’s OK for getter to have some invisible side-effect, for example to cache a value of some calculation (known to produce the same results for given instance), to return it faster next time. ![]() Using COM interfaces with reference-counting disabled More stuff inside classes and nested classes Callbacks (aka events, aka pointers to functions, aka procedural variables) Containers (lists, dictionaries) using generics How the exceptions are displayed by various libraries Finally (doing things regardless if an exception occurred) Free notification observer (Castle Game Engine) Virtual methods, override and reintroduce Exposing one unit identifiers from another Enumerated and ordinal types and sets and constant-length arrays Testing single expression for multiple values (case) Logical, relational and bit-wise operators
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |