Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 11/28/20 in Posts

  1. I just had to do it... Go with the flow! It's the Black Friday / Cyber Monday "season", so I had to rush the book offer The book was actually scheduled for release in early December, but then the Black Friday deals started popping up all over the place... pressure was building... and I finally caved in! I cut the darn thing in two, and decided to offer Part I at a discount, and will give Part II for free to all Buyers. Not really a 97% BF discount but hey... Junior is still studying, and we still have to pay the bills (Corona doesn't help, either)! So, here it is! I hope you'll like it like you did Delphi Memory Management! https://dalija.prasnikar.info/delphiebap/index.html Thank you all for the support!
  2. I came across this trying to duplicate C++'s std::next_permutation using Delphi. I went through various modifications, and had left a string declaration in where it was no longer needed: procedure reverse(var s:AnsiString; const a,x:word); inline; var i,j : word; //t : string; begin // x is one past the end of string if a = x-1 then exit; j := ( x-a ) shr 1; // trunc((x-a)/2); for i := 1 to j do swapCh( s[a-1+i] , s[x-i] ); end; All permutations of 12 chars = 479,001,600. C++ = 2s. Commenting out the string reduced the Delphi code from 9s to 6s. (I haven't been back to it since then.)
  3. Remy Lebeau

    Byte Array to String

    Better to use SysUtils.TEncoding.GetString(), then no intermediate AnsiString is needed. procedure TForm1.Button1Click(Sender: TObject); var ANameSpace : Variant; AFolderItem : Variant; AMailItem : Variant; RTFBody : array of Byte; RTFString : String; begin OutlookApplication1.Connect; ANameSpace := OutlookApplication1.GetNameSpace('MAPI'); AFolderItem := ANameSpace.GetDefaultFolder(olFolderInbox); AMailItem := AFolderItem.Items(1); RTFBody := AMailItem.RTFBody; RTFString := TEncoding.Default.GetString(RTFBody); Memo1.Lines.Add(RtfString); end;
  4. Dave Nottage

    XCode 12 compile error

    I'm having similar issues, i.e. building Firebase against iOS 14.2 SDK. Looking into it...
  5. All the time. I am especially fond of classes that have only class methods. They basically act as namespaces.
  6. Hans♫

    AV with InApp purchase on MacOS

    I have attached the FMX.InAppPurchase.Mac.pas that we use so it is easy to use for others. All you need is to add it to your project and also add a modified version of FMX.InAppPurchase.pas where you include the file (just search for FMX.InAppPurchase.IOS, and see how that file is added, and do the same with the FMX edition) FMX.InAppPurchase.zip
  7. Dave Nottage

    AV with InApp purchase on MacOS

    The only changed that Hans needed to stop it crashing for him was to change this: FProductsRequest.setDelegate((FProductsRequestDelegate as ILocalObject).GetObjectID); to this: FProductsRequest.setDelegate(FProductsRequestDelegate.GetObjectID);
  8. Attila Kovacs

    Welcome, users of C++Builder

    How can I ignore it?
×