LoadResString

This function loads a string from a resource (.res) file.

Syntax

LoadResString(index)

Parameters

index
Required. Integer specifying the identifier (ID) of the data in the resource file. The resource whose identifier is 1 is reserved.

Return Values

Returns the number of characters in a string or the number of bytes required to store a variable.

Remarks

You can use the LoadResString function instead of string literals in your code. Storing long strings of data in and accessing them from resource files improves load time because you can load them individually as needed from the resource file, rather than all at once when a form is loaded.

The LoadResString function is useful for localizing an application because the resources that need to be translated are isolated in one resource file; there is no need to access the source code or recompile the application.

The .res file must be included in your project because it is compiled into the .vb file before it is sent to the device. Strings are the only resource type used.