|
|
|
|
|
- Default value
- Adaptation to ANSI/Unicode
- ANSI string
- Unicode string
- Different types of strings
- extension attribute
- Notes
String (Variable type) In french: String
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. 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.
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 (""). 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. 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.
A "String" variable is limited to 2 GB.. Indirectly, functions manipulating character strings are affected by this limit.
Related Examples:
|
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
|
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|