Recent Posts

Pages: [1] 2 3 ... 10
1
QB64 Discussion / Re: Cheerio, it's been fun
« Last post by bplus on April 16, 2022, 08:46:26 am »
Yeah things are a mess at moment, too bad, I know Luke has low tolerance of BS.
2
QB64 Discussion / Re: Cheerio, it's been fun
« Last post by RhoSigma on April 16, 2022, 08:08:27 am »
Oh no, last week already Fellippes account disapeared without a word and now you. Maybe handing qb64.org over to that RCcola guy was the wrong choice.

Is this the end of QB64 ?  -- Or even worst the start of its commercializing ?

But well thanks for all the efforts you did for it, luke ...

Sincerly,
RhoSigma, Roland Heyder
3
QB64 Discussion / Cheerio, it's been fun
« Last post by luke on April 16, 2022, 07:48:13 am »
I'll still be at github.com/flukiluke, or you can email me at qb64[at]alephc.xyz

@odin apparently I don't have admin login any more, delete this account please - I shan't be needing it.
4
QB64 Discussion / Tip: get your pathed program file name
« Last post by bplus on April 15, 2022, 11:39:33 pm »
Code: QB64: [Select]
  1. PathedFile$ = Command$(0) 'or process commands sent
  2. Print PathedFile$
  3.  

  [ You are not allowed to view this attachment ]  
5
QB64 Discussion / Re: The QB64 Bible (Work In Progress)
« Last post by Richard on April 15, 2022, 11:16:25 pm »
@SMcNeill

My suggestion...



After a brief description, mention in detail with examples if possible, of what's wrong with it (c/f PRINT, PRINT USING, etc).

Then mention what's right with it , eg how big numbers in theory you could go (+precision), when one should always use ## (irrespective  of dims, types, declare, constants,  etc). how it matches up to other .,variable types (I started on the number space of _FLOAT study, for the case of integers - so one could compare to INTEGER64 values).

Maybe have some speed comparisons e.g

SINGLE vs DOUBLE vs FLOAT vs INTEGER64
6
Programs / Re: QBJS - Import code from external .bas files
« Last post by bplus on April 15, 2022, 10:14:18 pm »
This project continues to impress! Good Stuff!
7
Programs / Re: QBJS - Import code from external .bas files
« Last post by dbox on April 15, 2022, 07:31:34 pm »
@CharlieJV, thanks for the feedback.  Security is always a good thing to keep in mind.  This feature is modeled to some degree after the standard way JavaScript allows supporting libraries to be included ( https://www.w3schools.com/tags/att_script_src.asp).  Like JS these libraries can be loaded from a relative path or from an external location. Even though the modern browser is sandboxed to a large degree to prevent malicious activity discretion is always required of the developer.

In addition, I’m also working on an Export feature for this release which will allow you to export the compiled JavaScript and supporting html files as a zip.  The compiled version will incorporate content from any included libraries. This can then be run standalone or is ready to be uploaded to a sharing site like itch.io. This is also available on the qbjs-dev site, where the most current dev build is deployed.
8
Programs / Re: QBJS - Import code from external .bas files
« Last post by CharlieJV on April 15, 2022, 05:34:06 pm »
First thought: that is very cool.

Sober second thought: what are the security implications ?  For example, what happens if an imported file from some source is maliciously modified?

It would be good to well-document whatever risks, and how to mitigate risks.  (I'm no web guy, so my security hat is very much of the base-level-amateur kind.)

I would only import into my programs source code in my control (i.e. my web domain), but I think I'd be okay with the mechanism for running, sandboxed, a program that is hosted wherever.
9
QB64 Discussion / Re: _FileExists not working with wildcards
« Last post by bplus on April 15, 2022, 04:57:02 pm »
Maybe you can ask the guy who suggested it to write you up a demo on how to do it?  ;D

OK this is what he came up with for Windows 10:
Attachment creates a safe folder to make and delete files, use exe's or edit and compile your own.

I did T*.txt instead of Trash*.txt
Code: QB64: [Select]
  1. shell _hide "del /f t*.txt"
  2.  
10
Programs / QBJS - Import code from external .bas files
« Last post by dbox on April 15, 2022, 04:43:54 pm »
Hi All,

I wanted to share the latest feature I've been working on for QBJS to solicit some input from the community.  I've implemented the ability to include "modules" from external source files into your program.  This concept is similar to include from c/c++ and import from javascript.  The idea here is to make it easy to create reusable libraries that can be shared between projects.  Here's an example:

Code: QB64: [Select]
  1. Import MyLib From "https://raw.githubusercontent.com/boxgaming/qbjs/main/samples/include/test.bas"
  2. Import Maths From "https://raw.githubusercontent.com/boxgaming/qbjs/main/samples/include/maths.bas"
  3.  
  4. MyLib.DoStuff          ' Call exported sub
  5. Print MyLib.GetThings  ' Call exported function
  6.  
  7. Print Maths.Factorial(10)
  8. Print Maths.Plus1(11)
  9.  

Try it on QBJS-Dev

Any imports must be the first statements in your program.  In this example we've imported functionality from two different external source files.  Any methods exported from those libraries can be accessed in your program by prefixing them with the alias specified after the import statement.

Only the content specified for export will be available in the calling program.  This lets us have "private" shared variables and helper functions in our included modules.

Here's what the library files look like:

test.bas
Code: QB64: [Select]
  1. Export GetStuff As GetThings
  2. Export DoStuff
  3.  
  4. Dim foo
  5. foo = "somthing"
  6.  
  7. Function GetStuff
  8.     GetStuff = "got the stuff"
  9.  
  10. Sub DoStuff
  11.     Print "do the stuff"
  12.  

maths.bas
Code: QB64: [Select]
  1. Export increment As Plus1
  2. Export factorial AS Factorial
  3.  
  4. Function increment (num)
  5.     increment = num + 1
  6.  
  7. Function factorial (num)
  8.     Dim res
  9.     $If Javascript Then
  10.         if (num === 0 || num === 1) {
  11.             num = 1;
  12.         }
  13.         else {
  14.             for (var i = num - 1; i >= 1; i--) {
  15.                 num *= i;
  16.             }
  17.        }
  18.     $End If
  19.     factorial = num
  20.  

Export statements must appear at the top of your module code.  If you want to have a different name for the exported method from it's internal name you can use the "As Alias" syntax as shown above.

Import Entire Programs
Another benefit of this feature is that you can import entire programs from an external source file to make it easier to share large programs. Here are a couple of examples:

QBJS Paint
Code: QB64: [Select]
  1. Import QBJSPaint From "https://raw.githubusercontent.com/boxgaming/qbjs/main/samples/apps/paint.bas"
  2.  
Try it on QBJS-Dev


Terry Ritchie's Excellent Flappy Bird Clone
Ported from QB64
Code: QB64: [Select]
  1. Import FlappyBird From "https://raw.githubusercontent.com/boxgaming/qbjs/main/samples/games/trfbird.bas"
  2.  
Try it on QBJS-Dev

I'd be very interested to hear your thoughts.
Pages: [1] 2 3 ... 10