Page 1 of 2

VB Script

Posted: Tue Jul 16, 2019 2:13 am
by RobertRioja
Is it possible to use VB Script within a SpiderBasic program?
Thanks,
Robert

Re: VB Script

Posted: Tue Jul 16, 2019 11:47 am
by the.weavster
No. SpiderBasic has its own BASIC syntax that gets compiled to JavaScript.

Re: VB Script

Posted: Tue Jul 16, 2019 5:05 pm
by plouf
but it is possible to have JavaScript inline
If this alternative is ok to you

just use ! in front of your jscode

Re: VB Script

Posted: Tue Jul 16, 2019 5:57 pm
by RobertRioja
Thank you for the replies. I am starting to play with SpiderBasic (I use PureBasic a lot). But I cannot find a way to access the local file system. I know that for security reasons browsers cannot access your files directly. Neither HTML nor Javascript can do it. But it can be done with VBScript.

Does anyone know how to read and write local files with SpiderBasic?

Thanks,
Robert

Re: VB Script

Posted: Tue Jul 16, 2019 6:58 pm
by plouf
AFAIK you cant

Re: VB Script

Posted: Tue Jul 16, 2019 7:24 pm
by munfraid
RobertRioja wrote:I cannot find a way to access the local file system. But it can be done with VBScript.
What a nightmare. Thank god it's not supported by any modern browser.

Re: VB Script

Posted: Tue Jul 16, 2019 8:56 pm
by RobertRioja
So please excuse my ignorance, but what is Spiderbasic used for, if you cannot access files? I thought it would be a neat way to do software with a nice GUI and be able to run it on many platforms. But without access to local storage, I don't see much use for it. Maybe it is good for games, but that is not my area. I guess I will stick to PureBasic and similar languages.

Thanks for the info.
Robert

Re: VB Script

Posted: Wed Jul 17, 2019 7:09 am
by the.weavster
You can use PureBasic to create CGIs that can access the file system on the PC they're served from. As a comparison let's compare writing an accounting application in PB with SB+PB:

With PB you'd likely use a database server, say MariaDB, and you'd create an executable that would work with that directly and have to be installed on all client PCs (which would have to be running Linux, Mac or Windows on x86 or x64).

With SB+PB you could make a JSON-RPC server where the UI is in SB but the database read/writes are handled by CGIs written in PB. The server would still have to run Linux, Mac or Windows but the client side could be anything with a browser and there is no client side install required. Another advantage is when you update your app you only need to do that in one place.

Re: VB Script

Posted: Wed Jul 17, 2019 7:10 am
by the.weavster
Oh, and...

SpiderBasic can also be used for creating Android and iOS apps. These can access the file system.

Re: VB Script

Posted: Wed Jul 17, 2019 9:58 am
by saboteur
I'd love to see some examples of using PB to create a (F)CGI and then integrating it with a Siderbasic program.

I've just got database access working as i like it using PHP PDO as this is what i've been used to, but I have no understanding of CGI and tbh SB's help is, well, not a lot of help.

If it wasn't for this forum and the help people like the.weavster and peter have given i'd have given up ages ago.

Back on topic though, is not possible to upload and download files ?? That seem pretty fundamental to many web based programs e.g photoalbum

cheers