Previous Thread
Next Thread
Print Thread
xcall JSON opcode 3 & 4 #38002 24 Apr 25 03:10 PM
Joined: Aug 2016
Posts: 411
J
John Andreasen Online Content OP
Member
OP Online Content
Member
J
Joined: Aug 2016
Posts: 411
Hi,

I am attempting to use xcall JSON with opcode 4 to unescape a string. I seem to be experiencing an issue which is reproduceable with the below program.
Code
MAP1 response$,s,132
MAP1 sts,f,6

	response$ = "t"+CHR(34)+"est"
	Trace.Print response$
	XCALL JSON, 3, sts, response$
	Trace.Print sts, response$
	! Process response string.
	XCALL JSON, 4, sts, response$
	Trace.Print sts, response$
	END

Which produces the following traces on 7.0.1770.1 EL7:
response$=[t"est]
sts=[0], response$=[t\"est]
sts=[1], response$=[teest]

It appears that the e gets duplicated and the " gets completely removed with opcode 4.
Also, shouldn't the status from opcode 3 be 1 instead of 0 since 1 character (the quote) was escaped?

Thanks,
John Andreasen
Diversified Data Software

Re: xcall JSON opcode 3 & 4 [Re: John Andreasen] #38003 24 Apr 25 05:35 PM
Joined: Jun 2001
Posts: 11,945
J
Jack McGregor Offline
Member
Offline
Member
J
Joined: Jun 2001
Posts: 11,945
Definitely two bugs there, one of them harmless (the return status on op 3), the other one pretty bad. I think they're both fixed in 1771.4 ...

ash-7.0.1771.4-w32-upd.zip
ash-7.0.1771.4-w32c-upd.zip
ash-7.0.1771.4-d12-x86_64-upd.tz

Re: xcall JSON opcode 3 & 4 [Re: John Andreasen] #38004 25 Apr 25 10:48 AM
Joined: Aug 2016
Posts: 411
J
John Andreasen Online Content OP
Member
OP Online Content
Member
J
Joined: Aug 2016
Posts: 411
OK, thanks for the fix. It is working for me now as well.


Moderated by  Jack McGregor, Ty Griffin 

Powered by UBB.threads™ PHP Forum Software 7.7.3