[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 379
  • Last Modified:

Array Encoding Error

I have an array that when I try to split further throws an error.

        rspcode = ptbc(0)
        rspdesc = ptbc(1)

         Response.Write "<p> <b>RESPONSE CODE </b>: " & ptbc(0) & "<p>" --'
       
        rspcodetext = Split(ptbc(0),"=")
        Response.Write "<p> <b>RESPONSE CODE </b>: " & rspcodetext(1) & "<p>"
        rspdesctext = Split(rspdesc,"=")
        Response.Write "<p> <b>RESPONSE DESCRIPTION </b>: " & rspdesctext(1) & "<p>"


Results are

PAYMENT TXN CODE : rspcode=W56&rspdesc=[No Transaction Record]

RESPONSE CODE : rspcode=W56

 -- splitting the response code above gives this error ----

RESPONSE CODE : "1.0" encoding

-----------------------------------------------------------

RESPONSE DESCRIPTION : [No Transaction Record]

Help!
0
souldj
Asked:
souldj
  • 4
  • 2
  • 2
2 Solutions
 
khaazCommented:
what happens if you try :

        rspcode = ptbc(0)
        rspdesc = ptbc(1)

         Response.Write "<p> <b>RESPONSE CODE </b>: " & ptbc(0) & "<p>" --'
       
        rspcodetext = Split(rspcode,"=")
        Response.Write "<p> <b>RESPONSE CODE </b>: " & rspcodetext(1) & "<p>"
        rspdesctext = Split(rspdesc,"=")
        Response.Write "<p> <b>RESPONSE DESCRIPTION </b>: " & rspdesctext(1) & "<p>"

Open in new window

0
 
Pratima PharandeCommented:
try this


        rspcode = ptbc(0)
        rspdesc = ptbc(1)

         Response.Write "<p> <b>RESPONSE CODE </b>: " & ptbc(0) & "<p>" --'
       
        rspcodetext = Split(ptbc(0),"=")
        Response.Write "<p> <b>RESPONSE CODE </b>: " & rspcodetext(1) & "<p>"
        rspdesctext = Split(ptbc(1),"=")
        Response.Write "<p> <b>RESPONSE DESCRIPTION </b>: " & rspdesctext(1) & "<p>"
0
 
souldjAuthor Commented:
Khazz,

i still get

RESPONSE CODE : rspcode=W56

RESPONSE CODE : "1.0" encoding

RESPONSE DESCRIPTION : [No Transaction Record]
0
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

 
souldjAuthor Commented:
Pratima_MCS

RESPONSE CODE : rspcode=W56

RESPONSE CODE : "1.0" encoding

RESPONSE DESCRIPTION : [No Transaction Record]

Same thing :-(
0
 
souldjAuthor Commented:
Solved the Problem.


        rspcodetext = Split(ptbc(0),"code=")
       ' Response.Write "<p> <b>RESPONSE CODE </b>: " & rspcodetext(1) & "<p>"
       rspdesctext = Split(rspdesc,"=")


Told it to look for "code=" as this was always a constant.

Thanks guys

Will share the knowledge with all as you all guided.
0
 
Pratima PharandeCommented:
code looks like correct ..
do you have someting like this on your page
<?xml version='" + "1.0" + "' encoding='" + "utf-8"

try with diff varibale name

rspcode = ptbc(0)
        rspdesc = ptbc(1)

         Response.Write "<p> <b>RESPONSE CODE </b>: " & ptbc(0) & "<p>" --'
       
        rspcodetext1 = Split(ptbc(0),"=")
        Response.Write "<p> <b>RESPONSE CODE </b>: " & rspcodetext1 (1) & "<p>"
        rspdesctext = Split(rspdesc,"=")
        Response.Write "<p> <b>RESPONSE DESCRIPTION </b>: " & rspdesctext(1) & "<p>"
0
 
souldjAuthor Commented:
solved the problem myself with help.

Thanks guys
0
 
khaazCommented:
Could you try this :
perhaps you see a '=' but it's not !
  rspcode = ptbc(0)
        rspdesc = ptbc(1)

         Response.Write "<p> <b>RESPONSE CODE </b>: " & ptbc(0) & "<p>" --'
       
        rspcodetext = Split(ptbc(0),"=")
        Response.Write "<p> <b>RESPONSE CODE </b>: " & rspcodetext(0) & "<p>"
        rspdesctext = Split(rspdesc,"=")
        Response.Write "<p> <b>RESPONSE DESCRIPTION </b>: " & rspdesctext(1) & "<p>"

Open in new window

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 4
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now