Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicPythonRubySQL ServerSwiftTclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcel

VBScript Examples


ASN.1
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Service Bus
Bounced Email
Box
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
ECC
Email Object
Encryption
FTP
Facebook
Firebase
GeoOp
Google APIs
Google Calendar
Google Cloud Storage
Google Drive
Gzip
HTML-to-XML/Text
HTTP
HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)

Jira
MHT / HTML Email
MIME
Microsoft Graph
NTLM
OAuth1
OAuth2
OneDrive
OpenSSL
Outlook
PEM
PFX/P12
POP3
PRNG
PayPal
Peoplevox
QuickBooks
REST
REST Misc
RSA Encryption
SCP
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
SharePoint
Shopify
Socket/SSL/TLS
Spider
Stream
Stripe
SugarCRM
Tar Archive
Twitter
VoiceBase
Walmart
WebSocket
XML
XML Digital Signatures
XMP
Xero
Zip
curl
eBay

 

 

 

(VBScript) Load a JsonArray

Demonstrates how to load a JsonArray.

Note: This example requires Chilkat v9.5.0.64 or greater.

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

Dim fso, outFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set outFile = fso.CreateTextFile("output.txt", True)

'  This example requires Chilkat v9.5.0.64 or greater.

'  Loading into a new JSON array is simple and straightforward.
set a = CreateObject("Chilkat_9_5_0.JsonArray")
success = a.Load("[ 1,2,3,4 ]")

'  Output:  [1,2,3,4]
outFile.WriteLine(a.Emit())
outFile.WriteLine("--------")

'  The JsonArray's Load and LoadSb methods have a peculiar behavior when
'  it is already part of a JSON document.  In this case, the JsonArray
'  becomes detached, and the original document remains unchanged.
'  This is intentional due to the nature of the internal implementation.
'  For example:

set json = CreateObject("Chilkat_9_5_0.JsonObject")
success = json.Load("{ ""abc"": [ 1,2,3,4 ] }")

'  Output:  (json) {"abc":[1,2,3,4]}
outFile.WriteLine("(json) " & json.Emit())
outFile.WriteLine("--------")

' abc is a Chilkat_9_5_0.JsonArray
Set abc = json.ArrayOf("abc")
'  When Load is called, abc becomes it's own document, and the original is not modified.
success = abc.Load("[ 5,6,7,8 ]")

'  Output: (abc) [5,6,7,8]
outFile.WriteLine("(abc) " & abc.Emit())
outFile.WriteLine("--------")

'  Output: (json) {"abc":[1,2,3,4]}
outFile.WriteLine("(json) " & json.Emit())
outFile.WriteLine("--------")


outFile.Close

 

© 2000-2016 Chilkat Software, Inc. All Rights Reserved.