(Visual FoxPro) Appending Strings to BinData
Demonstrates appending strings to a BinData..
LOCAL loBinData1
LOCAL loBinData2
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.BinData')
loBinData1 = CreateObject('Chilkat.BinData')
* Append a string using a 1-byte per char encoding
loBinData1.AppendString("This is a test","windows-1252")
? loBinData1.GetEncoded("hex")
* The bytes contained within the binData1 (in hex) are: 54,68,69,73,20,69, ...
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.BinData')
loBinData2 = CreateObject('Chilkat.BinData')
* Append a string using a 2-byte per char encoding
loBinData2.AppendString("This is a test","utf-16")
? loBinData2.GetEncoded("hex")
* The bytes contained within the binData2 (in hex) are: 54,00,68,00,69,00,73,00,20,00,69,00, ...
RELEASE loBinData1
RELEASE loBinData2
|