Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 02/02/19 in Posts

  1. jbg

    IDE Fix pack for Rio

    Fixed download links: IDEFixPackD103RegDev.7z fastdccD103vDev.7z
  2. Allen@Grijjy

    Running UnitTests for Mobile Devices

    The way we do it is we created a small class to inherit from ITestListener and ITestListenerX that acts like a simple remote TCP client on the mobile device to intercept the results of the tests as they happen and a simple TCP server with a GUI on Windows using Indy that the client connects to display the tests.
  3. Mike Torrettinni

    Splash screen doesn't show icon in taskbar

    I have a simple splash screen and I kind of think it should have an icon in taskbar, before Main form is shown. Right? I just tested a simple example with new project and new form, and icon is not displayed - as you can see the splash screen form does open in taskbar, but without an icon. When main form is shown, the icon is there: So, fresh new project with empty Form1 and empty Form 5. I can add source, but really only Project.dpr is changed, all the rest are empty forms. Here is project source: program Project1; uses Vcl.Forms, System.SysUtils, Unit1 in 'Unit1.pas' {Form1}, Unit5 in 'Unit5.pas' {Form5}; {$R *.res} begin Form5 := TForm5.Create(nil); Form5.Show; Application.Initialize; Application.CreateForm(TForm1, Form1); sleep(5000); Form5.Free; Application.Run; end. Is that normal for splash form to not show icon in taskbar? Any suggestions to fix this?
  4. Simple question, why "Multiply" operator works, and "Equal" does not. compiler give error "[dcc32 Error] Project1.dpr(33): E2015 Operator not applicable to this operand type" program Project1; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils; type TMyRecord2 = record public class operator Equal(const a: TMyRecord2; const b: array of Integer): boolean; class operator Multiply(const a: TMyRecord2; const b: array of Integer): TMyRecord2; end; class operator TMyRecord2.Equal(const a: TMyRecord2; const b: array of Integer): boolean; begin Result := True; end; class operator TMyRecord2.Multiply(const a: TMyRecord2; const b: array of Integer): TMyRecord2; begin Result := a; end; var b: boolean; r: TMyRecord2; begin try r := r * [10]; // this line is compiled b := r = [10]; // this line is not compiled except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; end.
  5. Allen@Grijjy

    Running UnitTests for Mobile Devices

    Sorry, the code is so tightly coupled with our private code, it would take some time to decouple the pieces. We may do a blog article on this in the future on our site, blog.grijjy.com. The approach we took is to use the example ITestRunner that are included with Delphi samples and just intercept the test results and send them over the wire. You could use almost any communication library to send them, or even log them locally if you want to avoid that step.
  6. Ondrej Kelle

    Version Control System

    People have actually asked for blame as a feature, that's why I included it back then in delphisvn (before it became Version Insight). I find it useful myself to see who committed which lines and also when. This piece of metadata can be useful when trying to understand a code base and its evolution.
  7. David Heffernan

    operator overloding Equal vs Multiply

    Operators are functions. There are certainly times when it might be useful to use arrays as operator arguments. I regret that the language designers have allowed literals to have meaning determined by context in various places. When there is insufficient context, as is inevitably the case on occasion, these kind of problems arise.
  8. Rudy Velthuis

    Should my record be a class instead?

    He has saved a lot of things: time: records don't need complicated allocation, objects do; nor do records need complicated deallocation; space: records are generally smaller than objects; hassle: usually no need to take care of their lifetime management; more hassle: he already has records; there is no need to rewrite things. So I don't see why on earth he should use objects, if he can use records. Yes, they also need initialization. So what? I don't get your objections WRT naming of constructors, or why you think that constructors should be automatic. Note that default constructors, as they were envisioned for 10.3 Rio, together with default destructors, copy constructors, conversion constructors and overloaded assignment operators have totally different purposes. They allow you to get rid of the (for the user invisible, but rather slow) initialization, finalization, etc. which is generally done by relatively slow runtime functions like _InitializeRecord, _FinalizeRecord, CopyRecord, etc. and which use RTTI (at runtime!) to search their way through a record and initialize, finalize or copy the managed fields they find. These special constructors and destructors are meant to give you the opportunity to replace these slow but automatic runtime routines by your own code, i.e. you tell the compiler: I know what I am doing, I know which members need special handling, so there is no need to call these slow routines. If you don't write these special methods, the automatic behaviour will still take place, i.e. managed fields will be initialized to 0 (or whatever the type equivalent is), refcounts will be handled, etc.
  9. It is never a good idea to increment the size by one. See this blog post: Extending arrays But otherwise: yes, you are being too pedantic. If this is in a tight loop, you might think of profiling which is faster, otherwise, it doesn't really matter. FWIW, I would do it like this (after Delphi XE7, IIRC): NewRecord.SomeField := SomeValue; // etc... MyArray := MyArray + [NewRecord]; No need for SetLength, Len or High
  10. Anders Melander

    Version Control System

    I'd recommend SVN or GIT - and since someone dared to mention it, I'd also like to warn against TFS. It's an abomination and just a tiny improvement over VSS. In my experience the learning curve, if coming from VSS, is much smaller for SVN than for GIT. IMO the DVCS aspect of GIT is mostly hype since nobody uses it that way, but it does make it easy to work with local feature branches. If you need your source hosted in the cloud I think GIT is the best solution. There are SVN hosting solutions but in my experience they aren't very good. I personally prefer SVN as it matches the way I think better. I do use GIT but I really have to think hard about what I'm doing every time I need to do something with it. I can picture what I want to do in my head but have a hard time translating that to the available actions. For SVN I use TortoiseSVN and for GIT TortoiseGIT. I also have SourceTree v1 (v2 is a bad joke) but it's really slow to work with - and buggy. I didn't know there was a newer version, so I'll check that out.
  11. Stefan Glienke

    Version Control System

    GitKraken is not free for commercial use though. I like using SourceTree (after the 2.x disaster in 3.x it's usable again).
  12. I myself favor Mercurial (hg), but that is just another flavor for the DVCS concept. And we are only two and a half developers. Considering Microsoft themselves favor git over VSS (which they have never used seriously themselves) or TSF, that speaks volumes. Subversion is nice and all, but just can't keep up with the young folks anymore. Why learn to move a two horse carriage, when you could be learning to drive a Model S? So if you consider moving to a different VCS, make the move count. There is not that much to learn anyway. And most of it you'll learn when you need it. Just look at one of the hundreds of VSS->DVCS tutorials and go for it. Best of all, they both are free. Even if you setup an apache server to host a central repository, still free for any amount of users. Edith actually wanted to add Joel Spolskys very cool hginit.com which is a very nice introduction to Mercurial, but it is down for some reason. So instead you get Joels 2010 blog entry on how he took on DVCS after years of Subversion: https://www.joelonsoftware.com/2010/03/17/distributed-version-control-is-here-to-stay-baby/ Examples: https://edmundv.home.xs4all.nl/blog/2014/02/08/migrate-sourcesafe-to-mercurial/ https://www.perforce.com/blog/migrating-visual-sourcesafe-mercurial https://accu.org/index.php/journals/1828
  13. Hi... ...how many users? My favorite is GIT. But NOT over the IDE. I use TortoiseGIT. It looks like the explorer with overlay icons. ...and WITHOUT console.
  14. Sherlock

    IDE Fix pack for Rio

    You, Sir, are a scholar and a drinker of fine ales.
  15. Stefan Glienke

    appending to a dynamic array

    What's also interesting about Length and High is that if you are just writing code that directly compiles into a binary they are being inlined by the compiler whereas if you are using them in units that are pre-compiled as part of a package (if you are 3rd party component vendor for example) they are not and always cause a call to System._DynArrayHigh and System._DynArrayLength. Funny enough this is not the case for the source shipped with Delphi because their DCUs are not generated from their containing packages.
  16. Johan Bontes

    Time bomb

    In that case can you please explain what the nature of your (time)bomb is? I thought it was the issue that the const input got changed by the proc, but that does not seem to be your problem.
  17. Johan Bontes

    Time bomb

    The way to deal with this is to have a function return a string whenever possible, that way it is clear in the calling code that `S` is being overwritten. Never output the same managed type of data that you allow as input in a var or out parameter. function y(const input: string; out Success: boolean): string; begin Result:= input + '1'; // end; status:= x(S,S); //Looks harmless S:= y(S, status); //The danger is clearly visible in the calling code Alternatively he compiler could issue a warning when a const parameter is also passed as a var/out parameter. also this code does not make a whole lot of sense: if x(S,S) then .... ////^^^^^ ////hiding dangerous -work- stuff with side-effects in an if statement. You should never do unconditional work inside an if statement. That's too unexpected.
×