Skip to content

Commit

Permalink
v2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
timhall committed Nov 5, 2015
1 parent 1948b09 commit 8b2a839
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
6 changes: 5 additions & 1 deletion JsonConverter.bas
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Attribute VB_Name = "JsonConverter"
''
' VBA-JSON v1.0.3
' VBA-JSON v2.0.0
' (c) Tim Hall - https://github.com/VBA-tools/VBA-JSON
'
' JSON Converter for VBA
Expand Down Expand Up @@ -133,7 +133,11 @@ Private Type json_Options
' By default, VBA-JSON will use String for numbers longer than 15 characters that contain only digits
' to override set `JsonConverter.JsonOptions.UseDoubleForLargeNumbers = True`
UseDoubleForLargeNumbers As Boolean

' The JSON standard requires object keys to be quoted (" or '), use this option to allow unquoted keys
AllowUnquotedKeys As Boolean

' The solidus (/) is not required to be escaped, use this option to escape them as \/ in ConvertToJson
EscapeSolidus As Boolean
End Type
Public JsonOptions As json_Options
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# VBA-JSON

JSON conversion and parsing for VBA (Windows and Mac Excel, Access, and other Office applications).
It grew out of the excellent project [vba-json](https://code.google.com/p/vba-json/),
JSON conversion and parsing for VBA (Windows and Mac Excel, Access, and other Office applications).
It grew out of the excellent project [vba-json](https://code.google.com/p/vba-json/),
with additions and improvements made to resolve bugs and improve performance (as part of [VBA-Web](https://github.com/VBA-tools/VBA-Web)).

Tested in Windows Excel 2013 and Excel for Mac 2011, but should apply to 2007+.
Tested in Windows Excel 2013 and Excel for Mac 2011, but should apply to 2007+.

- For Windows-only support, include a reference to "Microsoft Scripting Runtime"
- For Mac and Windows support, include [VBA-Dictionary](https://github.com/VBA-tools/VBA-Dictionary).
Expand All @@ -20,7 +20,7 @@ Set Json = JsonConverter.ParseJSON("{""a"":123,""b"":[1,2,3,4],""c"":{""d"":456}
' Json("c")("d") -> 456
Json("c")("e") = 789

Debug.Print JsonConverter.ConvertToJson(Json)
Debug.Print JsonConverter.ConvertToJson(Json)
' -> "{""a"":123,""b"":[1,2,3,4],""c"":{""d"":456,""e"":789}}"
```

Expand All @@ -32,4 +32,8 @@ VBA-JSON includes a few options for customizing parsing/conversion if needed:
This can lead to issues when BIGINT's are used (e.g. for Ids or Credit Cards), as they will be invalid above 15 digits.
By default, VBA-JSON will use `String` for numbers longer than 15 characters that contain only digits, use this option to use `Double` instead.
- __AllowUnquotedKeys__ (Default = `False`) The JSON standard requires object keys to be quoted (`"` or `'`), use this option to allow unquoted keys.
- __EscapeSolidus__ (Default = `False`) The solidus (/) is not required to be escaped, use this option to escape them as `\/` in `ConvertToJson`.
- __EscapeSolidus__ (Default = `False`) The solidus (`/`) is not required to be escaped, use this option to escape them as `\/` in `ConvertToJson`.

```VB.net
JsonConverter.JsonOptions.EscapeSolidus = True
```
Binary file modified specs/VBA-JSON - Specs.xlsm
Binary file not shown.

0 comments on commit 8b2a839

Please sign in to comment.