My favorites | Sign in
Project Logo
                
Details: Show all Hide all

Last 30 days

  • Nov 29, 2009
    issue 13 (Exception on encountering \unnnn) changed by tugrultopuz   -   The class haven't parse json string capabilities. parseJSON function hasn't define in the class. Look at source code http://code.google.com/p/aspjson/source/browse/trunk/JSON.vbs
    Status: Invalid
    Owner: tugrultopuz
    The class haven't parse json string capabilities. parseJSON function hasn't define in the class. Look at source code http://code.google.com/p/aspjson/source/browse/trunk/JSON.vbs
    Status: Invalid
    Owner: tugrultopuz
  • Nov 29, 2009
    issue 13 (Exception on encountering \unnnn) reported by elearningcorner   -   What steps will reproduce the problem? 1. parseJSON( "{""test"":""\uefff""}" ) What is the expected output? What do you see instead? It pulls an index out of range error on line 96 What version of the product are you using? On what operating system? Version 2.0.3 Please provide any additional information below. Change line 95 to read: If charcode >= 0 AND charcode < 127 Then
    What steps will reproduce the problem? 1. parseJSON( "{""test"":""\uefff""}" ) What is the expected output? What do you see instead? It pulls an index out of range error on line 96 What version of the product are you using? On what operating system? Version 2.0.3 Please provide any additional information below. Change line 95 to read: If charcode >= 0 AND charcode < 127 Then
  • Nov 27, 2009
    PropJsString (jsCore jsString property.) Wiki page commented on by neerajnim   -   frgvsrgferf
    frgvsrgferf
  • Nov 24, 2009
    Samples2 (JSON Objects data structure.) Wiki page commented on by tugrultopuz   -   You must use any JSON parser. If you will read from web browser (IE,FF,etc...), you must use a JavaScript library (jQuery, etc...).
    You must use any JSON parser. If you will read from web browser (IE,FF,etc...), you must use a JavaScript library (jQuery, etc...).
  • Nov 23, 2009
    Samples2 (JSON Objects data structure.) Wiki page commented on by fryit09   -   this is all make json. How can I read the json code?
    this is all make json. How can I read the json code?

Earlier this year

  • Nov 12, 2009
    Samples2 (JSON Objects data structure.) Wiki page edited by tugrultopuz   -   Revision r60 Edited wiki page through web user interface.
    Revision r60 Edited wiki page through web user interface.
  • Nov 12, 2009
    Samples (Self Primitive Datatypes.) Wiki page edited by tugrultopuz   -   Revision r59 Edited wiki page through web user interface.
    Revision r59 Edited wiki page through web user interface.
  • Nov 12, 2009
    Samples2 (JSON Objects data structure.) Wiki page commented on by tugrultopuz   -   {{{ Dim obj : Set obj = jsObject() obj("name") = "david" Set obj("to") = jsObject() obj("to")("name") = "bb" obj("to")("x") = "97082" obj("to")("y") = "37193" Set obj("message") = jsArray() Set obj("message")(Null) = jsObject() obj("message")(Null)("a") = 6 obj("message")(Null)("b") = 8 Set obj("message")(Null) = jsObject() obj("message")(Null)("a") = 6 obj("message")(Null)("b") = 8 obj.Flush }}}
    {{{ Dim obj : Set obj = jsObject() obj("name") = "david" Set obj("to") = jsObject() obj("to")("name") = "bb" obj("to")("x") = "97082" obj("to")("y") = "37193" Set obj("message") = jsArray() Set obj("message")(Null) = jsObject() obj("message")(Null)("a") = 6 obj("message")(Null)("b") = 8 Set obj("message")(Null) = jsObject() obj("message")(Null)("a") = 6 obj("message")(Null)("b") = 8 obj.Flush }}}
  • Nov 12, 2009
    Samples2 (JSON Objects data structure.) Wiki page commented on by tugrultopuz   -   {{{ Dim obj : Set obj = jsObject() ' creating base object obj("name") = "david" ' creating string property on the base object Set obj("to") = jsObject() ' creating object property on the base object obj("to")("name") = "bb" ' adding item into object obj("to")("x") = "97082" ' adding item into object obj("to")("y") = "37193" ' adding item into object Set obj("message") = jsArray() ' creating array property on the base object Set obj("message")(Null) = jsObject() ' creating object into array obj("message")(Null)("a") = 6 ' adding item into object obj("message")(Null)("b") = 8 ' adding item into object Set obj("message")(Null) = jsObject() ' creating object into array obj("message")(Null)("a") = 6 ' adding item into object obj("message")(Null)("b") = 8 ' adding item into object obj.Flush ' flushing json result }}}
    {{{ Dim obj : Set obj = jsObject() ' creating base object obj("name") = "david" ' creating string property on the base object Set obj("to") = jsObject() ' creating object property on the base object obj("to")("name") = "bb" ' adding item into object obj("to")("x") = "97082" ' adding item into object obj("to")("y") = "37193" ' adding item into object Set obj("message") = jsArray() ' creating array property on the base object Set obj("message")(Null) = jsObject() ' creating object into array obj("message")(Null)("a") = 6 ' adding item into object obj("message")(Null)("b") = 8 ' adding item into object Set obj("message")(Null) = jsObject() ' creating object into array obj("message")(Null)("a") = 6 ' adding item into object obj("message")(Null)("b") = 8 ' adding item into object obj.Flush ' flushing json result }}}
  • Nov 09, 2009
    issue 8 (Missing array elements) Status changed by tugrultopuz   -  
    Status: Fixed
    Status: Fixed
  • Nov 09, 2009
    issue 2 (Unicode characters are encoded with \uXXXX ) Status changed by tugrultopuz   -  
    Status: Invalid
    Status: Invalid
  • Nov 09, 2009
    issue 11 (poor jsEncode performance) changed by tugrultopuz   -  
    Status: Fixed
    Labels: Performance
    Status: Fixed
    Labels: Performance
  • Nov 09, 2009
    issue 9 (jsObject() breaks at 10) Status changed by tugrultopuz   -  
    Status: Fixed
    Status: Fixed
  • Nov 09, 2009
    issue 4 (Error ToJSON( ) ) Status changed by tugrultopuz   -  
    Status: Fixed
    Status: Fixed
  • Nov 09, 2009
    JSON_2.0.3.asp (ASP JSON (for production)) file uploaded by tugrultopuz   -  
    Labels: OpSys-Windows Type-Source Featured
    Labels: OpSys-Windows Type-Source Featured
  • Nov 09, 2009
    JSON_2.0.3.vbs (WSH JSON (for cli testing purposes)) file uploaded by tugrultopuz   -  
    Labels: OpSys-Windows Type-Source Featured
    Labels: OpSys-Windows Type-Source Featured
  • Nov 09, 2009
    r58 (Fixed multi dimensional arrays index problem and string enco...) committed by tugrultopuz   -   Fixed multi dimensional arrays index problem and string encode speed tweak
    Fixed multi dimensional arrays index problem and string encode speed tweak
  • Nov 09, 2009
    r57 (string encode bug fixed and added clone functions) committed by tugrultopuz   -   string encode bug fixed and added clone functions
    string encode bug fixed and added clone functions
  • Nov 09, 2009
    r56 (This is base release) committed by tugrultopuz   -   This is base release
    This is base release
  • Nov 08, 2009
    issue 11 (poor jsEncode performance) changed by tugrultopuz   -  
    Status: Accepted
    Owner: tugrultopuz
    Labels: Type-Enhancement Type-Defect
    Status: Accepted
    Owner: tugrultopuz
    Labels: Type-Enhancement Type-Defect
  • Nov 08, 2009
    issue 12 (jsEncode can produce strings that raise "Unterminated String...) changed by tugrultopuz   -   This is a browser bug like Internet Explorer suck. Non acceptable solution.
    Status: Invalid
    Owner: tugrultopuz
    This is a browser bug like Internet Explorer suck. Non acceptable solution.
    Status: Invalid
    Owner: tugrultopuz
  • Nov 08, 2009
    issue 10 (Connection String for SQL Server??) Status changed by tugrultopuz   -  
    Status: Done
    Status: Done
  • Nov 08, 2009
    issue 6 (problem with empty values...) Status changed by tugrultopuz   -  
    Status: Fixed
    Status: Fixed
  • Nov 08, 2009
    issue 9 (jsObject() breaks at 10) changed by tugrultopuz   -  
    Status: Started
    Owner: tugrultopuz
    Status: Started
    Owner: tugrultopuz
  • Nov 08, 2009
    issue 4 (Error ToJSON( ) ) Status changed by tugrultopuz   -  
    Status: Started
    Status: Started
  • Sep 24, 2009
    issue 12 (jsEncode can produce strings that raise "Unterminated String...) reported by braamo   -   What steps will reproduce the problem? 1. Add a string element to the JSON collection that ends with Carriage Return + Line Feed. 2. Attempt to use the toJSON'ed output of the JSON object in JavaScript. The result is that the string value ends in "\r\n", however an "Unterminated String Constant" error occurs. 3. Manually removing the \r\n sequence from the JSON output allows the code to complete without error. 4. Based on guidance from http://planetlotus.org/profiles/wohill_53390, double-escaping the \r\n to \\r\\n also allows the code to complete without error. What is the expected output? What do you see instead? Based on http://planetlotus.org/profiles/wohill_53390, the expected output from including a CR + LF sequence in a JSON string is \\r\\n. ASPJSON outputs \r\n. What version of the product are you using? On what operating system? Server: ASPJSON 2.0.2 on IIS for Windows XP SP2 Client: Firefox 3.0.14 on Windows XP SP2 Please provide any additional information below. ASPJSON 2.0.2 jsEncode can be modified to produce the required output by inserting the following code at line 77: if (c = Chr(13) or c = Chr(10)) then jsEncode = jsEncode & "\" end if Unsure whether this issue affects CR+LF sequences not at the end of the string, nor other sequences that need to be escaped with a \ (e.g. \' \" etc)
    What steps will reproduce the problem? 1. Add a string element to the JSON collection that ends with Carriage Return + Line Feed. 2. Attempt to use the toJSON'ed output of the JSON object in JavaScript. The result is that the string value ends in "\r\n", however an "Unterminated String Constant" error occurs. 3. Manually removing the \r\n sequence from the JSON output allows the code to complete without error. 4. Based on guidance from http://planetlotus.org/profiles/wohill_53390, double-escaping the \r\n to \\r\\n also allows the code to complete without error. What is the expected output? What do you see instead? Based on http://planetlotus.org/profiles/wohill_53390, the expected output from including a CR + LF sequence in a JSON string is \\r\\n. ASPJSON outputs \r\n. What version of the product are you using? On what operating system? Server: ASPJSON 2.0.2 on IIS for Windows XP SP2 Client: Firefox 3.0.14 on Windows XP SP2 Please provide any additional information below. ASPJSON 2.0.2 jsEncode can be modified to produce the required output by inserting the following code at line 77: if (c = Chr(13) or c = Chr(10)) then jsEncode = jsEncode & "\" end if Unsure whether this issue affects CR+LF sequences not at the end of the string, nor other sequences that need to be escaped with a \ (e.g. \' \" etc)
  • Aug 13, 2009
    Samples (Self Primitive Datatypes.) Wiki page commented on by paul_lau...@yahoo.com   -   above you said that json2 would have a json to asp object but I cannot see one in version 2.0.2? Is it there? Is there an example of using it?
    above you said that json2 would have a json to asp object but I cannot see one in version 2.0.2? Is it there? Is there an example of using it?
  • Aug 12, 2009
    issue 11 (poor jsEncode performance) commented on by darkman13   -   jsEncode(str) has a problem. It doesn't work with mulitibyte language string as parameter (like "尖첨密謐" ) so, I change source code For i = 1 To Len(str) c = Mid(str, i, 1) a = AscW(c) If a < 127 Then For i = 1 To Len(str) c = Mid(str, i, 1) a = AscW(c) If a > 31 And a < 127 Then
    jsEncode(str) has a problem. It doesn't work with mulitibyte language string as parameter (like "尖첨密謐" ) so, I change source code For i = 1 To Len(str) c = Mid(str, i, 1) a = AscW(c) If a < 127 Then For i = 1 To Len(str) c = Mid(str, i, 1) a = AscW(c) If a > 31 And a < 127 Then
  • Jul 28, 2009
    issue 11 (poor jsEncode performance) commented on by gvanvreckem   -   Function jsEncod8(str) Dim i, j, s, l, c, a, cv(127), js() cv(8)="\b": cv(9)="\t": cv(10)="\n": cv(12)="\f": cv(13)="\r": cv(34)="\""": cv(47)="\/": cv(92)="\\" j = 0: s = 1: l=0 Redim js(len(str)) For i = 1 To Len(str) c = Mid(str, i, 1) a = AscW(c) If a < 127 Then If IsEmpty(cv(a)) Then If a > 31 Then l = l + 1 Else js(j) = Mid(str, s, l) & "\u" & Right("000" & Hex(a),4) l = 0: j = j + 1: s = i + 1 End If Else js(j) = Mid(str, s, l) & cv(a) l = 0: j = j + 1: s = i + 1 End if Else js(j) = Mid(str, s, l) & "\u" & Right("000" & Hex(a),4) l = 0: j = j + 1: s = i + 1 End If Next js(j) = Mid(str, s, l) jsEncod8 = Join(js,"") End Function
    Function jsEncod8(str) Dim i, j, s, l, c, a, cv(127), js() cv(8)="\b": cv(9)="\t": cv(10)="\n": cv(12)="\f": cv(13)="\r": cv(34)="\""": cv(47)="\/": cv(92)="\\" j = 0: s = 1: l=0 Redim js(len(str)) For i = 1 To Len(str) c = Mid(str, i, 1) a = AscW(c) If a < 127 Then If IsEmpty(cv(a)) Then If a > 31 Then l = l + 1 Else js(j) = Mid(str, s, l) & "\u" & Right("000" & Hex(a),4) l = 0: j = j + 1: s = i + 1 End If Else js(j) = Mid(str, s, l) & cv(a) l = 0: j = j + 1: s = i + 1 End if Else js(j) = Mid(str, s, l) & "\u" & Right("000" & Hex(a),4) l = 0: j = j + 1: s = i + 1 End If Next js(j) = Mid(str, s, l) jsEncod8 = Join(js,"") End Function
  • Jul 28, 2009
    issue 11 (poor jsEncode performance) commented on by gvanvreckem   -   correction to faster code (previous one could miss the last char group) Function jsEncode(str) Dim i, j, s, l, c, a, cv(127), js() cv(8)="\b": cv(9)="\t": cv(10)="\n": cv(12)="\f": cv(13)="\r": cv(34)="\""": cv(47)="\/": cv(92)="\\" j = 0: s = 1: l=0 Redim js(len(str)) For i = 1 To Len(str) c = Mid(str, i, 1) a = AscW(c) If a < 127 Then If IsEmpty(cv(a)) Then If a > 31 Then l = l + 1 Else js(j) = Mid(str, s, l) & "\u" & Right("000" & Hex(a),4) l = 0: j = j + 1: s = i + 1 End If Else js(j) = Mid(str, s, l) & cv(a) l = 0: j = j + 1: s = i + 1 End if Else js(j) = Mid(str, s, l) & "\u" & Right("000" & Hex(a),4) l = 0: j = j + 1: s = i + 1 End If Next jsEncode = Join(js,"") & Mid(str, s, l) End Function
    correction to faster code (previous one could miss the last char group) Function jsEncode(str) Dim i, j, s, l, c, a, cv(127), js() cv(8)="\b": cv(9)="\t": cv(10)="\n": cv(12)="\f": cv(13)="\r": cv(34)="\""": cv(47)="\/": cv(92)="\\" j = 0: s = 1: l=0 Redim js(len(str)) For i = 1 To Len(str) c = Mid(str, i, 1) a = AscW(c) If a < 127 Then If IsEmpty(cv(a)) Then If a > 31 Then l = l + 1 Else js(j) = Mid(str, s, l) & "\u" & Right("000" & Hex(a),4) l = 0: j = j + 1: s = i + 1 End If Else js(j) = Mid(str, s, l) & cv(a) l = 0: j = j + 1: s = i + 1 End if Else js(j) = Mid(str, s, l) & "\u" & Right("000" & Hex(a),4) l = 0: j = j + 1: s = i + 1 End If Next jsEncode = Join(js,"") & Mid(str, s, l) End Function
  • Jul 28, 2009
    issue 11 (poor jsEncode performance) reported by gvanvreckem   -   jsEncode average speed: IIS5: 10 KB/s to 100KB/s IIS7: 10 KB/s to 168KB/s (results depend on string size, slower on longer strings) My proposed code speed: IIS5: 306 KB/s to 360KB/s IIS7: 360 KB/s to 580KB/s (result now depends on characters, faster on ascii, slower on Chinese) What version of the product are you using? On what operating system? JSON2.0.2.asp, Tested speed on IIS5 Windows 2000 & IIS7 Windows 2008 proposed code (3x to 50x faster): Function jsEncode(str) Dim i, j, s, l, c, p, a, cv(127), js() cv(8)="\b": cv(9)="\t": cv(10)="\n": cv(12)="\f": cv(13)="\r": cv(34)="\""": cv(47)="\/": cv(92)="\\" j = 0: s = 1 Redim js(len(str)) For i = 1 To Len(str) c = Mid(str, i, 1) a = AscW(c) If a < 127 Then If IsEmpty(cv(a)) Then If a > 31 Then l = l + 1 Else js(j) = Mid(str, s, l) & "\u" & Right("000" & Hex(a),4) l = 0: j = j + 1: s = i + 1 End If Else js(j) = Mid(str, s, l) & cv(a) l = 0: j = j + 1: s = i + 1 End if Else js(j) = Mid(str, s, l) & "\u" & Right("000" & Hex(a),4) l = 0: j = j + 1: s = i + 1 End If Next jsEncode = Join(js,"") End Function Actual code for reference: Function jsEncode(str) Dim i, j, aL1, aL2, c, p aL1 = Array(&h22, &h5C, &h2F, &h08, &h0C, &h0A, &h0D, &h09) aL2 = Array(&h22, &h5C, &h2F, &h62, &h66, &h6E, &h72, &h74) For i = 1 To Len(str) p = True c = Mid(str, i, 1) For j = 0 To 7 If c = Chr(aL1(j)) Then jsEncode = jsEncode & "\" & Chr(aL2(j)) p = False Exit For End If Next If p Then Dim a a = AscW(c) If a > 31 And a < 127 Then jsEncode = jsEncode & c ElseIf a > -1 Or a < 65535 Then jsEncode = jsEncode & "\u" & String(4 - Len(Hex(a)), "0") & Hex(a) End If End If Next End Function
    jsEncode average speed: IIS5: 10 KB/s to 100KB/s IIS7: 10 KB/s to 168KB/s (results depend on string size, slower on longer strings) My proposed code speed: IIS5: 306 KB/s to 360KB/s IIS7: 360 KB/s to 580KB/s (result now depends on characters, faster on ascii, slower on Chinese) What version of the product are you using? On what operating system? JSON2.0.2.asp, Tested speed on IIS5 Windows 2000 & IIS7 Windows 2008 proposed code (3x to 50x faster): Function jsEncode(str) Dim i, j, s, l, c, p, a, cv(127), js() cv(8)="\b": cv(9)="\t": cv(10)="\n": cv(12)="\f": cv(13)="\r": cv(34)="\""": cv(47)="\/": cv(92)="\\" j = 0: s = 1 Redim js(len(str)) For i = 1 To Len(str) c = Mid(str, i, 1) a = AscW(c) If a < 127 Then If IsEmpty(cv(a)) Then If a > 31 Then l = l + 1 Else js(j) = Mid(str, s, l) & "\u" & Right("000" & Hex(a),4) l = 0: j = j + 1: s = i + 1 End If Else js(j) = Mid(str, s, l) & cv(a) l = 0: j = j + 1: s = i + 1 End if Else js(j) = Mid(str, s, l) & "\u" & Right("000" & Hex(a),4) l = 0: j = j + 1: s = i + 1 End If Next jsEncode = Join(js,"") End Function Actual code for reference: Function jsEncode(str) Dim i, j, aL1, aL2, c, p aL1 = Array(&h22, &h5C, &h2F, &h08, &h0C, &h0A, &h0D, &h09) aL2 = Array(&h22, &h5C, &h2F, &h62, &h66, &h6E, &h72, &h74) For i = 1 To Len(str) p = True c = Mid(str, i, 1) For j = 0 To 7 If c = Chr(aL1(j)) Then jsEncode = jsEncode & "\" & Chr(aL2(j)) p = False Exit For End If Next If p Then Dim a a = AscW(c) If a > 31 And a < 127 Then jsEncode = jsEncode & c ElseIf a > -1 Or a < 65535 Then jsEncode = jsEncode & "\u" & String(4 - Len(Hex(a)), "0") & Hex(a) End If End If Next End Function
  • Jul 03, 2009
    issue 8 (Missing array elements) commented on by mark.palkhivala   -   tugrultopuz, I have provided a working solution for this problem under Issue 9 . Please merge it into your code if it is acceptable. Thank you for all your work Cheers, Mark
    tugrultopuz, I have provided a working solution for this problem under Issue 9 . Please merge it into your code if it is acceptable. Thank you for all your work Cheers, Mark
  • Jul 02, 2009
    issue 4 (Error ToJSON( ) ) commented on by mark.palkhivala   -   tugrultopuz, I have provided a working solution for this problem under Issue 9 . Please merge it into your code if it is acceptable. Thank you for all your work Cheers, Mark
    tugrultopuz, I have provided a working solution for this problem under Issue 9 . Please merge it into your code if it is acceptable. Thank you for all your work Cheers, Mark
  • Jul 02, 2009
    issue 9 (jsObject() breaks at 10) commented on by mark.palkhivala   -   A Proposed fix for Function MultiArray to handle array dimensions > 9 Function MultiArray(aBD, iBC, sPS, ByRef sPT) ' Array BoDy, Integer BaseCount, String PoSition Dim iDU, iDL, i, er ' Integer DimensionUBound, Integer DimensionLBound On Error Resume Next iDL = LBound(aBD, iBC) iDU = UBound(aBD, iBC) er = Err.Number On Error Goto 0 Dim sPB ' String PointBuffer1, String PointBuffer2 If er = 9 Then If UBound(sPT)=-1 Then sPB = sPS Else sPB=Join(sPT,",") & "," & sPS MultiArray = MultiArray & toJSON(Eval("aBD(" & sPB & ")")) Else If VarType(sPT)<>8204 Then sPT=Array() If sPS<>"" Then ReDim Preserve sPT(UBound(sPT)+1) sPT(UBound(sPT)) = sPS End If MultiArray = MultiArray & "[" For i = iDL To iDU MultiArray = MultiArray & MultiArray(aBD, iBC + 1, i, sPT) If i < iDU Then MultiArray = MultiArray & "," Next MultiArray = MultiArray & "]" If UBound(sPT)>0 Then ReDim Preserve sPT(UBound(sPT)-1) Else sPT=Array() End If End Function
    A Proposed fix for Function MultiArray to handle array dimensions > 9 Function MultiArray(aBD, iBC, sPS, ByRef sPT) ' Array BoDy, Integer BaseCount, String PoSition Dim iDU, iDL, i, er ' Integer DimensionUBound, Integer DimensionLBound On Error Resume Next iDL = LBound(aBD, iBC) iDU = UBound(aBD, iBC) er = Err.Number On Error Goto 0 Dim sPB ' String PointBuffer1, String PointBuffer2 If er = 9 Then If UBound(sPT)=-1 Then sPB = sPS Else sPB=Join(sPT,",") & "," & sPS MultiArray = MultiArray & toJSON(Eval("aBD(" & sPB & ")")) Else If VarType(sPT)<>8204 Then sPT=Array() If sPS<>"" Then ReDim Preserve sPT(UBound(sPT)+1) sPT(UBound(sPT)) = sPS End If MultiArray = MultiArray & "[" For i = iDL To iDU MultiArray = MultiArray & MultiArray(aBD, iBC + 1, i, sPT) If i < iDU Then MultiArray = MultiArray & "," Next MultiArray = MultiArray & "]" If UBound(sPT)>0 Then ReDim Preserve sPT(UBound(sPT)-1) Else sPT=Array() End If End Function
  • Jul 02, 2009
    issue 9 (jsObject() breaks at 10) commented on by mark.palkhivala   -   A proposed fix for MultiArray not handling arrays with any dimension > 9 Function MultiArray(aBD, iBC, sPS, ByRef sPT) ' Array BoDy, Integer BaseCount, String PoSition Dim iDU, iDL, i, er ' Integer DimensionUBound, Integer DimensionLBound On Error Resume Next iDL = LBound(aBD, iBC) iDU = UBound(aBD, iBC) er = Err.Number Err.Clear On Error Goto 0 Dim sPB1, sPB2 ' String PointBuffer1, String PointBuffer2 If er = 9 Then If UBound(sPT)=-1 Then sPB2 = sPS Else sPB2=Join(sPT,",") & "," & sPS End If MultiArray = MultiArray & toJSON(Eval("aBD(" & sPB2 & ")")) Else If VarType(sPT)<>8204 Then sPT=Array() If sPS<>"" Then ReDim Preserve sPT(UBound(sPT)+1) sPT(UBound(sPT)) = sPS End If MultiArray = MultiArray & "[" For i = iDL To iDU MultiArray = MultiArray & MultiArray(aBD, iBC + 1, i, sPT) If i < iDU Then MultiArray = MultiArray & "," Next MultiArray = MultiArray & "]" If UBound(sPT)>0 Then ReDim Preserve sPT(UBound(sPT)-1) Else sPT=Array() End If End Function
    A proposed fix for MultiArray not handling arrays with any dimension > 9 Function MultiArray(aBD, iBC, sPS, ByRef sPT) ' Array BoDy, Integer BaseCount, String PoSition Dim iDU, iDL, i, er ' Integer DimensionUBound, Integer DimensionLBound On Error Resume Next iDL = LBound(aBD, iBC) iDU = UBound(aBD, iBC) er = Err.Number Err.Clear On Error Goto 0 Dim sPB1, sPB2 ' String PointBuffer1, String PointBuffer2 If er = 9 Then If UBound(sPT)=-1 Then sPB2 = sPS Else sPB2=Join(sPT,",") & "," & sPS End If MultiArray = MultiArray & toJSON(Eval("aBD(" & sPB2 & ")")) Else If VarType(sPT)<>8204 Then sPT=Array() If sPS<>"" Then ReDim Preserve sPT(UBound(sPT)+1) sPT(UBound(sPT)) = sPS End If MultiArray = MultiArray & "[" For i = iDL To iDU MultiArray = MultiArray & MultiArray(aBD, iBC + 1, i, sPT) If i < iDU Then MultiArray = MultiArray & "," Next MultiArray = MultiArray & "]" If UBound(sPT)>0 Then ReDim Preserve sPT(UBound(sPT)-1) Else sPT=Array() End If End Function
  • May 13, 2009
    issue 10 (Connection String for SQL Server??) commented on by siamdaytrip   -   I already known. This code is OK!.. <% Dim dbstr, dbconn dbstr = "Provider=SQLOLEDB; Data Source = (local); Initial Catalog = [databasename]; User Id = [user]; Password=[pwd]" Set dbconn = CreateObject("ADODB.Connection") dbconn.Provider = dbstr dbconn.Open dbstr QueryToJSON(dbconn, "SELECT top 10 companyname FROM company").Flush %> Art.
    I already known. This code is OK!.. <% Dim dbstr, dbconn dbstr = "Provider=SQLOLEDB; Data Source = (local); Initial Catalog = [databasename]; User Id = [user]; Password=[pwd]" Set dbconn = CreateObject("ADODB.Connection") dbconn.Provider = dbstr dbconn.Open dbstr QueryToJSON(dbconn, "SELECT top 10 companyname FROM company").Flush %> Art.
  • May 13, 2009
    issue 10 (Connection String for SQL Server??) reported by siamdaytrip   -   Please give me an example. Thanks Art.
    Please give me an example. Thanks Art.
  • Apr 09, 2009
    issue 9 (jsObject() breaks at 10) commented on by saichholzer   -   Yes, this seems to fix the issue: line 144: 'If i <> 1 Then sPB2 = sPB2 & ","
    Yes, this seems to fix the issue: line 144: 'If i <> 1 Then sPB2 = sPB2 & ","
  • Apr 09, 2009
    issue 9 (jsObject() breaks at 10) reported by saichholzer   -   var user = 20 ReDim member(users) For usr = 0 to users Set member(usr) = jsObject() member(usr)("id") = usr member(usr)("num_a") = usr member(usr)("num_b") = usr member(usr)("num_c") = usr member(usr)("num_d") = usr Next response.write toJSON(member) The code is a sample only, however it works fine but it breaks at usr = 10, seem ths jsObject() can't handle numbers above 9
    var user = 20 ReDim member(users) For usr = 0 to users Set member(usr) = jsObject() member(usr)("id") = usr member(usr)("num_a") = usr member(usr)("num_b") = usr member(usr)("num_c") = usr member(usr)("num_d") = usr Next response.write toJSON(member) The code is a sample only, however it works fine but it breaks at usr = 10, seem ths jsObject() can't handle numbers above 9
  • Feb 06, 2009
    issue 4 (Error ToJSON( ) ) commented on by tugrultopuz   -   Yes, the problem there. However, this solution is not valid.
    Yes, the problem there. However, this solution is not valid.
  • Feb 05, 2009
    issue 4 (Error ToJSON( ) ) commented on by c...@litian.net   -   line 144: 'If i <> 1 Then sPB2 = sPB2 & ","
    line 144: 'If i <> 1 Then sPB2 = sPB2 & ","
  • Feb 04, 2009
    issue 8 (Missing array elements) commented on by tugrultopuz   -   replace Set jsReturn = QueryToJSON(dbCon.Execute(sql), sql) with Set jsReturn = QueryToJSON(dbCon, sql)
    replace Set jsReturn = QueryToJSON(dbCon.Execute(sql), sql) with Set jsReturn = QueryToJSON(dbCon, sql)
  • Feb 04, 2009
    issue 8 (Missing array elements) changed by tugrultopuz   -   Array render function have a problem. http://code.google.com/p/aspjson/issues/detail?id=4&can=1 You may use to alternative method temoprary. For example sql = "SELECT DISTINCT mv.F0 FROM MatrixValidation mv WHERE mv.MatrixID = 1 ORDER BY mv.F0" dbCon.Open() Set jsReturn = QueryToJSON(dbCon.Execute(sql), sql) dbCon.Close() For Each jsProp in jsReturn.Collection jsReturn(jsProp) = jsReturn(jsProp)("F0") Next jsReturn.Flush ' or Response.Write jsReturn.jsString
    Status: Accepted
    Owner: tugrultopuz
    Labels: Priority-High Priority-Medium
    Array render function have a problem. http://code.google.com/p/aspjson/issues/detail?id=4&can=1 You may use to alternative method temoprary. For example sql = "SELECT DISTINCT mv.F0 FROM MatrixValidation mv WHERE mv.MatrixID = 1 ORDER BY mv.F0" dbCon.Open() Set jsReturn = QueryToJSON(dbCon.Execute(sql), sql) dbCon.Close() For Each jsProp in jsReturn.Collection jsReturn(jsProp) = jsReturn(jsProp)("F0") Next jsReturn.Flush ' or Response.Write jsReturn.jsString
    Status: Accepted
    Owner: tugrultopuz
    Labels: Priority-High Priority-Medium
  • Feb 03, 2009
    issue 8 (Missing array elements) reported by JoePPerkins   -   What steps will reproduce the problem? sql = "SELECT DISTINCT mv.F0 FROM MatrixValidation mv WHERE mv.MatrixID = 1 ORDER BY mv.F0" dbCon.Open() Set rsReturn = dbCon.Execute(sql) arr = rsReturn.GetRows() dbCon.Close() Response.Write toJSON(arr) What is the expected output? What do you see instead? [["Master of Education: Technology in Education","Master of Health Services Administration","Master of Public Administration","Master of Science in Professional Accounting: Accounting Information Systems","Master of Science in Professional Accounting: Controllership","Master of Science in Professional Accounting: Taxation","MBA: Information Systems Management Concentration","MBA: Accounting Concentration","MBA: Acquisition","MBA: Finance","MBA: Healthcare Concentration","MBA: Hospitality and Tourism Management","MBA: Human Resource Management","MBA: International Business Concentration","MBA: Management","MBA: Marketing","MBA: Professional Studies Concentration","MBA: Project Management Concentration","MBA: Public Administration Concentration","MBA: Supply Chain Management","MSIS: Computer Security Management","MSIS: Decision Support System Management","MSIS: Enterprise Resource Management","MSIS: Network Management","MSIS: Software Engineering Management","MSIS: Systems Development Management"]] JSON_2.0.2.asp output [["Master of Education: Educational Management","Master of Education: Technology in Education","Master of Health Services Administration","Master of Public Administration","Master of Science in Professional Accounting: Accounting Information Systems","Master of Science in Professional Accounting: Controllership","Master of Science in Professional Accounting: Taxation","MBA: Information Systems Management Concentration","MBA: Accounting Concentration","MBA: Acquisition",,,,,,,,,,,,,,,,,]] What version of the product are you using? On what operating system? JSON_2.0.2 SERVER 2003\XP Please provide any additional information below.
    What steps will reproduce the problem? sql = "SELECT DISTINCT mv.F0 FROM MatrixValidation mv WHERE mv.MatrixID = 1 ORDER BY mv.F0" dbCon.Open() Set rsReturn = dbCon.Execute(sql) arr = rsReturn.GetRows() dbCon.Close() Response.Write toJSON(arr) What is the expected output? What do you see instead? [["Master of Education: Technology in Education","Master of Health Services Administration","Master of Public Administration","Master of Science in Professional Accounting: Accounting Information Systems","Master of Science in Professional Accounting: Controllership","Master of Science in Professional Accounting: Taxation","MBA: Information Systems Management Concentration","MBA: Accounting Concentration","MBA: Acquisition","MBA: Finance","MBA: Healthcare Concentration","MBA: Hospitality and Tourism Management","MBA: Human Resource Management","MBA: International Business Concentration","MBA: Management","MBA: Marketing","MBA: Professional Studies Concentration","MBA: Project Management Concentration","MBA: Public Administration Concentration","MBA: Supply Chain Management","MSIS: Computer Security Management","MSIS: Decision Support System Management","MSIS: Enterprise Resource Management","MSIS: Network Management","MSIS: Software Engineering Management","MSIS: Systems Development Management"]] JSON_2.0.2.asp output [["Master of Education: Educational Management","Master of Education: Technology in Education","Master of Health Services Administration","Master of Public Administration","Master of Science in Professional Accounting: Accounting Information Systems","Master of Science in Professional Accounting: Controllership","Master of Science in Professional Accounting: Taxation","MBA: Information Systems Management Concentration","MBA: Accounting Concentration","MBA: Acquisition",,,,,,,,,,,,,,,,,]] What version of the product are you using? On what operating system? JSON_2.0.2 SERVER 2003\XP Please provide any additional information below.
  • Jan 07, 2009
    issue 5 (Connection String Example) commented on by tugrultopuz   -   Dim od Set od = jsObject() Set od("data") = jsArray() Set od("data")(Null) = jsObject() od("data")(Null)("header1") = "something" od("data")(Null)("header2") = "something" od("data")(Null)("header3") = "something" od("data")(Null)("header4") = "something" od("data")(Null)("header5") = 2 od.Flush
    Dim od Set od = jsObject() Set od("data") = jsArray() Set od("data")(Null) = jsObject() od("data")(Null)("header1") = "something" od("data")(Null)("header2") = "something" od("data")(Null)("header3") = "something" od("data")(Null)("header4") = "something" od("data")(Null)("header5") = 2 od.Flush
  • Jan 07, 2009
    issue 6 (problem with empty values...) commented on by timucinkizilay   -   I had to find a quick fix so I left the real fix to you. :) Now it's up to you for the fixed version. (JSON_2.0.3.asp) My email is timucinkizilay at gmail.com. you can contact me from this email.
    I had to find a quick fix so I left the real fix to you. :) Now it's up to you for the fixed version. (JSON_2.0.3.asp) My email is timucinkizilay at gmail.com. you can contact me from this email.
  • Jan 07, 2009
    issue 6 (problem with empty values...) changed by tugrultopuz   -   This solution correctly but isn't reuseble. For example {{{ member("Sonuc") = 0 member("Mesaj") = "Tamam" member("Test") = Test If IsEmpty(member("Test")) Then ' ???? ' bammmm End If }}} We must check in render time, {{{ Class jsCore ... Public Function toJSON(vPair) Select Case VarType(vPair) Case 0 ' Empty toJSON = "" Case 1 ' Null toJSON = "null" ... }}} I'm live near Istanbul, in Yalova. How to contact with us?
    Status: Accepted
    Owner: tugrultopuz
    This solution correctly but isn't reuseble. For example {{{ member("Sonuc") = 0 member("Mesaj") = "Tamam" member("Test") = Test If IsEmpty(member("Test")) Then ' ???? ' bammmm End If }}} We must check in render time, {{{ Class jsCore ... Public Function toJSON(vPair) Select Case VarType(vPair) Case 0 ' Empty toJSON = "" Case 1 ' Null toJSON = "null" ... }}} I'm live near Istanbul, in Yalova. How to contact with us?
    Status: Accepted
    Owner: tugrultopuz
  • Jan 07, 2009
    issue 5 (Connection String Example) commented on by s_s...@btinternet.com   -   Thanks for your example, cool! I do have another question: Most examples require the format to be disaplyed as: {"data": [{"header1": "something","header2": "something","header3": "something","header4": "so mething","header4": "something","header5": 2}]} i.e. the data outside the output is this something the script can do?
    Thanks for your example, cool! I do have another question: Most examples require the format to be disaplyed as: {"data": [{"header1": "something","header2": "something","header3": "something","header4": "so mething","header4": "something","header5": 2}]} i.e. the data outside the output is this something the script can do?
  • Jan 05, 2009
    issue 6 (problem with empty values...) reported by timucinkizilay   -   What steps will reproduce the problem? 1. in the below code: Set member = jsObject() member("Sonuc") = 0 member("Mesaj") = "Tamam" member("Test") = Test member.Flush ---- if one of the variables is empty, the returned json gives parseerror. What is the expected output? What do you see instead? The output should be like this : ---------- {"Sonuc":0,"Mesaj":"Tamam","Test":""} ---------- But, if the variable Test is empty then the result was like this : ---------- {"Sonuc":0,"Mesaj":"Tamam","Test":} ---------- What version of the product are you using? On what operating system? I'm using JSON_2.0.2.asp on a classic asp project running on windows 2000 server. Please provide any additional information below. I've found a quick solution to this problem by adding modifying this code : I've put these lines -------- if isempty(v) then v = "" end if -------- to this function: -------- ' - data maluplation ' -- pair Public Property Let Pair(p, v) if isempty(v) then v = "" end if If IsNull(p) Then p = Counter Collection(p) = v End Property -------- Maybe you'll find a better solutions but this is now working for me... BTW, Thanks for the code. Your code was simplest to implement and saved me time... if you are in Istanbul, I can buy you a coffee (or beer, whatever you want :)
    What steps will reproduce the problem? 1. in the below code: Set member = jsObject() member("Sonuc") = 0 member("Mesaj") = "Tamam" member("Test") = Test member.Flush ---- if one of the variables is empty, the returned json gives parseerror. What is the expected output? What do you see instead? The output should be like this : ---------- {"Sonuc":0,"Mesaj":"Tamam","Test":""} ---------- But, if the variable Test is empty then the result was like this : ---------- {"Sonuc":0,"Mesaj":"Tamam","Test":} ---------- What version of the product are you using? On what operating system? I'm using JSON_2.0.2.asp on a classic asp project running on windows 2000 server. Please provide any additional information below. I've found a quick solution to this problem by adding modifying this code : I've put these lines -------- if isempty(v) then v = "" end if -------- to this function: -------- ' - data maluplation ' -- pair Public Property Let Pair(p, v) if isempty(v) then v = "" end if If IsNull(p) Then p = Counter Collection(p) = v End Property -------- Maybe you'll find a better solutions but this is now working for me... BTW, Thanks for the code. Your code was simplest to implement and saved me time... if you are in Istanbul, I can buy you a coffee (or beer, whatever you want :)
  • Jan 02, 2009
    issue 5 (Connection String Example) changed by tugrultopuz   -   <% Dim dbstr, dbconn dbstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\test.mdb;User Id=;Password=;" Set dbconn = CreateObject("ADODB.Connection") dbconn.Provider = dbstr dbconn.Open QueryToJSON(dbconn, "SELECT name, surname FROM login").Flush %> best regards
    Status: Verified
    Labels: Type-Other Type-Defect Priority-Medium
    <% Dim dbstr, dbconn dbstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\test.mdb;User Id=;Password=;" Set dbconn = CreateObject("ADODB.Connection") dbconn.Provider = dbstr dbconn.Open QueryToJSON(dbconn, "SELECT name, surname FROM login").Flush %> best regards
    Status: Verified
    Labels: Type-Other Type-Defect Priority-Medium
 
Hosted by Google Code