Get access to over 100 FireMonkey cross platform samples for Android, IOS, OSX, Windows, and Linux!

AndroidAppmethodCode SnippetComponentDelphiFiremonkeyIOSOSXWindows

Add Generic Tuple Support With Generics.Tuples In Firemonkey On Android And IOS

Delphi XE6 Firemonkey Generics TuplesMalcolm Groves from Embarcadero has a new unit posted on Github called Generics.Tuples and it implements generic tuple support in Delphi XE5, Delphi XE6 and AppMethod. It should also work cross platform on Android, IOS, Windows, and OSX. Tuples are a single type that can hold multiple other types. Malcolm used the generics capability of Object Pascal to implement two and three parameter tuples. A sample usage for a tuple that he gives is being able to return two values from a function instead of just one. It currently supports tuples containing two and three items. I checked out the Microsoft docs for the C# tuples object and the Microsoft one supports up to 8. You can easily add more than the 3 it currently has to this Object Pascal implementation if you need more. Here is his sample code for using a tuple to store two different values:

Head over and download the Generics.Tuples unit from Github and start using it in your projects.

close

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Related posts
AndroidC++BuilderDelphiFiremonkeyIOSOSXWindows

FireMonkey 10.4.2 Features Updated iOS 14, Android 11, And macOS 11 Support Plus Hundreds Of Fixes

DelphiIDEShowcaseWindows

Ryzen 9 5950x: One Billion Lines Of Delphi Code Compiled In ~5 Minutes On 16 Cores

DelphiFiremonkeyIDEIOSOSXWindows

DelphiCon 2020 FireMonkey Sessions Available Starting November 19

AndroidC++BuilderDelphiDemoFiremonkeyWindows

Powerful Commercial Gorilla3D Framework Upgraded For Delphi FireMonkey On Windows And Android

Sign up for our Newsletter and
stay informed

4 Comments

Leave a Reply