B4J Question [Solved] TextEngine.TagParser.ErrorString persisting

bdunkleysmith

Active Member
Licensed User
Longtime User
This post follows my previous post Capture BCTextEngine error text where @Erel advised TextEngine.TagParser.ErrorString would provide details of the error encountered by the parser so I could provide feedback to the user via a message box.

However I have found that if I purposely delete a tag to create an error which displays the message box as expected and then reinsert the tag in the txtBBCode textbox, it continues to throw the error.

The attached project demonstrates that.

Click on the Test Text button to display the BBCode:

1683093906636.png


Delete the b tag and click the Test Text button again to see the error message box:

1683094055462.png


Reinsert the b to restore it to its original state and click the Test Text button again. Unexpectedly the error message box appears:

1683094168334.png


It seems the parser needs to be reset or re-initialised to clear the error, but how?

Thanks in anticipation of any assistance.
 

Attachments

  • ScrollTest.zip
    103.1 KB · Views: 68
Solution
1. jMsgboxes is never needed. Use xui.MsgboxAsync instead.
2. Please don't upload fxml layouts in projects that I'm expected to test. It only makes things more complicated.
3. The error happens in BBScrollingLabel. I'll release a fix.

bdunkleysmith

Active Member
Licensed User
Longtime User
I have examined BCTextEngine.bas which is part of BCTextEngine.b4xlib to see if I can see why the error persists in subsequent runs even though the input text which created the initial error has been corrected.

I'm a bit out of my depth delving into b4xlib code and so I'd really like someone to try my simple project to see if they also encounter the problem.

Thanks again in anticipation of any assistance.
 
Upvote 0

bdunkleysmith

Active Member
Licensed User
Longtime User
1. jMsgboxes is never needed. Use xui.MsgboxAsync instead.

Perhaps I'm a dinosaur, just reusing code that I've used before and so I will look to update going forward to xui.MsgboxAsync.


2. Please don't upload fxml layouts in projects that I'm expected to test. It only makes things more complicated.

I used a fxml layout because this is part of the legacy project I referred to in this post [Solved] Add BBScrollingLabel to legacy form created in Scene Builder and so retained it in the example project in case it was a factor in the prolematic behavior, but I will take note of your comment if I have to upload projects for testing purposes in the future.

3. The error happens in BBScrollingLabel. I'll release a fix.

Thank you very much @Erel, I can confirm the update of the [B4X] BBScrollingLabel - rich text scrolling label library to 1.04 fixes the problem I encountered.
 
Upvote 0
Top