Solved

Array Encoding Error

Posted on 2011-03-24
8
355 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
  • 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
 
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
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
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

Are end users causing IT problems again?

You’ve taken the time to design and update all your end user’s email signatures, only to find out they’re messing up the HTML, changing the font and ruining the imagery. What can you do to prevent this? Find out how you can save your signatures from end users today.

Join & Write a Comment

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

759 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now