Having fun with HTMLViewer.Load(String, FolderItem)

I already fall in that trap sometimes ago. This night (around 4:00), it comes back and hit me one again.

I use HTMLViewer.Load(String, FolderItem) and it works fine. Most of the times, the FolderItem points to a place on an external HD/SSD. But not tonight (energy saving and other…

  1. the returned error says it was awaiting a file, not a folder when working with the internal HD, the data folder is located in Downloads or Documents.
  2. After sometimes, I plug an external SSD, copy the 2.2GB of data folder into it, select that folder and get no error at all.
  3. So, I checked the documentation and Xojo 2024r3: same trouble.
  4. I saved the html data from the TextArea to internal boot disk, used: HTML_Render.Load(HTML_FI) following the documentation advice and it does not worked.
  5. The above code selecting the internal data folder: no crash. Only a blank HTMLViewer.
  6. Minutes ago, I saved the html data from the TextArea and passed the HTML_FI to HTML_Render.Load(TA.Text, HTML_FI) and run.
    Of course, I was awaiting an error at compile time. But no, no error. Worst, this worked fine.

BTW: I forgot to say, except point 6, all tests were done without internet (none there).

What is wrong ?

Put an htmlViewer into a Window, add a TextArea, Paste some html code in it, add a button and paste code with (from the LR):

Var f As FolderItem = SpecialFolder.Temporary
HTMLViewer1.LoadPage(TextArea1.Value, f)

NB: the LB example does not even follows its own syntax ! (look at the documentation to understand that sentence): HTMLViewer.LoadPage.

Do not forget to read the second syntax below to compare them (the two FolderItems).