Interesting. How would you handle a fallback, if the include is not available?
Next thinBasic beta will have the possibility to #INCLUDE sources directly from the a web page using HTTP or HTTPS.
It can be used to quickly test something published from others or to refer to library maintained in the web
Example:
I think it will be necessary to add new features like a web #INCLUDE defined inside a parent web #INCLUDE.'---Test include from Web #INCLUDE "https://raw.githubusercontent.com/petrSchreiber/SmartTexture/master/smartTexture.tbasicu" Dim t As SmartTexture t.FromFile("C:\myImage.png") t.Make(1, %TBGL_TEX_MIPMAP)
Anyway let's start and we will see.
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Interesting. How would you handle a fallback, if the include is not available?
Actually if problem is related to no internet connection, I can trap it easily.
But if internet connection is OK and the problem is related to the file, it is more difficult to trap it.
Usually web servers reply with some html code telling "file not found" but that page is a personalized page so every server can reply in different ways.
I found some info about how to get it: http://stackoverflow.com/questions/1...-using-wininet
using HttpQueryInfo. I will try to apply.
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
OK, I think I've got the following situations:
- error connecting to internet
- file not found
- other errors are considered generic errors with a specific error code that maybe we will detect in details in future releases
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Eros...
Petr
Learn 3D graphics with ThinBASIC, learn TBGL!
Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB
Sounds like a good plan
Bookmarks