B4J Question Resumable sub try ...catch / error

proinko

Member
Licensed User
Longtime User
hi

i need to catch the error caused by a non JSON statement returned by a httjob inside a resumable sub. Without the try - catch lines (commented on the attached code) , the sub works (no problem compiling . It only crash when the response is not a JSON statement). But when i uncomment the try - catch lines, i get the following error when compiling:

B4J version: 5.50
Parsing code. (0.01s)
Compiling code. (0.01s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
Compiling generated Java code. Error
B4J line: 91
Try
javac 1.8.0_131
src\b4j\SyncRepData\main.java:333: error: illegal '.'
this..catchState = 37;
^
1 error

this is the code:

B4X:
	Dim j As HttpJob
	j.Initialize("", Me) 
	j.Download("http://www...../...php")
	j.GetRequest.Timeout=30000
	Wait For (j) JobDone(j As HttpJob)
	If j.Success Then
		Log(j.GetString)
		Dim jp As JSONParser
		'Try
			jp.Initialize(j.GetString)
			Dim Rows As List = jp.NextArray
			Dim commands As List
			commands.Initialize
			For Each row As Map In Rows
				
			Next
				
		'Catch
			'
		'End Try
	Else
		
	End If
	j.Release

what can be the illegal '.' ? what am i doing wrong?

thanks for your help
 

Daestrum

Expert
Licensed User
Longtime User
Looks like a typo in the generated java code, one too many dots
B4X:
this..catchState = 37;
should read
B4X:
this.catchState = 37;
 
Upvote 0

proinko

Member
Licensed User
Longtime User
Thanks Erel for your time. I work with B4J in 4 different computers, and forgot to check the most obvious solution in this one ... :oops:
 
Upvote 0
Top