rcdmk / aspJSON

A fast classic ASP JSON parser and encoder for easy JSON manipulation to work with the new JavaScript MV* libraries and frameworks.
MIT License
204 stars 89 forks source link

LCID e Multiarray problem #45

Closed vicedriver closed 6 years ago

vicedriver commented 7 years ago
  1. You should fix: actualLCID = Response.LCID to actualLCID = Session.LCID

  2. I think there's an issue with multidimensional array, for example:

Dim jsonObj set jsonObj = new JSONobject Dim qa(2,1)

qa(0,0) = "Question1" qa(0,1) = "Answer1" qa(1,0) = "Question2" qa(1,1) = "Answer2" qa(2,0) = "Question3" qa(2,1) = "Answer3"

jsonObj.add "QA", qa jsonObj.write

The result is: "Subscript out of range: 'j'" on public function serializeArray(byref arr)

rcdmk commented 7 years ago

Hi. The LCID is intentional. Wherever you set the LCID, it will always be available through the Response object.

I'll take a look at the multidimensional array soon.

BTW, have you tried the multidimensional array on the test.asp page?

vicedriver commented 7 years ago

Hello Ricardo,

I understood the use of the LCID, but I think you should use Session.LCID and not Response.LCID to get the code.

The multidimensional arrays have a problem in the refereed function, during the for cicle.

Thanks and congratulations for the excellent job.

Regards Luis Abreu

rcdmk commented 7 years ago

Hi Luis.

I'm Brazilian as you may know, but I prefer to write in English so everyone that come to this page with the same doubts and problems can understand it.

I can set the Response and Page LCID without setting the Session.LCID property. There is a chain of value inheritance in Session > Page > Request. I choose to use Request as it will always have the LCID value, independently of it being set on Session or Page level.

I still got no time to try the multidimensional array code.
Do the multidimensional array example in test.asp page work for you? (set testAdd = true to see it working)

Thank you very much.

vicedriver commented 7 years ago

Hello,

I've tested the test.asp and it works, but try to change redim multArr(1, 1) to redim multArr(2, 1) and it crashes. As far as I could see, if the array don't have width and length it crashes.

rcdmk commented 6 years ago

Sorry for taking so long to answer. I'll work on this soon.

vicedriver commented 6 years ago

Thank you.