Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 05/14/25 in all areas

  1. pyscripter

    JSON benchmarks

    hydrobyte/TestJSON: A simple project to test JSON libraries with Delphi and C++Builder. presents JSON library benchmarks comparing a large number of alternatives. One thing that strikes me, is that the System.JSON rtl library is doing relatively well compared to the competition, both in terms of performance and in terms of JSON validation. With the exception of Find, is very competitive in all other areas. I have seen many claims that System.JSON is very slow and that the xyz library is so many times faster. Do these benchmarks suck (like most benchmarks)? Or is it the case that System.JSON is not that bad? What is your experience?
  2. DelphiUdIT

    Indy, TauruTLS and TLS 1.3

    Delphi version 12.3 with patch. I used the TaurusTLS from https://github.com/JPeterMugaas/TaurusTLS with bundle version of Embarcadero to activate the use of TLSv1.3. Inside a web server project that I use for testing, I substitute the old PR299 (openSSL 1.x and 3.x wrapper) with TaurusTLS and all is perfect working with really less change. I don't use the component at design time, so with some $IFDEF I adapt the code that can work with old PR299 (TLSv1.3), only a bundle distro (TLSv1.2) and the new TaurusTLS (TLSv1.3 with all the new OpenSSL 3.x DLLs) with only a recompile action. I have more server place with some certificates from Let's encrypt and redirection function (http port 80 -> https port 443) and is all good. Thanks to @Remy Lebeau and @J. Peter Mugaas
  3. Patrick PREMARTIN

    fmxLinux missing?

    It's now official : FMX Linux is back in GetIt for developers with Enterprise and Architect licenses under subscription. Current version available is 1.78 (the same for 12 and 12.1 Athens) but it will be maintained and evolve in the future. https://blogs.embarcadero.com/fmx-linux-for-delphi-12-3-is-now-available/
  4. jbg

    JSON benchmarks

    Well, as of today, it uses a binary search and has a much stricter parser.
  5. Stefan Glienke

    What are the performance profilers for Delphi 12?

    This morning, I started the 14-day trial of Superluminal, and my first impression is very positive. I have yet to run it against more than some tiny toy projects though
  6. Remy Lebeau

    D12, Android 14, how to locate "assets\internal" at runtime

    Standard RTL Path Functions across the Supported Target Platforms
  7. Remy Lebeau

    In App Purchase (consumable and subscription)

    That is because you are clearing the FPurchaseMap before then querying the Products instead of querying the Purchases. IsProductPurchased() looks at FPurchaseMap, but QueryProducts() populates FProductDetailsMap and not FPurchaseMap. QueryPurchases() populates FPurchaseMap. Also, there is no OnPurchasesRequestResponse event for when QueryPurchases() completes. It triggers the OnSetupComplete event instead. Which implies QueryPurchases() was not intended to be used outside of initial component setup, since TInAppPurchase tracks purchase updates in real-time.
  8. Anders Melander

    Project Release Icon not Showing

    SHChangeNotify got me thinking... Assuming a call to SHChangeNotify(SHCNE_ASSOCCHANGED) is all that is needed to rebuild the cache, is there something in Windows that we know makes that call? A quick search of "the source" gave the answer: The assoc command of the Windows shell; All it does is write an entry to the registry and then make the SHChangeNotify call. assoc .foobar=text Voila! If you want to remove the file association entry again then it's just: assoc .foobar= Admin privs required, btw.
  9. Perhaps a little rework into a record will remove the whole question of the absolute directive completely. So that you get the point of the additional benefits I see from such structure, to have much more related informations included and easy extendable. This way you can use the right types for specific fields, not all as strings. unit PeriodicTable; interface uses System.SysUtils, System.Math; { TElementRecord encapsulates properties of a chemical element } type TElementRecord = record AtomicNumber : Integer; // Ordnungszahl Symbol : string; // Elementsymbol Name : string; // Elementname AtomicMass : Double; // Atommasse in u HasStableIsotopes : Boolean; // True, wenn stabile Isotope existieren Group : Integer; // Gruppennummer (0=unknown) Period : Integer; // Periode (0=unknown) Electronegativity : Double; // (0=unknown) IonizationEnergy : Double; // erste Ionisierungsenergie in eV (0=unknown) AtomicRadius : Double; // Kovalenter Radius in pm (0=unknown) ElectronConfig : string; // Elektronenkonfiguration (' '=unknown) Density : Double; // Dichte in g/cm³ (0=unknown) MeltingPoint : Double; // Schmelzpunkt in K (0=unknown) BoilingPoint : Double; // Siedepunkt in K (0=unknown) OxidationStates : string; // (''=unknown) Abundance : Double; // Natürliche Häufigkeit in ‰ (0=unknown) end; { Enumeration of all 118 elements } TElement = ( elH, elHe, elLi, elBe, elB, elC, elN, elO, elF, elNe, elNa, elMg, elAl, elSi, elP, elS, elCl, elAr, elK, elCa, elSc, elTi, elV, elCr, elMn, elFe, elCo, elNi, elCu, elZn, elGa, elGe, elAs, elSe, elBr, elKr, elRb, elSr, elY, elZr, elNb, elMo, elTc, elRu, elRh, elPd, elAg, elCd, elIn, elSn, elSb, elTe, elI, elXe, elCs, elBa, elLa, elCe, elPr, elNd, elPm, elSm, elEu, elGd, elTb, elDy, elHo, elEr, elTm, elYb, elLu, elHf, elTa, elW, elRe, elOs, elIr, elPt, elAu, elHg, elTl, elPb, elBi, elPo, elAt, elRn, elFr, elRa, elAc, elTh, elPa, elU, elNp, elPu, elAm, elCm, elBk, elCf, elEs, elFm, elMd, elNo, elLr, elRf, elDb, elSg, elBh, elHs, elMt, elDs, elRg, elCn, elNh, elFl, elMc, elLv, elTs, elOg ); { Helper with utilities } TElementHelper = record helper for TElement function ToRecord: TElementRecord; function Symbol: string; function Name: string; // Including HasStableIsotopes bracket convention function MassString: string; function MassValue: Double; class function Count: Integer; static; class function FromSymbol(const ASym: string): TElement; static; class function FromMass(const AMass, ATolerance: Double = 1e-6): TArray<TElement>; static; end; const Elements: array[TElement] of TElementRecord = ( (AtomicNumber:1; Symbol:'H'; Name:'Hydrogen'; AtomicMass:1.00794; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:2; Symbol:'He'; Name:'Helium'; AtomicMass:4.002602; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:3; Symbol:'Li'; Name:'Lithium'; AtomicMass:6.941; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:4; Symbol:'Be'; Name:'Beryllium'; AtomicMass:9.012182; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:5; Symbol:'B'; Name:'Boron'; AtomicMass:10.811; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:6; Symbol:'C'; Name:'Carbon'; AtomicMass:12.0107; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:7; Symbol:'N'; Name:'Nitrogen'; AtomicMass:14.0067; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:8; Symbol:'O'; Name:'Oxygen'; AtomicMass:15.9994; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:9; Symbol:'F'; Name:'Fluorine'; AtomicMass:18.9984032; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:10; Symbol:'Ne'; Name:'Neon'; AtomicMass:20.1797; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:11; Symbol:'Na'; Name:'Sodium'; AtomicMass:22.98976928; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:12; Symbol:'Mg'; Name:'Magnesium'; AtomicMass:24.305; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:13; Symbol:'Al'; Name:'Aluminium'; AtomicMass:26.9815386; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:14; Symbol:'Si'; Name:'Silicon'; AtomicMass:28.0855; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:15; Symbol:'P'; Name:'Phosphorus'; AtomicMass:30.973762; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:16; Symbol:'S'; Name:'Sulfur'; AtomicMass:32.065; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:17; Symbol:'Cl'; Name:'Chlorine'; AtomicMass:35.453; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:18; Symbol:'Ar'; Name:'Argon'; AtomicMass:39.948; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:19; Symbol:'K'; Name:'Potassium'; AtomicMass:39.0983; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:20; Symbol:'Ca'; Name:'Calcium'; AtomicMass:40.078; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:21; Symbol:'Sc'; Name:'Scandium'; AtomicMass:44.955912; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:22; Symbol:'Ti'; Name:'Titanium'; AtomicMass:47.867; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:23; Symbol:'V'; Name:'Vanadium'; AtomicMass:50.9415; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:24; Symbol:'Cr'; Name:'Chromium'; AtomicMass:51.9961; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:25; Symbol:'Mn'; Name:'Manganese'; AtomicMass:54.938045; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:26; Symbol:'Fe'; Name:'Iron'; AtomicMass:55.845; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:27; Symbol:'Co'; Name:'Cobalt'; AtomicMass:58.933195; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:28; Symbol:'Ni'; Name:'Nickel'; AtomicMass:58.6934; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:29; Symbol:'Cu'; Name:'Copper'; AtomicMass:63.546; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:30; Symbol:'Zn'; Name:'Zinc'; AtomicMass:65.38; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:31; Symbol:'Ga'; Name:'Gallium'; AtomicMass:69.723; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:32; Symbol:'Ge'; Name:'Germanium'; AtomicMass:72.63; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:33; Symbol:'As'; Name:'Arsenic'; AtomicMass:74.9216; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:34; Symbol:'Se'; Name:'Selenium'; AtomicMass:78.96; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:35; Symbol:'Br'; Name:'Bromine'; AtomicMass:79.904; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:36; Symbol:'Kr'; Name:'Krypton'; AtomicMass:83.798; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:37; Symbol:'Rb'; Name:'Rubidium'; AtomicMass:85.4678; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:38; Symbol:'Sr'; Name:'Strontium'; AtomicMass:87.62; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:39; Symbol:'Y'; Name:'Yttrium'; AtomicMass:88.90585; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:40; Symbol:'Zr'; Name:'Zirconium'; AtomicMass:91.224; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:41; Symbol:'Nb'; Name:'Niobium'; AtomicMass:92.90628; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:42; Symbol:'Mo'; Name:'Molybdenum'; AtomicMass:95.96; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:43; Symbol:'Tc'; Name:'Technetium'; AtomicMass:98; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:44; Symbol:'Ru'; Name:'Ruthenium'; AtomicMass:101.07; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:45; Symbol:'Rh'; Name:'Rhodium'; AtomicMass:102.9055; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:46; Symbol:'Pd'; Name:'Palladium'; AtomicMass:106.42; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:47; Symbol:'Ag'; Name:'Silver'; AtomicMass:107.8682; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:48; Symbol:'Cd'; Name:'Cadmium'; AtomicMass:112.411; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:49; Symbol:'In'; Name:'Indium'; AtomicMass:114.818; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:50; Symbol:'Sn'; Name:'Tin'; AtomicMass:118.71; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:51; Symbol:'Sb'; Name:'Antimony'; AtomicMass:121.76; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:52; Symbol:'Te'; Name:'Tellurium'; AtomicMass:127.6; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:53; Symbol:'I'; Name:'Iodine'; AtomicMass:126.90447; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:54; Symbol:'Xe'; Name:'Xenon'; AtomicMass:131.293; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:55; Symbol:'Cs'; Name:'Caesium'; AtomicMass:132.9054; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:56; Symbol:'Ba'; Name:'Barium'; AtomicMass:132.9054; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:57; Symbol:'La'; Name:'Lanthanum'; AtomicMass:138.90547; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:58; Symbol:'Ce'; Name:'Cerium'; AtomicMass:140.116; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:59; Symbol:'Pr'; Name:'Praseodymium'; AtomicMass:140.90765; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:60; Symbol:'Nd'; Name:'Neodymium'; AtomicMass:144.242; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:61; Symbol:'Pm'; Name:'Promethium'; AtomicMass:145; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:62; Symbol:'Sm'; Name:'Samarium'; AtomicMass:150.36; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:63; Symbol:'Eu'; Name:'Europium'; AtomicMass:151.964; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:64; Symbol:'Gd'; Name:'Gadolinium'; AtomicMass:157.25; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:65; Symbol:'Tb'; Name:'Terbium'; AtomicMass:158.92535; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:66; Symbol:'Dy'; Name:'Dysprosium'; AtomicMass:162.5; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:67; Symbol:'Ho'; Name:'Holmium'; AtomicMass:164.93032; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:68; Symbol:'Er'; Name:'Erbium'; AtomicMass:167.259; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:69; Symbol:'Tm'; Name:'Thulium'; AtomicMass:168.93421; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:70; Symbol:'Yb'; Name:'Ytterbium'; AtomicMass:173.054; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:71; Symbol:'Lu'; Name:'Lutetium'; AtomicMass:174.9668; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:72; Symbol:'Hf'; Name:'Hafnium'; AtomicMass:178.49; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:73; Symbol:'Ta'; Name:'Tantalum'; AtomicMass:180.94788; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:74; Symbol:'W'; Name:'Tungsten'; AtomicMass:183.84; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:75; Symbol:'Re'; Name:'Rhenium'; AtomicMass:186.207; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:76; Symbol:'Os'; Name:'Osmium'; AtomicMass:190.23; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:77; Symbol:'Ir'; Name:'Iridium'; AtomicMass:192.217; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:78; Symbol:'Pt'; Name:'Platinum'; AtomicMass:195.084; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:79; Symbol:'Au'; Name:'Gold'; AtomicMass:196.966569; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:80; Symbol:'Hg'; Name:'Mercury'; AtomicMass:200.59; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:81; Symbol:'Tl'; Name:'Thallium'; AtomicMass:204.3833; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:82; Symbol:'Pb'; Name:'Lead'; AtomicMass:207.2; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:83; Symbol:'Bi'; Name:'Bismuth'; AtomicMass:208.9804; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:84; Symbol:'Po'; Name:'Polonium'; AtomicMass:209; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:85; Symbol:'At'; Name:'Astatine'; AtomicMass:210; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:86; Symbol:'Rn'; Name:'Radon'; AtomicMass:222; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:87; Symbol:'Fr'; Name:'Francium'; AtomicMass:223; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:88; Symbol:'Ra'; Name:'Radium'; AtomicMass:226; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:89; Symbol:'Ac'; Name:'Actinium'; AtomicMass:227; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:90; Symbol:'Th'; Name:'Thorium'; AtomicMass:232.03806; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:91; Symbol:'Pa'; Name:'Protactinium'; AtomicMass:231.0588; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:92; Symbol:'U'; Name:'Uranium'; AtomicMass:238.02891; HasStableIsotopes:true; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:93; Symbol:'Np'; Name:'Neptunium'; AtomicMass:237; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:94; Symbol:'Pu'; Name:'Plutonium'; AtomicMass:244; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:95; Symbol:'Am'; Name:'Americium'; AtomicMass:243; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:96; Symbol:'Cm'; Name:'Curium'; AtomicMass:247; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:97; Symbol:'Bk'; Name:'Berkelium'; AtomicMass:247; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:98; Symbol:'Cf'; Name:'Californium'; AtomicMass:251; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:99; Symbol:'Es'; Name:'Einsteinium'; AtomicMass:252; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:100; Symbol:'Fm'; Name:'Fermium'; AtomicMass:257; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:101; Symbol:'Md'; Name:'Mendelevium'; AtomicMass:258; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:102; Symbol:'No'; Name:'Nobelium'; AtomicMass:259; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:103; Symbol:'Lr'; Name:'Lawrencium'; AtomicMass:262; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:104; Symbol:'Rf'; Name:'Rutherfordium'; AtomicMass:267; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:105; Symbol:'Db'; Name:'Dubnium'; AtomicMass:268; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:106; Symbol:'Sg'; Name:'Seaborgium'; AtomicMass:271; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:107; Symbol:'Bh'; Name:'Bohrium'; AtomicMass:272; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:108; Symbol:'Hs'; Name:'Hassium'; AtomicMass:270; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:109; Symbol:'Mt'; Name:'Meitnerium'; AtomicMass:276; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:110; Symbol:'Ds'; Name:'Darmstadtium'; AtomicMass:281; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:111; Symbol:'Rg'; Name:'Roentgenium'; AtomicMass:280; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:112; Symbol:'Cn'; Name:'Copernicium'; AtomicMass:285; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:113; Symbol:'Nh'; Name:'Nihonium'; AtomicMass:286; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:114; Symbol:'Fl'; Name:'Flerovium'; AtomicMass:289; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:115; Symbol:'Mc'; Name:'Moscovium'; AtomicMass:290; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:116; Symbol:'Lv'; Name:'Livermorium'; AtomicMass:293; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:117; Symbol:'Ts'; Name:'Tennessine'; AtomicMass:294; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), (AtomicNumber:118; Symbol:'Og'; Name:'Oganesson'; AtomicMass:294; HasStableIsotopes:false; Group:0;Period:0;Electronegativity:0;IonizationEnergy:0;AtomicRadius:0;ElectronConfig:'';Density:0;MeltingPoint:0;BoilingPoint:0;OxidationStates:'';Abundance:0), ); implementation { TElementHelper impl } function TElementHelper.ToRecord: TElementRecord; begin Result := Elements[Self]; end; function TElementHelper.Symbol: string; begin Result := Elements[Self].Symbol; end; function TElementHelper.Name: string; begin Result := Elements[Self].Name; end; // Including HasStableIsotopes bracket convention function TElementHelper.MassString: string; begin if not Elements[Self].HasStableIsotopes then Result := Format('(%s)', [ FloatToStr(Elements[Self].AtomicMass) ]); else Result := FloatToStr(Elements[Self].AtomicMass); end; function TElementHelper.MassValue: Double; begin Result := Elements[Self].AtomicMass; end; class function TElementHelper.Count: Integer; begin Result := Length(Elements); end; class function TElementHelper.FromSymbol(const ASym: string): TElement; var e: TElement; begin for e := Low(TElement) to High(TElement) do if CompareText(Elements[e].Symbol, ASym) = 0 then Exit(e); raise Exception.CreateFmt('Symbol %s not found', [ASym]); end; class function TElementHelper.FromMass(const AMass, ATolerance: Double): TArray<TElement>; var e: TElement; L: TList<TElement>; begin L := TList<TElement>.Create; try for e := Low(TElement) to High(TElement) do if Abs(Elements[e].AtomicMass - AMass) <= ATolerance then L.Add(e); Result := L.ToArray; finally L.Free; end; end; end. Edit: I forgot to add a little how-to-use example program PeriodicTableDemo; {$APPTYPE CONSOLE} uses System.SysUtils, PeriodicTable; var e : TElement; rec : TElementRecord; matches : TArray<TElement>; i : Integer; begin try // 1) Total count of elements Writeln('Total elements: ', TElementHelper.Count); // 2) Lookup for symbol „Fe“ e := TElementHelper.FromSymbol('Fe'); rec := e.ToRecord; Writeln(Format('Element %d: %s – %s, Mass = %s u', [rec.AtomicNumber, rec.Symbol, rec.Name, e.MassString])); // 3) Search for elements with mass ≈ 1.00794 matches := TElementHelper.FromMass(1.00794, 1e-4); if Length(matches) = 0 then Writeln('No matching elements found.') else begin Writeln('Matches for mass ≈ 1.00794:'); for i := 0 to High(matches) do begin e := matches[i]; rec := e.ToRecord; Writeln(Format(' %s (%s), AtomicNumber = %d', [rec.Symbol, rec.Name, rec.AtomicNumber])); end; end; // 4) Iteration over all elements Writeln('Erste 5 Elemente im Periodensystem:'); for i := 0 to Min(4, TElementHelper.Count-1) do begin e := TElement(i); rec := e.ToRecord; Writeln(Format('%2d: %s – %s, Mass = %s u', [rec.AtomicNumber, rec.Symbol, rec.Name, e.MassString])); end; except on E: Exception do Writeln('Error: ', E.ClassName, ': ', E.Message); end; end.
  10. I would like to share the following in case you encounter the same issue. Class and Record Helpers (Delphi) - RAD Studio states that: Actually, this is not entirely correct. Consider the following: Unit HelperUnit1.pas: TObjectHelper1 = class helper for TObject procedure Test; end; Unit2 HelperUnit2.pas: TObjectHelper2 = class helper for TObject procedure Test; end; Unit SupportClasses,pas: uses HelperUnit1; type TMyClass: class end; Unit MainUnit.pas interface implementation uses SupportClasses, HelperUnit2; begin var MyClass:= TMyClass.Create; MyClass.Test; end; MyClass.Test will use the HelperUnit1.TObjectHelper1.Test implementation even if HelperUnit1 is not even in scope, let alone being "in nearest scope". So it appears that if a class helper is in scope where a class is defined, it is used unconditionally in all units of a project. If not, then what it is stated in the documentation applies.
  11. FredS

    Class helpers catch

    May explain an old bug report I file where adding a second record helper (access to private as a bug fix) lower down in a unit would be ignored. There may be a workaround for class helpers, in this case you can inherit from the original class helper. THelper2 = class helper(THelper1) for TMyClass
  12. What are you trying to achieve here? As Stefan says, why aren't you declaring these as records to begin with? And why would you want to make anything here a variable. Seems like this area of Physics is pretty much fixed!
  13. Markus Kinzler

    What are the performance profilers for Delphi 12?

    https://polywickstudio.net/development-diary/Accelerate-your-Apps-using-the-Superluminal-Performance-Profiler
  14. ŁukaszDe

    Debugger keeps the execution line centered

    I have CnPack and DDevExtensions installed. If you do not have any extra tools, it is a bug in IDE.
  15. Uwe Raabe

    Has the toolbar problem been fixed?

    A stable Delphi is also important to me. That's why I do my best to help Embarcadero achieve this.
  16. apachx

    In App Purchase (consumable and subscription)

    Just in case, this limitation of the TInAppPurchase component has already been reported in a ticket on the Embarcadero Quality Portal - https://embt.atlassian.net/servicedesk/customer/portal/1/RSS-3516. Who knows - maybe the developers will eventually do something about it.
  17. Arnaud Bouchez

    JSON benchmarks

    To be fair, the tests do not seem very realistic to me. And using any non-standard library for a core process like JSON should be not only with Delphi, but also with FPC. We are on the 21st century, and modern object pascal is not just Delphi. ;)
  18. Alberto Fornés

    Subscribe to a topic with TIcsMQTTClient

    Problem solved. I set the subscription to reading/boxes/+, and the correct option was reading/boxes/#. Thanks to those who responded and tried to help.👍
  19. It is beyond me why it is needed, short coming in CM_RECREATEWND that used to trigger the recreation and when it is received, (i think ) It could be made better but will break things, also may be things changed in newer VCLs but in the older ones RecreateWnd is needed, even it means the recreation will happen twice.
  20. Remy Lebeau

    Is TImage empty

    Check the TImage.Picture.Graphic and TGraphic.Empty properties: if (Image1.Picture.Graphic = nil) or Image.Picture.Graphic.Empty then You can assign nil to the TImage.Picture property: Image1.Picture := nil; // same as: // Image1.Picture.Assign(nil); Or to its Graphic property: Image1.Picture.Graphic := nil;
  21. Anders Melander

    Unicode normalization

    In the end, I had to abandon PUCU as the author never bothered to react to my bug reports. Instead, I tried to adapt the JEDI implementation: I removed all dependencies and fixed the worst bugs and performance issues. Finally, I ran the code against my unit tests. The result was a big disappointment; While it didn't crash like PUCU, it failed even more of the test cases. The test suite uses the 19,000 NFC (compose) and NFD (decompose) normalization test cases published by the Unicode consortium. So back to square one again. Comparing the algorithms used by the JEDI library against countless (I've looked at over a hundred) other Unicode libraries didn't reveal the cause. They all used the same algorithms. Blogs and articles that described the algorithm also matched what was being done. I was beginning to suspect that Unicode's own test cases were wrong, but then I finally got around to reading the actual Unicode specification where the rules and algorithms are described, and guess what - Apart from Unicode's own reference library and a few others, they're all doing it wrong. I have now implemented the normalization functions from scratch based on the Unicode v15 specs and all tests now pass. The functions can be found here, in case anyone needs them: https://gitlab.com/anders.bo.melander/pascaltype2/-/blob/master/Source/PascalType.Unicode.pas#L258 Note that while the functions implement both canonical (NFC/NFD) and compatible (NFKC/NFKD) normalization, only the canonical variants have been tested as they are the only ones I need.
  22. Lajos Juhász

    Help installing TProcess on Delphi Sydney 10.4

    The repository doesn't contains the files to install the component. You can use it from code (hint there are demo projects to show how you can use it).
  23. peardox

    Project Release Icon not Showing

    Got here cos of the same issue - this is really annoying 🙂 Solution - paste this into Windows Explorer address bar %userprofile%\AppData\Local\Microsoft\Windows\Explorer Delete iconcache* Reboot Fixed
  24. Ian Branch

    Detect Windows shutdown?

    Hmmm. OK. I still have something amiss/NQR. On telling the PC to shutdown with the App running Windows immediately goes to the Shutting down screen. Reminder, I am on a Win 10 PC. This is my full code att.. unit Unit3; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs; type TForm3 = class(TForm) procedure FormShow(Sender: TObject); // private { Private declarations } procedure WMQueryEndSession(var Msg: TWMQueryEndSession); message WM_QueryEndSession; // detect Windows shutdown message procedure SaveData; // routine to save data to disk public { Public declarations } end; function ShutdownBlockReasonCreate(Handle: hWnd; Reason: LPCWSTR): Bool; stdcall; external user32; function ShutdownBlockReasonDestroy(Handle: hWnd): Bool; stdcall; external user32; var Form3: TForm3; DataToBeSaved: Boolean; implementation {$R *.dfm} procedure TForm3.WMQueryEndSession(var Msg: TWMQueryEndSession); begin if DataToBeSaved then begin Msg.Result := lResult(True); // disallow Windows from shutting down SaveData; end; Msg.Result := lResult(False); // allow Windows shutdown end; // Set DataToBeSaved to False after saving data procedure TForm3.FormShow(Sender: TObject); begin DataToBeSaved := True; end; procedure TForm3.SaveData; begin ShutdownBlockReasonCreate(Application.MainForm.Handle, 'please wait while muting...'); // Save data to disk files // ... beep; beep; beep; DataToBeSaved := False; // ShutdownBlockReasonDestroy(Application.MainForm.Handle); end; end. At least it builds now. 😉
  25. Dalija Prasnikar

    Request for advice: FireMonkey and Frames

    Creating at run-time is pretty straightforward. You need Owner and Parent, and sometimes setting Align property. You can use any FMX control as those - or at least I have been able to use them without a problem. FFrame := TMyFrameClass.Create(AParent); FFrame.Parent := AParent; FFrame.Align := ... And that is it.
×