Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
BAM: How to embed your program in a web page
#4
(11-10-2022, 07:20 PM)vince Wrote: Nice, it's good to have a condensed link option along with embeds.  I'm hoping QBJS may get something similar (perhaps to trusted users) otherwise I think it can run an external BAS file which you upload elsewhere -- what's the procedure for that anyway?

My issue is: say I want to share a QB program with a non-QBer, I either have to send a 20 page QBJS URL which is probably a virus or have to explain what in the world is Steve's Turbo64 Peacock Edition to run a simple BAS file.

Yeah, I'm pretty fussy about all the bits and pieces in the software development cycle, whatever the size of the project, even if just a small BASIC program.

That's why everything that is BASIC Anywhere Machine and is created with BASIC Anywhere Machine exists in that one HTML file.

To just share the one program I create in BAM, same thing: I want just one file per shared option.

Often times, though, I like to share the one program in both of these ways: the one HTML file that displays the running program, and the other HTML file which is a nice display of the source code.

The beauty of sharing that BASIC program that can run in a web browser: folk just need whatever device that has a web browser.

I don't know anywhere near enough about QBJS to comment, other than I think it will always be the better option for extremely high compatibility with QB64PE and higher performance.

The sharing a program via URL can be a problem with web browsers that have URL size limits.  A big QBJS program with a really big URL might have problems running on some browsers.

BTW, here's a sample of what an HTML file for a wwwBASIC program looks like.  BAM does pretty much the same thing, except that the javascript is embedded in the HTML file, not stored externally with the file or on some web site.  From the wwwBASIC page:

How to use wwwBASIC

You can include wwwBASIC directly in Web pages:


Code: (Select All)
<!DOCTYPE html>
<html>
  <head>
    <script src="https://google.github.io/wwwbasic/wwwbasic.js"></script>
    <script type="text/basic">
      PRINT "Hello World!"
      FOR i = 1 to 10
        PRINT "Counting "; i
      NEXT i
    </script>
  </head>
</html>
Reply


Messages In This Thread
RE: BAM: How to embed your program in a web page - by CharlieJV - 11-10-2022, 07:43 PM



Users browsing this thread: 1 Guest(s)