ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage syntax / WLanguage types
  • Default value
  • Adaptation to ANSI/Unicode
  • ANSI string
  • Unicode string
  • Different types of strings
  • extension attribute
  • Notes
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
The String type is used to manipulate strings. This type of variable is a string with a size defined dynamically.
The "string" type is specific to the WLanguage. With this type, there is no need to declare the length of the string. It can change when the variable is used.
The String type supports null values. For more details, see Allowing nullable types.
Remarks:
  • The Buffer type is also available. This type corresponds to a binary memory area. It allows you to write code for raw data manipulation, usable in both WINDEV and WINDEV Mobile.
  • For a variable of type String, TypeVar returns the wlString constant (value: 16).
  • A String variable can contain a single-line string, a multiline string or a dynamically built string including variables. For more details, see String literals.
Example
Prénom is string
Prénom = "Florence"
Syntax

Declaring and initializing a "String" variable Hide the details

<Nom de la variable> is an [ANSI] [Unicode] string = <Valeur>
OR

<Nom de la variable> is an [ANSI] [Unicode] string
<Variable name> = <Value>
<Variable name>:
Name of the variable to declare. When several variables of the same type are declared and initialized on the same line, only the last variable is initialized.
<ANSI>: Optional
Indicates that the string is an ANSI string. If this parameter is not specified, the string format will adapt to the format defined for the platform. For more details, see Adaptation to ANSI/Unicode.
<Unicode>: Optional
Indicates that the string is a Unicode character string. If this parameter is not specified, the string format will adapt to the format defined for the platform. For more details, see Adaptation to ANSI/Unicode.
<Value>:
Value given to the variable.
Remarks

Default value

A declared and uninitialized "String" variable corresponds to an empty string ("").

Adaptation to ANSI/Unicode

  • AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst This type of string is in Unicode format.
Reminder: To modify string management in the current configuration:
  1. Open the project description window. To do so, go to the "Project" tab, "Project" group, and click "Description".
  2. On the "Project" tab, click "Configuration description".
  3. In the window that appears, go to the "Unicode" tab and select the desired mode.

ANSI string

Variable-length string containing ANSI characters only. This format is required to handle:
  • XML files,
  • RTF files,
  • PDF files,
  • functions that use UTF8 format, etc.

Unicode string

Dynamic size string containing only Unicode characters.
AndroidAndroid Widget This type of character string is not supported. It is replaced with the String type.

Different types of strings

WLanguage also offers the following string types:

<undetectable> extension attribute

The <undetectable> extension attribute obfuscates the value of a string stored in memory (for example, in a memory dump file).
By default, (if the <undetectable> extension attribute is not specified), all characters assigned to a String variable are visible in a memory dump file. These characters are visible among all the information present in the dump: it is not possible to identify the beginning and end of the string, and there is no way of identifying what the string corresponds to..

The <undetectable> attribute obfuscates the value stored in memory. The value of the string cannot be determined based on the visible characters in the dump file.
This extension attribute is particularly useful to store a username or password in memory, to pass a password to HPass, or to connect to a database.
Example:
MaChaîneMémoire is string <undetectable>
MaChaîneMémoire = "MotDePasse"
Remarks:
  • Using the <undetectable> extension attribute can slow down the application. It should only be used on strings that require that attribute.
  • The <undetectable> extension attribute is not available for fixed-length strings.
Notes
A "String" variable is limited to 2 GB.. Indirectly, functions manipulating character strings are affected by this limit.
Related Examples:
Different types of strings Unit examples (WINDEV): Different types of strings
[ + ] Using the different types of strings available in WINDEV.
The specific features of each type are presented in details.
Types used:
- "Standard" string
- UNICODE string
- Fixed string
- Pascal String
- ASCIIZ String
- Buffer type
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/20/2024

Send a report | Local help