EXAMPLE APPLICATIONS
New for 4D v13: A new event is now generated when an item deletion is requested. The "effective" deletion is done by programming.
There are several types of indexes in 4D that can be selected according to the type of data and their use.
In addition to demonstrating their effectiveness, this example explains how to choose the most appropriate type of index.
To access each object, you can either click on the picture buttons on the left side of the form or select it directly from the drop-down menu.
Pictures can be displayed in different ways (truncated, replicated, etc.). They can be transformed (cropped, stretched, etc.).
It's also possible to import and export images, as well as to change them from one type to another (from .JPG to .PNG, for example).
These possibilities as well as others are demonstrated in this database.
Specific examples show both languages in parallel so that they can be compared easily and in order to highlight their respective advantages.
Comments and explanations are provided during the execution of these queries.
It also shows how to transfer, via FTP and using 4D Internet Commands, the static site that is generated.
Further indications are given during the demonstration.
4D's index types include:
- BTree index for non-repeated values (IDs, names, etc.)
- cluster index for repeated values (Booleans, titles (M., Ms., etc.))
- composite index for sorting (FirstName+LastName, City+ZipCode, State+City, etc.)
- keyword indexes for texts
The indexes are created and stored in a separate file.
To demonstrate their efficiency, this example explains how to choose the correct index type.
These include:
• variables
• buttons
• hierarchical lists
• fields
• checkboxes
• etc.
To use it, you can click on the buttons representing the Form editor tool bar or you can select a specific type of object directly from a dropdown menu.
Images can be displayed in various ways, as well as transformed. They can be imported, exported, and changed from one format to another (i.e. JPG to PNG).
Other possibilities are demonstrated as well.
The "4D SOAP Client" example application allows you to test the operation of this service.
The List Box object replaces grouped arrays on your forms.
You can enter data directly into a cell, display alternate colors for rows, resize and sort columns, and much more.
The words of definition can be clicked individually to access their definitions directly via a link.
You can also create new definitions (for any word selected in the texst) by clicking on a button.
In this case, we use PHP and Flash to illustrate and animate charts based upon 4D data.
*As of 4D v12.0, the PHP Execute command will not run if 4D is installed in the "Program Files" directory and you are not the administrator of the machine. This is fixed for v12.1 (and in 12.0 Hotfix 1 if you are a Partner). As a workaround, you must "Run as administrator." More details can be found in this Tech Tip: http://kb.4d.com/search/assetid=76116
The hierarchical list in this example is built dynamically when you click on the 'expandable' elements.
In this example, four lists that belong to four different tables are displayed in the same form.
The contents of these lists are calculated based on the user's selection.
The 4D language allows you to connect directly to an ODBC data source and to execute SQL queries inside "Begin SQL" and "End SQL" tags (and via the new 4D command: QUERY BY SQL).
This database shows how to carry out queries with the 4D language as well as with SQL.
Specific examples show both languages in parallel in order to compare them easily and to highlight their respective advantages.
Comments and explanations are provided during the execution of these queries.
These methods include image rotation, creating reflections, and more, and can be used in your own projects freely.
It also shows the conversion of characters when using the Uppercase and Lowercase functions, as well as 4D's capacity to convert from one standard to another (i.e. ISO-8859-1 to UTF16) via intermediary BLOBs.
4D v11 SQL's index types include:
- BTree index for non-repeated values (IDs, names, etc.)
- cluster index for repeated values (Booleans, titles (M., Ms., etc.))
- composite index for sorting (FirstName+LastName, City+ZipCode, State+City, etc.)
- keyword indexes for texts
This also covers indexes created stored in a separate file.
To demonstrate their efficiency, this example explains how to choose the correct index type.
These include:
- variables
- buttons
- field lists
- checkboxes
- etc.
To use it, you can click on the buttons representing the Form editor tool bar or you can select a specific type of object directly from a dropdown menu.
It allows you to:
- save and restore users and their passwords (encrypted)
- use a customized connection dialog box
- remove or create new users
- create additional information for a user (icon, visibility, etc.)
It also shows how to transfer via FTP the generated static web site using the 4D Internet Commands plug-in. Additional information is provided when running the demo.
Starting with a classic "clients - invoices - invoices_lines" structure, two forms can be duplicated then modified by the users: "envelopes" and "invoices."
These two templates have been deliberately left "open" so the final user can modify the text, formats and paper orientations, as well as margins, objects, etc.
Each form can be duplicated as many times as necessary. This allows, for example, specifying several envelope formats as well as different templates for the invoices.
Hierarchical List
This database shows the possibilities of using a hierarchical list:
- display of items of the list of colors
- multiple selections allowed
- events used: "On Expand", "On Collapse" and "On Selection Change"
- dynamically built lists
- icons from resources, object library or variables
Included List
This database show the possibilities of included lists:
- calculated content updated according to the selections
- 4D v11 SQL customized interface (alignment, font style, etc.)
- graphic object replaces color of current selection
- display of contents of several tables in one form
The 4D v11 SQL language allows you to connect directly to an ODBC data source and to execute SQL queries inside "Begin SQL" and "End SQL" tags (and via the new 4D command: QUERY BY SQL).
This database shows how to carry out queries with the 4D language as well as with SQL.
Specific examples show both languages in parallel in order to compare them easily and to highlight their respective advantages. Comments and explanations are provided during the execution of these queries.
One example illustrates a simple query (which consists of finding the airports of a specific city and country).
A second example illustrates a join (which consists of finding from among a selection of airports those that can be accessed via a direct flight).
A third illustrates a complex SQL query written simply using the 4D language.
A fourth example shows a complex 4D query illustrating "nested" queries in SQL.
A Web Area form object displays current graphs of your stocks' performance as retrieved from the internet, with options for update interval, zoom level, date range, and more. (Many thanks to 4D developer Tom Dillon for this contribution.)
Requires 4D v11 SQL Release 3 or above.
Download for Windows or Mac
Requires 4D v11 SQL Release 3 or above.
Download for Windows or Mac
Requires 4D v11 SQL Release 3 or above.
Download for Windows or Mac
It also shows the conversion of characters when using the Uppercase and Lowercase functions.
Web sites, local HTML pages, PDFs, movies, animations, JavaScript controls - all of them are at your diposal.
This demo uses Web Area to create a simple web browser, Google Maps mashup, document viewer, and canvas viewer in 4D v11 SQL.











