I posted a screenshot rather than the code so you could see the error.
Putting the IF statements highlighted in yellow on their own lines solved the problem.
Only ONE if statement on the same line with a colon is required to cause the error.
Note that the failure is in the NESTED IF, not the outer IF.
The reason this was hard to debug is the nested if was added (I think) while working on the B4A version so I didn't see a problem until I came back to B4J which is where the problem code is used..
The
log error also threw me off.
I remmed the #If and found the error was in both B4A and B4J
(Note that CallBack is just a variable name.)
Here is the Log Error:
Yes, if I was doing this today I would use regex to split the file. This is a B4X mod of code that has been working for 25 years. The B4X mod itself is over 5 years old. Why reinvent the wheel and confuse my partner?
I like using the : to keep code on the same line when I have short, repeating, similar blocks of code. Let's me see more on the screen - but screen resolutions are a lot better today than they were 40 years ago and monitors are a lot bigger. It wouldn't break my heart if you removed that feature.
I am grateful that a compile error was thrown rather than some weirdness when the code runs. As always you do a fantastic job! Love working with B4X.
Putting the IF statements highlighted in yellow on their own lines solved the problem.
Only ONE if statement on the same line with a colon is required to cause the error.
Note that the failure is in the NESTED IF, not the outer IF.
The reason this was hard to debug is the nested if was added (I think) while working on the B4A version so I didn't see a problem until I came back to B4J which is where the problem code is used..
The
B4X:
'catch' expected
I remmed the #If and found the error was in both B4A and B4J
(Note that CallBack is just a variable name.)
Here is the Log Error:
Yes, if I was doing this today I would use regex to split the file. This is a B4X mod of code that has been working for 25 years. The B4X mod itself is over 5 years old. Why reinvent the wheel and confuse my partner?
I like using the : to keep code on the same line when I have short, repeating, similar blocks of code. Let's me see more on the screen - but screen resolutions are a lot better today than they were 40 years ago and monitors are a lot bigger. It wouldn't break my heart if you removed that feature.
I am grateful that a compile error was thrown rather than some weirdness when the code runs. As always you do a fantastic job! Love working with B4X.