PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • The HTML format
  • Edit control in HTML format
  • Overview
  • Remarks:
  • Defining the content of an HTML edit control
  • Saving a text in an HTML file
  • Example
  • Saving text in HTML format in an item of an HFSQL data file
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
The HTML format
The HTML format (HyperText Markup Language) is a tagging language intended for the Web.
WEBDEV allows you to handle text in HTML via the "HTML format" option of the Edit controls and the HTML control.
  • If the text in HTML format is displayed in a control that does not support the HTML format, the tags will be displayed.
  • If the text in HTML format is displayed in a control that supports the HTML format, the tags will be automatically interpreted and the text will be formatted accordingly.
Remark: To use an edit control in HTML format, Microsoft Internet Explorer version 6 (or later) must be installed on the computer that runs the application.
Edit control in HTML format

Overview

An HTML edit control is used to display a text in HTML format and to enter a text in HTML format.
When typing a text in an HTML control, this text is automatically stored in HTML format by the control. This text contains all the tags required for the formatting.

Remarks:

  • A formatting toolbar can be displayed above the edit control. This toolbar allows the user to easily format the text entered. For more details, see HTML formatting toolbar.
  • If the same text is entered in a standard edit control and in an HTML edit control, the character string found in the HTML edit control will be longer than the string found in the standard edit control (because the HTML tags are added).
Defining the content of an HTML edit control
To define the content of an HTML edit control, all you have to do is assign Value through programming (in the initialization code of the control for example).
For example:
// Read an HTML file
HTMLPage is string
HTMLPage = fLoadText(SysDir(srMyDocuments) + ["\"] + "index.html")
 
// Initialize the edit control
EDT_HTMLControl = HTMLPage
Saving a text in an HTML file
In an HTML edit control, the text typed is automatically in HTML format.
To save the content of an edit control in HTML format in an HTML file, all you have to do is use fSaveText on the control.

Example

This example is used to create an "index.html" file. This file contains the text entered in the edit control named EDT_HTMLText.
// Select the path and name of the file
FileName is string
FileName = fSelect("", "", "Select a file...", ...
"HTML files" + TAB + "*.html" + CR + "All files (*.*)" + TAB + "*.*", ...
"HTML", fselCreate + fselExist)
 
// Backup
fSaveText(FileName, EDT_HTMLText)

Saving text in HTML format in an item of an HFSQL data file

To save a text in HTML format in an item of a data file, we advise you to link the edit control to a Text Memo item.
Indeed, as the HTML format includes several tags, a "Character string" item is usually not large enough.
Minimum version required
  • Version 15
Comments
Click [Add] to post a comment