Jump to content

Mahdi Safsafi

Members
  • Content Count

    383
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by Mahdi Safsafi

  1. Mahdi Safsafi

    How to switch condition position?

    Well Mike. This is our community. They're all exited and each topic turns just like this one xD ... All people here love coding ... and I'm sure you will love this community too. You said your're a new to Delphi. We welcome you here 🙂. Now for your question about using "Result := Value if(Condition);" , the sort answer is not possible. I believe that using table lookup is match easy for you: type TRec = record Patterns: array of string; Result: string; end; PRec = ^TRec; const Table: array [0 .. 1] of TRec = ( (Patterns: ['Prop1', 'Prop2', 'Prop3', 'Prop4', 'Prop5', 'Prop6', 'Prop7']; Result: 'N'), (Patterns: ['PropertyA', 'PropertyB', 'PropertyC', 'PropertyD']; Result: 'DefaultABC') ); function LookUp(const AProperty: string): string; var I: Integer; Rec: PRec; begin for I := 0 to Length(Table) - 1 do begin Rec := @Table[I]; if (MatchStr(AProperty, Rec^.Patterns)) then exit(Rec^.Result); end; Result := 'Default'; end; Because you're a new to Delphi, I believe that's the best way for you right now. Later you can optimise it by using binary string search, hash-code, magic-index, crc32 and binary lookup, ...
  2. Mahdi Safsafi

    How to switch condition position?

    Ah I see ! If I know that the compiler can do a good job about optimisation I'd write something like this: begin // ... // Requires Rio const table = [Result, 'true']; Result := table[integer(Condition)]; end; desperately waiting for : Result := Condition ? Value : Result;
  3. Mahdi Safsafi

    How to switch condition position?

    You might consider to inline it ... the call is too expensive ! Also what about that ? Result := Condition or Result;
  4. Mahdi Safsafi

    Rio quality disappoint

    Hello guys, For a long time I was using Delphi XE7 and I was most of the time satisfied about it. Just when I made a clean Windows installation and then installed the community edition Rio. Booom, flickers mostly every where, nonworking getit, a lot of crash, cpu usage 46%, and the famous IDE's caption 'not responding...'. I disabled themes (I believed that was the problem) and yeppp I got a crappy IDE again (EAccessViolation GetIt260.bpl) !! I'm not even going to mention the use of inline-variable ! I really started thinking to switch to another platform (java, c#, c++ & Qt) ? What do you think guys ?
  5. Mahdi Safsafi

    Rio quality disappoint

    Great ! Few years ago I really liked what they did with Oxygen. The only things that stopped me from using their products was the lack of native CPU support. I really appreciate if you can answer the following questions (based on your experience): - What do you think about their IDE, is't stable, mature enough ? - Did you test to deploy to a native CPU ? and how was the quality/performance there ?
  6. Mahdi Safsafi

    Rio quality disappoint

    What's impressive about RemObjects is their elements. The team took Pascal language into a new level. And with elements 9 they claim that it's possible to compile to a native CPU rather than to IL.
  7. Mahdi Safsafi

    Rio quality disappoint

    Sorry, I got only december patch 2018. The getit package now is working and my cpu is no longer overused by the IDE. But the GUI still the same
  8. Mahdi Safsafi

    Rio quality disappoint

    I didn't install any 3rd party package. My Windows it self had a clean installation and my project was very simple one form and one button (just to test some new things). Also a good IDE should works mostly on all situations and not to work just fine when building a "hello world" project. Recently I compiled the LLVM (which is a very huge project) using MSVS and the IDE handled it very good (just got some CPU overusing ... but that was logical) ! One things to mention about 3rd party : nowadays huge projects split plugins into sub-process (when a plugin fails the main app remains safe) ex: chrome. I'm not saying that EMB should go that way. My point is if a company cares about quality ... it will find a workaround. Please use VSCode, Visual Studio, or eclipse and I'm sure you will change your mind about Delphi IDE quality.
  9. Mahdi Safsafi

    Rio quality disappoint

    I was a big fun of pascal language. But now I'm not . The only reason that keeps me using Delphi is it's beautiful VCL. I use notepad++ to quick view/edit my pascal units. But I guess I'll switch to VSCode soon.
  10. Mahdi Safsafi

    Rio quality disappoint

    Yes your're absolutely right. I use eclipse daily and it's amazing (never saw 'not responding...'). I also use visual studio community for some c/c++ coding and its quality is really really incomparable to Delphi. For VSCode, I just tested it with lite development (editing some python/Perl script) and yes it's shiny ! I always got a negative idea about technologies that use HTML/CSS/GPU for desktop-app (such FM) but VSCode make me change my mind !
×