04-22-2023, 11:14 AM
The problem, for me, with QBJS is that it's more JavaScript than it is BASIC. Take a look at the last example shared of it in our forums:
Dim result As Object <-- What type is an Object? It's not one from BASIC
result = Fetch(...) <-- What command is Fetch? It's not one from BASIC
IF result.ok THEN <-- Apparently result is a type with a subtype in it? Again, this isn't from BASIC..
obj = JSON.parse(...) <-- Another not BASIC
SUB say <-- The contents here are 100% Javascript; not BASIC
Not to look down on dbox's creation or anything, but from what I can see, it seems like it'd be almost as simple to just learn JavaScript itself, rather than having to learn JavaScript + QBJS as a front-end engine.
BASIC is an oooold language, for old-time programmers, and for me personally, QB64PE does exactly what I want it to do for me. I don't care about having code I can copy and carry over into every browser out there in the world. As a point of fact, I don't generally even care for most browser-based games or applications out there. Sure, it's convenient to be able to tap on the phone or iPad and quickly type in a note or read a webpage, but it's just not that great for things that I actually like to do with my PC. As long as QB64PE can take my code (QB45 + more memory + graphics + modern quality of life stuff) and turn it into a working EXE which I can run from my home machine, I'll stick with it. Believe it or not, but I've got two different PCs here at home which don't ever connect to the internet, and as such they have no browser installed on them. An EXE works and plays just fine for me on those PCs, but QBJS wouldn't be much use at all in that situation.
Different tools for different folks, and that's what's great about all these different projects -- folks can pick and choose what's best suited for their own needs.
Code: (Select All)
Dim img
img = _LoadImage("https://images01.military.com/sites/default/files/styles/full/public/2021-04/chucknorris.jpeg.jpg?itok=2b4A6n29")
_PutImage , img
_Fullscreen
Do
_Delay 2
Dim result As Object
result = Fetch("https://api.chucknorris.io/jokes/random")
If result.ok Then
Dim obj As Object
obj = JSON.parse(result.text)
Say obj.value
End If
Loop
Sub Say (text As String)
$If Javascript Then
var synth = window.speechSynthesis;
if (synth) {
var utterance = new SpeechSynthesisUtterance(text);
synth.speak(utterance);
while (synth.speaking) {
await QB.sub__Delay(.5);
}
success = -1;
}
$End If
End Sub
Dim result As Object <-- What type is an Object? It's not one from BASIC
result = Fetch(...) <-- What command is Fetch? It's not one from BASIC
IF result.ok THEN <-- Apparently result is a type with a subtype in it? Again, this isn't from BASIC..
obj = JSON.parse(...) <-- Another not BASIC
SUB say <-- The contents here are 100% Javascript; not BASIC
Not to look down on dbox's creation or anything, but from what I can see, it seems like it'd be almost as simple to just learn JavaScript itself, rather than having to learn JavaScript + QBJS as a front-end engine.
BASIC is an oooold language, for old-time programmers, and for me personally, QB64PE does exactly what I want it to do for me. I don't care about having code I can copy and carry over into every browser out there in the world. As a point of fact, I don't generally even care for most browser-based games or applications out there. Sure, it's convenient to be able to tap on the phone or iPad and quickly type in a note or read a webpage, but it's just not that great for things that I actually like to do with my PC. As long as QB64PE can take my code (QB45 + more memory + graphics + modern quality of life stuff) and turn it into a working EXE which I can run from my home machine, I'll stick with it. Believe it or not, but I've got two different PCs here at home which don't ever connect to the internet, and as such they have no browser installed on them. An EXE works and plays just fine for me on those PCs, but QBJS wouldn't be much use at all in that situation.
Different tools for different folks, and that's what's great about all these different projects -- folks can pick and choose what's best suited for their own needs.