Escriba código más limpio con el operador ternario de Delphi

Septiembre 16, 2025
Delphi 13 Florence presenta varias mejoras en el lenguaje Delphi, incluido un operador ternario conciso para expresiones condicionales en línea.

Continuar leyendo en inglés:

Delphi by Embarcadero is an advanced Integrated Development Environment (IDE) that allows you to build native applications for desktop, mobile, web, and console environments using a single codebase. It includes a visual designer, code editor, debugger, and component library, all specifically designed for rapid application development with the Object Pascal programming language. With Delphi, you can target Windows, macOS, iOS, Android, and Linux while leveraging a large developer community and extensive third-party plugin support.

With the Delphi 13 Florence release, developers can now express conditional logic more cleanly with the introduction of a ternary operator. Implemented using the familiar 'if' keyword, this new syntax mirrors similar constructs in other languages, allowing conditions to be evaluated directly within expressions. This change improves code readability and reduces verbosity, especially in scenarios where simple value selection depends on a condition. Alongside this, RAD Studio 13.0 includes additional Delphi language refinements aimed at modernizing and simplifying code development.

To see a full list of what's new in version 13 Florence, see our release notes.

Delphi is licensed per Named, Network Named or Concurrent user and is available as a Perpetual License with an Update Subscription that includes support and free upgrades for 1 Year. See our Delphi licensing page for full details.

Delphi is available to buy in the following products: