4D

HOW DO I


Advanced Text AreaProductivity
How do you create multi-style text areas in 4D?

Use different types of styles based on portions of text: Inster/modify URLs, 4D expressions, recalculations… Manage your own contextual menu in the area… This database will provide you with code examples that can be used in your own projects.

 

Advanced text area

 

Download for Windows & Mac

Duplicate ColumnUser Interface
This How-Do-I is about listboxes.

It shows you how to programmatically duplicate and move a column.

 

Duplicate listbox column

 

Download for Windows or Mac

Form Load Get TypeUser Interface
This How-Do-I shows you how you can use the FORM LOAD command (formerly OPEN PRINT FORMº) and the new commands OBJECT get type and LISTBOX GET OBJECTS.

 

Download for Windows or Mac

Getters & SettersData Handling
This How-Do-I presents all of the new Getters and Setters in 4D v14.

 

Download for Windows & Mac

Objects and JSONInternet & Mobility
This How-Do-I presents all of the new commands for generating and parsing structured objects (like JSON).

 

Download for Windows or Mac

Rotate TextUser Interface
This How-Do-I is about static text and non-enterable variables.

It shows you how to orient such text via the property list or by programming.

 

rotate text

Download for Windows or Mac

 

Save as ReferenceDevelopment Environment
This How-Do-I demonstrates how to save a value by reference (e.g. 1, 2, 3, 4) instead of by value (e.g. Mr., Mrs., Ms., Dr., etc.).

save as reference

 

Download for Windows or Mac

Save Screen GeometryUser Interface
This How-Do-I demonstrates how 4D can automatically save – without any programming – the position of your windows, form objects, and values of certain objects (tabs, rulers, radio buttons, etc.).

Save screen geometry

 

Download for Windows or Mac

Scroll Two PIctures at OnceUser Interface
This How-Do-I demonstrates how to synchronously scroll two images at once with the OnPictureScroll event.

Scroll two pictures

 

Download for Windows or Mac

Set DatasourceData Handling
This How-Do-I will show you how to modify the "source" of a form object programatically, no matter the type (text field, rule, checkbox, dropdown, etc.).

Set datasource

 

Download for Windows or Mac

Set Drag IconUser Interface
How do you use your own custom icon to associate with an item being dragged and dropped?

This database will teach you how this new command lets you do it.

 

Set drag icon

 

Download for Windows & Mac

Set Up a Choice ListDevelopment Environment
This How-Do-I demonstrates how to programatically modify a choice list associated with a form object.

This list can be created just as well in structure mode as it can be dynamically by programming.

 

set up a choice list

 

Download for Windows or Mac

SpellcheckerProductivity
This database presents the commands that allow you to change the spellchecker on Mac OS (native or Hunspell) and to change the correction language.

spell check

 

Download for Mac

SQL ViewsDatabase
This How-Do-I shows you some examples on how to use SQL Views in more and less complex ways.

SQL views

 

Download for Windows & Mac

Styled CellsUser Interface
This How-Do-I is about listboxes.

It will show you how to modify cell style (character style and color, background color) via the table or via new 4D commands.

 

Styled cells

 

Download for Windows or Mac

Use a PlaceholderDevelopment Environment
This How-Do-I example shows how to display placeholder text inside a text field.

Placeholders

 

Download for Windows or Mac

Use Fullscreen ModeUser Interface
This How-Do-I shows you how to switch your windows into fullscreen mode.

This feature is only available for Mac users.

 

Fullscreen

 

Download for Mac

 

Use Popups with a Single VariableDevelopment Environment
This How-Do-I shows you how to use single variables (C_TEXT or C_ALPHA, for example) and to display them as drop-down menus or combo boxes in the interface without using tables.

Popup with variables

 

Download for Windows or Mac

Compare PicturesData Handling
Pictures may look similar, but are they really identical? The new function "equal pictures" will give you the answer!

The function returns "true" or "false" depending on the result.

 

It also builds a mask that shows you the differences between the pictures you compare.

 

Download for Windows or Mac

Database EventsDatabase
This "How Do I" gives you an example of the new database method 'On System events' management.

The new events supported by this new method apply to background or foreground application moves.

 

Download for Windows or Mac

File Management EnhancementData Handling
In 4D v13, some existing file management commands have been improved.
  • COPY DOCUMENT
  • CREATE FOLDER
  • DOCUMENT LIST
  • System folder
  • Select document

 

This "How Do I" covers all of the above commands.

 

Download for Windows or Mac

Get DigestData Handling
This example shows you how to use the new Get Digest command.

Part of this functionality was previously available in 4D Pack, using the MD5 algorithm and applied only to documents.

 

The new 4D command will be able to use two different algorithms (MD5 digest and SHA1 digest) and apply it to variables.

 

Here you have an example of how it works on a variable and how to manipulate it on a document.

 

Download for Windows or Mac

Get List Item ParametersDevelopment Environment
This "How Do I" demonstrates how to read list item names.

Previous to 4D v13, to retrieve a parameter value, you had to know the parameter name and use the GET LIST ITEM PARAMETER command.

 

With the new GET LIST ITEM PARAMETER ARRAYS command, you can retrieve all parameter names and parameter values. 

 

Download for Windows or Mac

Get Query DestinationDevelopment Environment
How do I use "GET QUERY DESTINATION" and "Get query limit"?

We added the command GET QUERY DESTINATION to allow you to know where the result of the current query has been placed for the current process, and the command Get query limit that lets you know whether or not there is a limit for the query.

 

We've also added a new parameter for the command SET QUERY DESTINATION: A pointer to the local variable, when the destination type is a variable.

 

Download for Windows or Mac

Get Text KeywordsDevelopment Environment
When storing a text with a keyword index, the field content is parsed to fill a keyword list in order to build the index. A new command does the same on a passed variable (or field).

GET TEXT KEYWORDS(theText ; the TextArray) fills an array with all words within the text. 

 

GET TEXT KEYWORD(theText ; the TextArray ; *) fills an array with all unique words within the text.

 

Download for Windows or Mac

Getters and SettersDevelopment Environment
4D v13 introduces new getters and setters.

This demo shows you how to use these new getters and setters and their associations.

 

Download for Windows or Mac

HTTP ClientConnectivity
As of 4D v13, there is a built-in HTTP client in 4D.

This "How Do I" covers the various commands that are used with the new HTTP client.

 

Download for Windows or Mac

Picture Names in PicturesMetadata
How do I save a picture's name in the picture itself?

When you drop or import a picture into a 4D variable or field, 4D reminds you of the name of the original file.

 

This name will be used by default in the system "save file" dialog when the command "SAVE PICTURE TO FILE" will be called or when using the contextual "Save as..." menu.

 

The file name saved inside the picture can be modified or simply read using the new commands PICTURE SET FILENAME and Picture get filename.

 

 

Download for Windows or Mac

Progress BarUser Interface
How do I use progress bars?

This demonstration shows you how to use the progress bar component that is included as of 4D v13.

 

Download for Windows or Mac

Selection to ArrayDevelopment Environment
4D v13 introduces new syntax for Selection to Array, Array to Selection, and Selection Range to Array.

This demo shows you how to use them.

 

Download for Windows or Mac

Stats FunctionsProductivity
4D v13 introduces enhancements to stats functions.

This "How Do I" demonstrates how to use statistical functions on arrays.

 

Download for Windows or Mac

Web Get Body PartConnectivity
Called in the context of a Web process, the WEB GET BODY PART command parses the "body" of a multi-part request.

This demonstrates how to use this command to get a file via the browser.

 

Download for Windows or Mac

Webkit IntegrationInternet & Mobility
As of 4D v13, the Web Area function of 4D integrates the Webkit rendering engine, using the same engine in under both Windows and Mac.

As a result, Web pages will have the same appearance and behavior on both platforms, ignoring Internet Explorer on Windows.

 

This demo shows how web interfaces look under the Webkit rendering engine.

 

Download for Windows or Mac

Windows EnhancementUser Interface
4D v13 provides a new parameter for SET WINDOW RECT.

This allows you to move a specified window to the passed coordinates and set it as a foreground window. The command now accepts a * parameter to keep the window in the background.

 

 

Download for Windows or Mac

XPS Print PreviewProductivity
4D supports XPS Print Preview under Windows.

This "How Do I" gives you an example of a direct print preview.

 

On Windows, if a print job is launched with the Print Preview checkbox selected, 4D redirects printing to the Microsoft XPS viewer.

 

Please note: Under Windows XP, Microsoft's .Net framework is required. 

 

Download for Windows or Mac

Advanced Text AreaUser Interface
How do I use the Rich Text Area feature?

 Download for Mac or Windows

AssertDevelopment Environment
How do I use the new ASSERT command?

 Download for Mac or Windows

Crop ImagesUser Interface
How do I crop images?

 Download for Mac or Windows

Drag and DropUser Interface
How do I manage drag & drop events?

 Download for Mac or Windows

Duplicate ObjectDevelopment Environment
How do I duplicate objects programmatically?

 Download for Mac or Windows

Dynamic VariablesDevelopment Environment
How do I use dynamic variables?

 Download for Mac or Windows

Execute PHPDevelopment Environment
How do I use PHP in 4D?

 Download for Mac or Windows

External DatabasesDatabase
How do I create and use databases external to the current application?

 Download for Mac or Windows

Form WidgetsUser Interface
How do I use the new Form Widgets?

 Download for Mac or Windows

Full Dump of DataData Handling
How do I export/import in SQL?

 Download for Mac or Windows

Getters and SettersDevelopment Environment
How do I use the new Getters and Setters?

 Download for Mac or Windows

Hierarchical List BoxesUser Interface
How do I use hierarchical list boxes?

 Download for Mac or Windows

JoinsDatabase
How do I use the new joins in 4D v12?

 Download for Mac or Windows

JSONInternet & Mobility
How do I use HttpXMLRequest and JSON with 4D?

 Download for Mac or Windows

Language SwitchingUser Interface
How do I switch languages dynamically?

 Download for Mac or Windows

New Field AttributesDevelopment Environment
How do I use new field attributes like UUID and Primary Key?

 Download for Mac or Windows

PDF (Windows)Productivity
How do I print to PDF under Windows?

This example requires that PDFCreator be installed, freely available from PDFForge.org

 

 Download for Windows

Picture MetadataMetadata
How do I read metadata tags in images?

 Download for Mac or Windows

Print ObjectsProductivity
How do I print objects?

 Download for Mac or Windows

Replicate DirectoryDevelopment Environment
How do I replicate directories?

 Download for Mac or Windows

Replicate InvoicesDevelopment Environment
How do I replicate invoices?

 Download for Mac or Windows

Replicate with ClauseDevelopment Environment
How do I replicate a directory using a WHERE clause?

 Download for Mac or Windows

SQL AliasesDatabase
How do I use aliases in SQL?

 Download for Mac or Windows

Superimpose ImagesUser Interface
How do I superimpose pictures?

 Download for Mac or Windows

Synchronize DirectoriesDatabase
How do I synchronize directories?

 Download for Mac or Windows

Synchronize Multiple SitesDatabase
How do I synchronize multiple sites with their headquarters?

 Download for Mac or Windows

UnicodeDevelopment Environment
How do I use Unicode with the PROCESS HTML TAGS command?

 Download for Mac or Windows

Web AreaInternet & Mobility
How do I use Web Area in different ways?

 Download for Mac or Windows

XML ImprovementsData Handling
How do I use 4D v12's enhances XML features?

 Download for Mac or Windows

XML over HTTPData Handling
How do I use XML over HTTP?

 Download for Mac or Windows

FormsUser Interface
Seven "How Do I?" examples on using forms in 4D v11 SQL

 Download for Mac or Windows

InterfaceUser Interface
Six "How Do I?" example applications on creating various interface elements.

 Download for Mac or Windows

WebInternet & Mobility
Four "How Do I?" examples on how to use various Web features of 4D v11 SQL

 Download for Mac or Windows

XMLData Handling
How do I generate an XML tree via DOM?

 Download for Mac or Windows