Guest Post

Apply naming conventions with Form macros

Automatically translated from English

by guest author Michael Höhne, 4D developer (Munich, Germany) 

 

There’s a feature in 4D v18 R5 that may have been overlooked, or at least hasn’t gotten much attention so far: Form macros. To be honest, I hadn’t spent much time on them either, until recently. In this blog post, I’ll show you a macro that saves a lot of time when applying naming conventions to list box columns, column headers, and footers. You can easily change it to fit your needs. A dedicated repo is also available on Github.

Product

Automate repetitive tasks and more with form macros!

Automatically translated from English

If you’re a fan of macros in the code editor, then 4D v18 R5 has some good news for you …  because now macros are also available in the form editor!

Let me start by telling you how useful macros can be for you. Have you ever needed to use formatting or naming rules in your application, then apply them to each new form? Or maybe you’ve had to work on existing forms created by someone else, and always need to do the exact same checks and analyses before getting started. If you’ve ever encountered one of these scenarios, then 4D v18 R5 is for you because it gives you the ability to create macros and save time on predictable, repetitive tasks.

Product

Coder-friendly syntax for class functions and methods

Automatically translated from English

Using $1, $2, and $n variables in your code not only makes the code less readable, it can also increase confusion since the human brain can find it difficult to remember what these variables correspond to. The solution is to create a variable with an understandable name and assign it the value of $1, $2, or $n.

4D v18 R5 has good news, you can now name your parameters when declaring:

  • a project method,
  • a trigger
  • a database method
  • a form method
  • a constructor of a class
  • a function of a class.

 

Let’s see how!

Product

Preview your CSS directly in the form editor!

Automatically translated from English

In 4D v18 R5, you can preview the final CSS rendering in the form editor WITHOUT running your dialog. Yes, you heard that right. Standardizing and reviving your forms has never been easier!

If you haven’t yet heard about CSS in 4D, now’s the perfect time to learn more! Introduced in 4D v18 for project applications, this concept includes enhanced and quick style sheets based on CSS. I recommend taking a look at this blog post.

Product

Project by default. Binary on demand

Automatically translated from English

Projects were introduced in 4D v17 R5. An architecture representing a giant evolution for 4D applications, projects opened the 4D world to source control tools, collaborative programming, code sharing, modularity, and much more! To make things even better (and simpler), 4D v18 R4 creates new projects by default, while developers – if they choose to do so – can continue to create binary databases via a simple setting.

Product

Project Databases: Method documentation is back

Automatically translated from English

When developing an application, it can be very useful to have quick access to the details of a method (e.g., an explanation of what it does, its syntax, and a definition of the parameters passed to it). This becomes even more important when using a compiled component. You can’t look at the content of the method, so you can only rely on its documentation to understand how to use it.

The Explorer’s dialog has been enhanced and documentation is now available in 4D v18 R3 for project databases.

Product

Define the font size for automatic font

Automatically translated from English

In a previous R-release, we added two new automatic themes to define font and the font size, so there are three automatic themes at your disposal which respect the guidelines of each platform. To design your interface, the automatic theme is the recommended way to go with each form object using the font and size recommended by the OS.

In some cases, you may need more control and have valid reasons to ignore the guidelines. With 4D v18 R3, you can override the size of the automatic themes and have more control over how your text is displayed.

Product

An intro to object-oriented programming in 4D: Classes

Automatically translated from English

Many of you have have been asking to be able to define an object type ever since the Object type became available. Thanks to object notation, many of you dream of having object functions.  Dream no more and say hello to classes in 4D v18 R3 project database! In this blog post, we’re introducing one of the most interesting concepts of object-oriented programming … along with a database example and a bonus video!