Synergy Farm Solutions Inc.

Open Book
Keyboard
MacBook
Crocus
Blueberries
Light Bulb
Reed
This page contains code that may be useful to developers in the 4th Dimension community. It is available “as is” to anyone who would like it, although feedback is appreciated. You can learn more about 4th Dimension at www.4d.com.


Collection Cheat Sheet


There are lots of functions on 4D collections to get your mind wrapped around when you are new to them. Which ones mutate the original collection and which ones return a new collection? Which ones return a deep copy and which ones return a shallow copy? Which ones take a query string for a parameter and which ones take a method? This cheat sheet takes a stab at organizing the functions in a way that makes it fast to find the one you need.

Entity Selection Cheat Sheet


Just like collections, entities and entity selections have lots of functions to learn. Use this cheat sheet to find the functions you need faster.

OBJ Module


This module is a light-weight wrapper for 4D's object which adds dot notation (including direct array element access using [x] notation), some clarity between reference counted and copied objects, the ability to store more kinds of data in objects (including all types of arrays, 2D arrays, pictures, blobs, etc.), and some convenience methods.

The code is available here. It is a 4D v16 database. You should be able to simply copy the one folder in the database to your structure.
I've also back-ported the code to a 4D v15 database which you can get here.

UITimer Module


The main module in this structure is the UITimer module which can be used for creating different types of timers on forms in 4D. The nicest part is it makes it simple to declaratively set up fairly complex animations and even animation chains. The OBJ module from above as well as a module for programmatically creating constants are included for support.

The code is available here. It is a 4D v16 database. Check out the __README method for more information.

GUIAnchor Module


GUIAnchor is a small code module that makes it easy to control moving and resizing of form objects during window resizes in 4D. It has three main methods which take the headache out of programming complex layouts. The module is created so that you can change the position of objects on the form during development without having to update any code.

A demo database (with the code) is available here. It is a 4D v15.1 database.

Profile4D Component


Profile4D is a module that makes it fairly simple to profile certain parts of your code. The code is available here. It is a 4D v15.1 database and you can copy the code to your own structure.