Solved

Array Encoding Error

Posted on 2011-03-24
8
372 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Redirected folders in a windows domain can be quite useful for a number of reasons, one of them being that with redirected application data, you can give users more seamless experience when logging into different workstations.  For example, if a use…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
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 …

695 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