Solved

Array Encoding Error

Posted on 2011-03-24
8
368 Views
Last Modified: 2012-05-11
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
Comment
Question by:souldj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 
LVL 2

Accepted Solution

by:
khaaz earned 250 total points
ID: 35205372
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
 
LVL 39

Assisted Solution

by:Pratima Pharande
Pratima Pharande earned 250 total points
ID: 35205381
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
 
LVL 1

Author Comment

by:souldj
ID: 35205394
Khazz,

i still get

RESPONSE CODE : rspcode=W56

RESPONSE CODE : "1.0" encoding

RESPONSE DESCRIPTION : [No Transaction Record]
0
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 
LVL 1

Author Comment

by:souldj
ID: 35205407
Pratima_MCS

RESPONSE CODE : rspcode=W56

RESPONSE CODE : "1.0" encoding

RESPONSE DESCRIPTION : [No Transaction Record]

Same thing :-(
0
 
LVL 1

Author Comment

by:souldj
ID: 35205450
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
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 35205453
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
 
LVL 1

Author Closing Comment

by:souldj
ID: 35205456
solved the problem myself with help.

Thanks guys
0
 
LVL 2

Expert Comment

by:khaaz
ID: 35205470
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Scenario:  You do full backups to a internal hard drive in either product (SBS or Server 2008).  All goes well for a very long time.  One day, backups begin to fail with a message that the disk is full.  Your disk contains many, many more backups th…
If you migrate a Terminal Server licenses server inside the 2008 server family, you can takte advantage of the build-in migration tool. If you like to migrate an older 2003 Server (and the installed client CALs) to a 2008 R2 server for example, you …
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question