Commands Renaming and Deprecations

As developers, we all appreciate efficiency and simplicity in our coding routines. The fewer keystrokes we need to remember, the better!

With this in mind, we’re revisiting and refining command names while deprecating outdated ones in 4D 20 R7 to make them shorter, more consistent, and aligned with modern development standards.

Why the Change?

Over time, some command names have become unnecessarily long or inconsistent. Our goal with this update is to address these issues by aligning command names with a clear rule:

Use “Get only when there is a corresponding “Set” command.

For example, you can “Get” a value if you can also “Set” it.

Consider these examples:

  • Random instead of Get random (since you can’t set a random value).
  • Current process instead of Get current process (you can’t set the current process).

 

Additionally, some commands have outlived their usefulness and have been replaced with more powerful alternatives. These outdated commands are being officially deprecated to encourage developers to use the updated versions with enhanced functionality.

Commands Renaming

We’ve identified 22 commands that need to be renamed. These commands currently have a “Get” prefix but don’t necessarily need it because there’s no corresponding “Set” command.

Here’s a list of the current and updated names:

Current Command

New Command

Get action info Action info
GET ACTIVITY SNAPSHOT ACTIVITY SNAPSHOT
Get application info Application info
GET BACKUP INFORMATION BACKUP INFO
Get call chain Call chain
Get database measures Database measures
Get last field number Last field number
Get last query path Last query path
Get last query plan Last query plan
Get last table number Last table number
Get license info License info
Get license usage License usage
Get localized document path Localized document path
Get localized string Localized string
Get locked records info Locked records info
GET MEMORY STATISTICS MEMORY STATISTICS
Get Monitored Activity Monitored activity
GET MOUSE MOUSE POSITION
GET RESTORE INFORMATION RESTORE INFO
Get system info System info
Get table fragmentation Table fragmentation
Session storage by id Session storage

Deprecated Commands

In addition to renaming commands, some outdated ones are being deprecated. These commands are no longer relevant or have been replaced with more robust alternatives, often offering improved functionality and performance.

Here’s a list of the deprecated commands, along with their modern replacements:

Deprecated name

Replacement

_O_GET LAST ERROR STACK Last errors
_O_PROCESS PROPERTIES Process info
_O_GET SERIAL INFORMATION License info
_O_SET SCREEN DEPTH (no longer needed)

How Will This Impact You?

For those working in binary mode or using the “Include tokens in project source files” option, you don’t need to take any action. The tokenization process automatically handles these changes, ensuring smooth operation without manual intervention.

If you’re not using tokens, you must manually search and replace the deprecated command names in your code. While this may require some upfront effort, it’s essential to maintaining clean and future-proof code.

However, we understand that not all developers use tokens. We recognize that name changes can be a challenge for those who don’t. Manually updating code with search-and-replace tools is not ideal, even if modern text editors simplify the process with “search in files” functionality.

That’s why we don’t change command names often. Instead, we collect updates over time and implement them in larger batches, as we’re doing now, to prepare for 4D 21. Given the many improvements to the 4D language, we believe it’s critical to address confusing or obsolete command names to ensure clarity and consistency in the future.

For more details, visit our documentation center or join the discussion on the 4D Forums. We’re here to help you navigate these changes and ensure a smooth transition.

Avatar
• Product Marketing Manager • Intissar joined 4D in 2017 as a Product Marketing Manager. She works closely with the product, marketing, engineering, and technical support teams to highlight the ‘why’, the ‘how’, and the ‘what’ of new and updated features to different audiences. This close proximity allows her to craft messaging frameworks and write in-depth content and code samples for the 4D blog and website. After graduating with an engineer's degree in Computer Science from VINCI university, Intissar worked in several startups as a software engineer. Her hands-on experience includes software specification, design, and development, user training and support, and team management.