Introducing the Latest Find and Replace Features
The “Find and Replace” feature in the code editor has existed for many years. Developers can easily and efficiently search and replace code, especially when dealing with large codebases. 4D v20 is bringing improvements that are sure to be appreciated by developers who rely on this functionality to streamline their coding workflows:
- knowing the number of occurrences to replace,
- knowing the position of the current occurrence,
- having permanent access to the Next and Previous navigation options,
- display a palette instead of a modal window to limit the number of clicks.
4D Write Pro – Find and Replace
For many years now, 4D Write Pro has made it possible to create simple or complex documents, either via programming using templates or by simply creating new documents from scratch. Starting with 4D v19, both developers and end users will be happy to use the new find (and replace) capabilities of 4D Write Pro. Using not just the interface… but also the code!
Let’s delve into the details!
4D View Pro: Find and replace with code
Sometimes when you initialize a 4D View Pro document, you need to find some values or tags in it and replace them with data issued from 4D. Now it’s a breeze with the VP Find command. Thanks to this command, you can find data, a formula, or a tag and replace it in the entire sheet or only a specific part of it!
Let’s find out how.
Placeholders for attribute paths in ORDA queries
The ORDA features keep coming with 4D v17 R5! In a previous blog post, we showed you how to create generic queries with named placeholders for values. This post will focus on how to use placeholders for attribute paths (field names in tables).
4 different ways to find items in a collection
As a developer, you often need to know whether a specified item already exists in a collection, or to find all the items corresponding to particular criteria. 4D collection methods offer many different ways to look up specific items.
Query collections
Simplicity is the ultimate sophistication, and with over 40 methods in 4D v16 R6 to manage collections, things are getting much easier for you as a developer. Not only is your code clean and more readable, but its also written in record time!
In this blog post we’ll take a look at how the two new methods, query and indices, will allow you to manipulate and retrieve items from a collection in a snap!
Find a specific attribute value in a single line of code!
Remember the days when you had to use nested loops and conditional statements to retrieve an object’s attribute? So you ended up with a long and complicated piece of code? Well, those days are over! Thanks to object notation combined with collections and their methods, you’re now able to write code faster, and in a more readable way!
Finding a specific attribute’s value has never been easier. Let’s take a look at a real life scenario and discover how!
Export results of “Find in design” dialog
When you search for all objects in the Design Environment, 4D displays the results in the hierarchical list. From 4D v16 R3, you can export these results in a text file that can be opened using a spreadsheet for example, so that you can easily dispatch some refactoring work or store the results in a document to work on it later.
Search by linking array attribute query arguments
Object fields, introduced with 4D v15, allows to store and index unstructured data. This could be a common set of data, like first name, last name, birthday. It could be different data in each record, such as a shop that will need different attributes for shoes (size, color), computers (CPU, memory), printers (color, ink), a list of values or all in any combination.
Here is a real User Story from a 4D customer :
“My badge application manages the access rights for each person to a building and for a time slot. This information is stored in a database as an array of objects ( e.g.: {access right, building, time slot} ). I want to be able to look for people who have access to a building during a time slot.”
4D provides several ways to query for data, using index and so extremely fast.
Contact us
Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!
* Your privacy is very important to us. Please click here to view our Policy