Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 05/15/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. jbg

    JSON benchmarks

    Well, as of today, it uses a binary search and has a much stricter parser.
  3. 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
  4. 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
  5. Apple's RAM and disk prices are ridiculous, but personally I'd go for at least 24GB and 1TB. My MBP M1 has 32GB/2TB.
  6. 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.
  7. 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.
  8. 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.
  9. 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
  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. 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!
  12. Markus Kinzler

    What are the performance profilers for Delphi 12?

    https://polywickstudio.net/development-diary/Accelerate-your-Apps-using-the-Superluminal-Performance-Profiler
  13. Ł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.
  14. Remy Lebeau

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

    Standard RTL Path Functions across the Supported Target Platforms
  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. PA Server in the directory in my case in Program Files (x86) and so on have not been replaced in my case too. The new files do exist in the Catalog Reporsitory. Check the date created, I see several changes applied by/with the patch. I usually don't touch things unless problems show up. So until now I didn't need to install PA Server. The line in the About Box mentioning the April patch shows up, since I installed the patch very likely a second time, no idea if that's possible, from the Welcome Page. I didn't check file changes after applying the patch manually. Installing the manual patch would have taken a long time for not doing almost anything. So I'm assuming it installed and the IDE just didn't show the line in the About Box. Add) Pretty much the same result after having applied the May patch. The line for May Patch shows up in the About Box
  17. I agree - but here's a few examples of where I've used it: // Using absolute to rename a public API function while maintaining backward compatibility: // - MyFunction is the old API entrypoint. // - NewNameSameFunction is the new API entrypoint. type TMyDelegate = procedure(X, Y, Z: Single); var NewNameSameFunction: TMyDelegate var MyFunction: TMyDelegate absolute NewNameSameFunction deprecated 'Use NewNameSameFunction instead'; // Same with global vars: type TLUT88 = array[byte, byte] of byte; var DivMul255Table: TLUT88; MulDiv255Table: TLUT88; var RcTable: TLUT88 absolute DivMul255Table; DivTable: TLUT88 absolute MulDiv255Table; // Casting between "uncastable" types without pointers procedure FooBar(const X1, Y1, X2, Y2: Single) var Y1bin: Cardinal absolute Y1; Y2bin: Cardinal absolute Y2; begin // Fast way of testing if a Single is zero; Same as "if (Y1 = 0) and (Y2 = 0) then" but faster. if (Y1bin shl 1 = 0) and (Y2bin shl 1 = 0) then Exit; ... end;
  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. Dave Nottage

    How to send and intercept USSD result

    This is not the same approach as what Ranja was trying, however it might be what you are looking for: https://github.com/DelphiWorlds/Playground/tree/main/Demos/UssdRequester
  20. Uwe Raabe

    Is this to be expected persistent?

    It is just a reminder to renew your subscription, just in case you missed to do that.
  21. FYI: https://probablydance.com/2018/06/16/fibonacci-hashing-the-optimization-that-the-world-forgot-or-a-better-alternative-to-integer-modulo/ -tee-
  22. Remy Lebeau

    Anonymous methods as interfaces

    That is correct. Basically, an anonymous method is implemented as an interfaced object with an Invoke() method that matches the signature of the anonymous method. https://stackoverflow.com/questions/39955052/how-are-anonymous-methods-implemented-under-the-hood Not by Embarcadero, as it is an implementation detail of the compiler. But it is a well-known implementation that is documented on numerous sites/blogs.
  23. Lars Fosdal

    What new features would you like to see in Delphi 13?

    1. Debuggers, debuggers, debuggers - multithread handling is abysmal today 2. Make HighDPI actually works as intended - it is useless in a team as is - unless everyone runs the same scaling 3. Generics constraints for enumerated types to enable the use of conversion to/from ordinal values, use set operators, etc. 4. Native ARM64 compiler for Delphi for Windows (and Linux/Raspberry PI, but Windows has prio) 5. A 64-bit IDE that ensured that EMBT was dogfooding 64-bit VCL and RTL and raise the quality As for AI, I wouldn't mind an AI that could look at code and suggest improvements - perhaps as a part of the static code analysis, or one that could explain "what does this code do". I don't really need or want an AI to generate code. If it is a standard, a lib should already exist. If it doesn't and there is no standard that covers the need, I'd be happy to have an AI outline alternative approaches - but given that the wide scope of parameters that goes into a design, I think it is unrealistic to expect that it would come up with the ideal suggestion without us writing a huge requirement. The output of VLLM generators is extremely dependant on precise and accurate specification statements, and writing those are almost as hard as writing good code. As for AI and privacy - keep your secret credentials separated from your code. Other than that, I don't think that many of us write code that truly needs to be hidden for secrecy reasons, although it is obvious that it will be necessary to ensure that privacy permeates the use of AI.
  24. JonRobertson

    Delphi 12 - TEdit: Android App Strange Behavior

    Copy your patched FMX.Platform.UI.Android.pas to the same folder containing your project. You could also add it to the project. Delphi will compile and use the one in your project folder rather than the version shipped with Delphi. If you need to use this for multiple projects, or later need to patch another FMX unit, you could create a folder named something like FMXOverrides. I don't use FMX but I've had a VCLOverrides folder for years.
  25. Daniel

    Delphi License Registration

    We clearly do not support piracy.
×