StrPutVar()

Auto Hotkey

StrPut

Copies a string to a variable, optionally converting to or from a given code page.

OutputVar := StrPutVar(String, Variable [, Encoding])
Command  Example: StrPutVar "AutoHotkey", Var, "CP0"
Function Example: size := StrPutVar("AutoHotkey", Var, "CP0")

Parameters

OutputVar

The name of the variable in which to store size of new string in bytes including terminator.

String

Any string. Numbers are also acceptable.

Variable (ByRef)

Output variable to store new string.

Encoding (optional)

The source encoding for StrGet or target encoding for StrPut; for example, "UTF-8", "UTF-16" or "CP936".Specify "CP0" to use the system default ANSI code page. When omitted UTF-8 is used.

Remarks

If conversion between code pages is necessary, the required buffer size may differ from the size of the source String.

Related

Script Compatibility, StrGet,, StrPut, FileEncoding, VarSetCapacity

Examples

MsgBox % StrPutVar("AutoHotkey",var,"CP0")