Sample code for 30+ languages & platforms
AutoIt

Appending Strings to BinData

Demonstrates appending strings to a BinData..

Chilkat AutoIt Downloads

AutoIt
$oBinData1 = ObjCreate("Chilkat.BinData")

; Append a string using a 1-byte per char encoding
$oBinData1.AppendString("This is a test","windows-1252")
ConsoleWrite($oBinData1.GetEncoded("hex") & @CRLF)
; The bytes contained within the binData1 (in hex) are: 54,68,69,73,20,69, ...

$oBinData2 = ObjCreate("Chilkat.BinData")

; Append a string using a 2-byte per char encoding
$oBinData2.AppendString("This is a test","utf-16")
ConsoleWrite($oBinData2.GetEncoded("hex") & @CRLF)
; The bytes contained within the binData2 (in hex) are: 54,00,68,00,69,00,73,00,20,00,69,00, ...