ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage syntax / 
  • Default value
  • Fixed string
  • Cross-platform code
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 String of type is used to manipulate fixed-length strings. These strings have a null character at the end, denoted by a zero (as in the C programming language). The specified length is the maximum number of characters in the string.
The String of type must be used to send input/output parameters to Windows APIs. This type is also available for compatibility with other programming languages (Turbo Pascal for Windows, C, Visual Basic for Windows, etc.).
Remarks:
  • For a variable of type "String of", TypeVar returns the wlFixedString constant (value: 22).
Example
FirstName is string of 8
FirstName = "Florence"

MyString is string of 10
MyString = "Test"
Syntax

Declaring and initializing a "String of" variable Hide the details

<Variable name> is string of <Length> = <Value>
OR

<Variable name> is string of <Length>
<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.
<Length>:
Maximum length for the string.
<Value>:
Value given to the variable.
Remarks

Default value

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

Fixed string

  • The memory required by a fixed-length string is allocated when the string is declared. Therefore, you should avoid using very large strings.
  • Fixed-length strings are filled with spaces. Initializing and assigning a large string (several hundreds kilobytes) may take a long time.
Windows

Cross-platform code

Fixed-length strings are not available in Java. They are replaced with the String type at runtime.
However, Complete can be used on a String variable:
MyString is string
MyString = Complete("Test", 10)
// Equivalent to 
// MyString is fixed string of 10 characters
// MyString = "Test"
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/29/2024

Send a report | Local help