RunBasic2 wishlist and suggestions

new BookmarkLockedFalling
meerkat
Senior Member
****

meerkat Avatar

Posts: 250

Post by meerkat on Feb 18, 2025 6:23:16 GMT -5

Some suggestions and fixes. Some may not be possible.
** Get rid of the 0.0d when getting numeric data from SQLite
** Stop record locks
** Stop memory leaks when using the RUN command
** string replace command
** coalesce command to find first of values with a default a$ = NUL,a$ ?? b$ ?? c,ドルdef$ .
This would find the first variable that is not NUL and if it finds nothing returns the def$
** align data. a$ = align('R",30,data$) returns data 30 characters to the Right
** Include support** support for all data types like datetime-local, url,eMail
** error trap to set a [tab] whenever it gets an error
** support for all html trigger events. onDrag, onChange, onInput, onMouseover, onSelect,onClick, onSubmit,onFocus,onBlur ...
A way to support the tags and give complete control of the HTML even if they come out with new HTML specs like HTML6 would allow tags in the native html code.
For example html "<input width=5 name='x' type='text' value='text data' onChange=[doTrigger];>" This would go to the [doTrigger] tag in RB. This would also give
support for all data types.
** ability to place data within the client html page. Current we write the same JS code over and over <script> document.getElementById('";data$;"loc').innerHTML ..
to place in the html like <div id='loc') or <td id='loc'. And to place within an <input field value. <script> document.getElementById('";data$;"loc').value ..a
command like a$ = showLoc$("data",loc$) to place at a location and a$ = showVal$("value",loc$) to place within a <input
** support for mySQL, or postGres. downtime is not allowed for some systems.
SQLite does not support replication or cross database sql commands, and has limited triggers.
** WebSocket Support – Useful for real-time communication in web applications.
** JSON Parsing – Since modern web applications rely on JSON, this would be helpful.
** API Support(RESTful Requests) – Would allow integration with modern web services.
** Background Tasks - Running long processes asynchronously would be a big improvement.
carlgundel
Administrator
*****
Creator of Run BASIC

carlgundel Avatar

Posts: 975

Post by carlgundel on Feb 18, 2025 7:56:38 GMT -5

That's quite a list. I'll do my best. 🙂

Some short examples to demonstrate new feature ideas would be helpful.

meerkat Avatar
Some suggestions and fixes. Some may not be possible.
** Get rid of the 0.0d when getting numeric data from SQLite
** Stop record locks
** Stop memory leaks when using the RUN command
** string replace command
** coalesce command to find first of values with a default a$ = NUL,a$ ?? b$ ?? c,ドルdef$ .
This would find the first variable that is not NUL and if it finds nothing returns the def$
** align data. a$ = align('R",30,data$) returns data 30 characters to the Right
** Include support** support for all data types like datetime-local, url,eMail
** error trap to set a [tab] whenever it gets an error
** support for all html trigger events. onDrag, onChange, onInput, onMouseover, onSelect,onClick, onSubmit,onFocus,onBlur ...
A way to support the tags and give complete control of the HTML even if they come out with new HTML specs like HTML6 would allow tags in the native html code.
For example html "<input width=5 name='x' type='text' value='text data' onChange=[doTrigger];>" This would go to the [doTrigger] tag in RB. This would also give
support for all data types.
** ability to place data within the client html page. Current we write the same JS code over and over <script> document.getElementById('";data$;"loc').innerHTML ..
to place in the html like <div id='loc') or <td id='loc'. And to place within an <input field value. <script> document.getElementById('";data$;"loc').value ..a
command like a$ = showLoc$("data",loc$) to place at a location and a$ = showVal$("value",loc$) to place within a <input
** support for mySQL, or postGres. downtime is not allowed for some systems.
SQLite does not support replication or cross database sql commands, and has limited triggers.
** WebSocket Support – Useful for real-time communication in web applications.
** JSON Parsing – Since modern web applications rely on JSON, this would be helpful.
** API Support(RESTful Requests) – Would allow integration with modern web services.
** Background Tasks - Running long processes asynchronously would be a big improvement.

Last Edit: Feb 18, 2025 7:57:54 GMT -5 by carlgundel
jerry
Junior Member
**

jerry Avatar

Posts: 86Male

An old guy that cant wait to retire!
carlgundel
Administrator
*****
Creator of Run BASIC

carlgundel Avatar

Posts: 975

Last Edit: Feb 19, 2025 17:05:43 GMT -5 by carlgundel
meerkat
Senior Member
****

meerkat Avatar

Posts: 250

Post by meerkat on Feb 19, 2025 7:51:07 GMT -5

Instead of the typical batch mode of the web, triggers make it interactive.
Doing triggers in python or php requires knowledge of Javascript.
Keeping the theme of basic it should be simple. I think it can be done without the developer having to know or write JS.
It would certainly give RB2 a leg up above most of the other languages.
If triggers work in RB, I believe we would not need JSON.

Suggestion;
Suppose we want to input the the customer number and a item number. If they change them we want to do a SQLite lookup of the customer or item and return the name of the client without having to wait until they submit the entire form.
It makes things simple because if they submit the entire form we may have to send it back if there are invalid customer or item numbers.
With onChange we already know they are ok and we have no more retransmission of the entire document to the client.

Suggested RB2 code;
TEXTBOX #custNum, custNum,5
set #custNum,trigger 'onChange [findCust] ' This would set the onChange trigger to go to the [findCust] label in RB2
html "<div id='custName'></div>" 'This is the location in the html document to show the customer name
html "<BR>" ' gimme a break
TEXTBOX #itemNum, itemNum,5
set #itemNum,trigger 'onChange [findItem]
html "<div id='itemName'></div>"
wait

[findCust]
custNum$ = #request get$("custNum") ' get the changed custNum from the html document
' if blank set the custName to blank
' else look up custNum from the Database.
' if good return the customer name into the document at 'custName
shoWhere$ = "custName"
a$ = "the customer name" ' or a error message
gosub [shoIt]
wait

[findItem] ' do similar to [findItem]
shoWhere$ = "itemNum"
gosub [shoIt]
wait
' -----------------------------
' Where in HTML to show it
' -----------------------------
[shoIt]
html "<script> document.getElementById('";shoWhere$;"').innerHTML = """
html a$
html """;</script>"
return

Instead of the [showIt] gosub,
we could replace it with a new RB2 command;
Maybe something like this;
x$ = shoText(where,ドルwhat$) ' to show .innerHTML
x$ = shoVal(where,ドルwhat$) ' to show .value
x$ = shoDoc(T,where,ドルwhat$) ' or one command to show either T=Text or V=Value

RB requires a button to get data from the client.
On triggers maybe RB2 can generate 2 html items for each trigger.
The input type text or number or whatever that clicks a hidden button.
Maybe it could generate the following ;
<input type="text" id="custNum" name="custNum" value="1234" onchange="document.getElementById('custNumBtn').click()">
<input type="submit" id="custNumBtn" style="display:none;">
This <input type=submit would be the equivalent of a RB statement that is hidden as:
button #acd, acd,ドル [doTrigger]
#abc, "hidden" ' new rb to hide

The developer wouldn't need any knowledge of JS and it is true to Basic.
Last Edit: Feb 19, 2025 9:42:33 GMT -5 by meerkat
carlgundel
Administrator
*****
Creator of Run BASIC

carlgundel Avatar

Posts: 975

Post by carlgundel on Feb 19, 2025 11:15:46 GMT -5

meerkat Avatar
Instead of the typical batch mode of the web, triggers make it interactive.
Doing triggers in python or php requires knowledge of Javascript.
Keeping the theme of basic it should be simple. I think it can be done without the developer having to know or write JS.
It would certainly give RB2 a leg up above most of the other languages.
If triggers work in RB, I believe we would not need JSON.

Suggestion;
Suppose we want to input the the customer number and a item number. If they change them we want to do a SQLite lookup of the customer or item and return the name of the client without having to wait until they submit the entire form.
It makes things simple because if they submit the entire form we may have to send it back if there are invalid customer or item numbers.
With onChange we already know they are ok and we have no more retransmission of the entire document to the client.

Certainly this is a great idea, and I want to do some interactive widget stuff like you're saying, but first things first, I need to get it running well enough to put out a test release.
Last Edit: Feb 19, 2025 11:16:00 GMT -5 by carlgundel