|
|
|
|
|
- Default value
- Adaptation to ANSI/Unicode
- ANSI string
- UNICODE string
- Different types of strings
- extension attribute
- Notes
- Default value
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.
FirstName is string
FirstName = "Florence"
Syntax
Declaring and initializing a "String" variable Hide the details
<Variable name> is [ANSI] [UNICODE] string = <Value> OR
<Variable name> is [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 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 Variable-length string containing UNICODE characters only. 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 appear along with all the data in the dump file: this makes it impossible to determine what the string looks like, where it starts and where it ends.
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: MyStringInMemory is string <undetectable> MyStringInMemory = "Password" 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.
Default value - A declared and uninitialized "String" variable corresponds to an empty string ("").
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…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|