(VBScript) Load StringTable from a StringBuilder
Demonstrates how to load a StringTable from the text contained in a Chilkat StringBuilder object.
Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
'Create a Unicode (utf-16) output text file.
Set outFile = fso.CreateTextFile("output.txt", True, True)
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.StringTable")
set strTab = CreateObject("Chilkat.StringTable")
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.StringBuilder")
set sb = CreateObject("Chilkat.StringBuilder")
success = sb.Append("This is line 1" & vbCrLf)
success = sb.Append("An empty line follows..." & vbCrLf)
success = sb.Append(vbCrLf)
success = sb.Append("This is line 4" & vbCrLf)
success = strTab.AppendFromSb(sb)
i = 0
numStrings = strTab.Count
Do While i < numStrings
outFile.WriteLine(i & ": " & strTab.StringAt(i))
i = i + 1
Loop
outFile.Close
|