Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 01/22/19 in all areas

  1. Rollo62

    MessageDialog in Delphi 10.3

    I always consider the Application.ProcessMessages suspicious, do you really need this ? Usualy I'm fine when reacting to my stuff directly in the anonymous procedure.
  2. Der schöne Günther

    Test Bits in a Byte

    I always found using System.Classes.TBits easier to use than raw bit operations... if myValue.Bits[3] then (...)
  3. Download: https://cc.embarcadero.com/item/30872 From the readme.txt:
  4. haentschman

    Test Bits in a Byte

    @Kryvich You miss understand. I aggree with you... I am a fan of Enumerations. Better: If you MUST work with it permanently, you want meaningful names. Sorry.
  5. Kryvich

    Test Bits in a Byte

    You can write it as If ((b and $01) > 0) or ((b and $08) > 0) or ((b and $80) > 0) then ... Or you can create an enumeration and use meaningful names for each bit. type TMyEnum = (mb0, mb1, mb2, mb3, mb4, mb5, mb6, mb7); TMyBits = set of TMyEnum; // = Byte in size function Test: Byte; var mbs: TMyBits; begin mbs := [mb0, mb3, mb7]; Byte(mbs) := $89; // It's equivalent of mbs := [mb0, mb3, mb7]; if mbs * [mb0, mb3, mb7] <> [] then // If one of bit is set ;//... if mbs * [mb0, mb3, mb7] = [mb0, mb3, mb7] then // If all 3 bits are set ;//... if mbs - [mb0, mb3, mb7] = [] then // If no other bits are set ;//... Include(mbs, mb1); // Set 2nd bit mbs := mbs - [mb3, mb7]; // Unset 4th and 8th bit //etc... Result := Byte(mbs); end; It's always better to deal with clearly named typed variables and constants.
  6. mausmb

    MessageDialog in Delphi 10.3

    This code working just fine in 10.3 Android & Windows ... dont' know with Tmodalresult TDialogService.MessageDialog((mymessage), system.UITypes.TMsgDlgType.mtConfirmation, [system.UITypes.TMsgDlgBtn.mbYes, system.UITypes.TMsgDlgBtn.mbNo], system.UITypes.TMsgDlgBtn.mbYes,0, procedure (const AResult: System.UITypes.TModalResult) begin case AResult of mrYES: Begin ..... br,
  7. jbg

    IDE Fix pack for Rio

    A new development snapshot of IDE Fix Pack for 10.3 Rio is available. The Win64 (DCC64) and Android (DCCAARM) compiler patches should now work as excepted. Changes: Added: Support for Delphi 10.3 Rio Added: Fix for TStringList.IndexOfName bug (RSP-21633) Added: Fix for access violoation in the Welcomepage JScript9.dll binding Added: TCustomListBox.ResetContent is skipped if the handle isn't created yet Added: DFM Streaming optimizations Added: FillChar uses Enhanced REP MOVSB/STOSB cpu feature if available for large sizes. Added: Enabled CPU LOCK string assignment optimization for local variables Added: -Oe (experimental optimizations) and -x-cgo compiler option extension (Remove of some unneccessary push/pop operations) Added: Expression Evaluator allows array access to pointers even if the type wasn't declared with {$POINTERMATH ON} Added: New compiler option extensions: -x--compileonly, -x--reslist, -x--depfile, -x--unitstats Added: More performance optimization for the DCC64 compiler Added: TStringBuilder.SetLength optimization [RSP-19178] Added: TStrings.GetDelimitedText optimization Fixed: Packages with duplicate units may not have caused a fatal compiler error. IDEFixPackD103Reg64.7z fastdccD103vDev.7z
×