Tips

Tech Tips — The 4 Tips of April are Here!

Automatically translated from English

by Add Komoncharoensiri, Director of Technical Services at 4D Inc

 

As a 4D developer, you have to keep up with the new advances 4D is continuously shipping. Besides tips and tricks provided by the product team, Tech Tips are another reference for learning some of the 4D concepts.

This article covers 4 tips:

  • How to treat SQL wildcard characters as a literal string
  • Programmatically get the project name
  • Preemptive methods under the same call chain should also be preemptive
  • Creating a new View Pro document based on a Sheet
Product

ORDA – Share an entity selection between processes

Automatically translated from English

4D v16 R6 introduced a new concept of communication between processes: shared object and shared collection variables! Thanks to this, you’re able to easily share information between processes.

Until now, entity selections weren’t shareable between processes. However, that has changed … we’re pleased to announce that in 4D v18 R5 entity selections are shareable! 

Gone are the days of building a list of primary keys to move a selection of entities to another process. Enhance your multi-processes code by including ORDA entity selections as shared objects.

Keep reading to learn more.

Product

Objects Corner: easy sharing & other good news

Automatically translated from English

How many times have you gotten the “Not supported value type in a shared object” error when trying to put an object into a shared object?

What did you do? Write longer code to turn your innocent object into a shared one, perhaps iterating over all of its properties?

How about transferring a shared object from one shared group to another?

 

An interesting thing about objects: you already know they can be used as a hash map (a key/value system), but what about gettings all the keys or all the values with a single line of code?

Keep reading, because 4D v18 R3 is out and brings good news!

Product

Coexistence of thread-safe and non-thread-safe commands

Automatically translated from English

Have you ever needed to use methods with both thread-safe and not thread-safe calls, with conditions that skip over commands that are not thread-safe? Currently the compiler prevents doing this and an error is thrown, however there’s a flag that lets you disable this check and this blog post shows you how. 

Product

Easily synchronize your processes

Automatically translated from English

Preemptive processes are very useful for performing extensive calculations in parallel, using all of the cores in your CPU, but sometimes you need to delegate tasks to a cooperative process (e.g., using a non-preemptive command). With the New signal command, you can pause a process and wait for the response from another process!