ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

New WINDEV and WEBDEV 2024 feature!
Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Miscellaneous WINDEV functions
  • Properties specific to WLanguageCodeFormatting variables
  • WLanguage functions that use WLanguageCodeFormatting variables
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
WLanguageCodeFormatting (Variable type)
In french: CodeWLangageMiseEnForme
The WLanguageCodeFormatting type is used to define all the WLanguage code formatting options. These options can be defined and changed using different WLanguage properties.
Remark: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Example
// String to format
sCode is ANSI string = "
CodeFormatting is WLanguageCodeFormatting
CodeFormatting.Language = languageEnglish
CodeFormatting.Indentation = True
CodeFormatting.IncludeCSSDeclarations = True
CodeFormatting.IgnoreCompilationError = True
CodeFormatting.KeywordCase = WLanguageCodeKeywordLowercase
CodeFormatting.Theme = WLanguageCodeThemeDark
CodeFormatting.Format = WLanguageCodeFormatHTML
bufHTMLRes is Buffer = CodeFormatting.Format(sCode)
"
CodeFormatting is WLanguageCodeFormatting
CodeFormatting.Language = languageEnglish
CodeFormatting.Indentation = True
CodeFormatting.IncludeCSSDeclarations = True
CodeFormatting.IgnoreCompilationError = True
CodeFormatting.KeywordCase = WLanguageCodeKeywordLowercase
CodeFormatting.Theme = WLanguageCodeThemeDark
CodeFormatting.Format = WLanguageCodeFormatHTML
bufHTMLRes is Buffer = WLanguageCodeFormatting(CodeFormatting, sCode)

// Display content in an HTML Display control
HTM_NoName1 = UTF8ToString(bufHTMLRes)
Properties

Properties specific to WLanguageCodeFormatting variables

The following properties can be used to handle the WLanguage code formatting options:
Property nameType usedEffect
KeywordCaseInteger constantUppercase or lowercase characters to be used for keywords:
  • WLanguageCodeKeywordUppercase: Keywords are in uppercase.
  • WLanguageCodeKeywordLowercase: Keywords are in lowercase.
CompilationWLanguageCodeCompiling variableCompilation options (allowed functions, forbidden functions, etc.).
FormatInteger constantCode format:
  • WLanguageCodeFormatText (Default value): Simple text.
  • WLanguageCodeFormatHTML: Text in HTML format.
IgnoreCompilationErrorBoolean
  • True to ignore compilation errors. Formatting and syntax highlighting will be less accurate.
  • False (default value) otherwise.
IncludeCSSDeclarationsBoolean
  • True (default) to include the CSS declarations required for formatting and highlighting in the formatted code. This property is taken into account only if the Format property is set to WLanguageCodeFormatHTML.
  • False not to include CSS declarations. In this case, you can get them using WLanguageCodeGetCSSDeclarations.
IndentationBoolean
  • True to enable indentation,
  • False (default) to disable indentation.
LanguageInteger constantLanguage of code to be generated:
  • 0 (Default value): no translation, the code remains in its current language.
  • languageFrench: the code is translated into French.
  • languageEnglish: the code is translated into English.
Remark: Only keywords, variable types, functions and properties are translated.
ThemeInteger constantTheme used for syntax highlighting:
  • WLanguageCodeThemeLight: Light theme is used.
  • WLanguageCodeThemeGray: Gray theme is used.
  • WLanguageCodeThemeDark: Dark theme is used.
Remarks

WLanguage functions that use WLanguageCodeFormatting variables

WLanguageCodeFormatting variables can be handled using the following WLanguage functions:
New in version 2024
WLanguageCodeFormat
Applies formatting to WLanguage code: syntax highlighting, style standardization, indentation, translation, etc.
Minimum version required
  • Version 2024
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 02/26/2024

Send a report | Local help