0.12.18 released

Started by chrisws, March 16, 2020, 09:30:20

Previous topic - Next topic

round157

#30
Still have a little proposal:

It is about sbasicg.exe. Assume source code has setsize() command, for example:

w = window()
w.setsize(640, 480)

Run the source code. Right-click. Select 'Back' in the menu. The source code page comes back. However, the source code page is still in 640x480. The source code page is not in the original size(maximum size). sbasicg.exe forgets changing the source code page's size back to the original size(maximum size).

Thanks.





lettersquash

Quote from: round157 on April 09, 2020, 10:10:45
Still have a little proposal:

It is about sbasicg.exe. Assume source code has setsize() command, for example:

w = window()
w.setsize(640, 480)

Run the source code. Right-click. Select 'Back' in the menu. The source code page comes back. However, the source code page is still in 640x480. The source code page is not in the original size(maximum size). sbasicg.exe forgets changing the source code page's size back to the original size(maximum size).

Thanks.

Nice idea, and thanks for mentioning the window command - I hadn't experimented with that and I just found the example, which gives me lots of new things to use, like messages, alerts, question dialogs! The window example on the website needs a little debugging, as it interprets the square brackets in things like
w.message("[2] click to continue. ")
wrongly and gives an error about arrays or something - I just made it
w.message("2 click to continue. ")
instead.

I'm not sure resetting the window is going to be high on the todo list, but in the meantime, you could do something like this:
ox=xmax:oy=ymax
w = window()
w.setsize(640, 480)
?
? "Click/key to close"
pause
w.setsize(ox,oy)
end

It doesn't automatically reset the size (for instance, in an error situation) and you still have to end the program after resetting the size to the original.

Here's the window example (debugged, Win7), by the way.
REM SmallBASIC
REM created: 09/04/2020
' create the window object, this provides access to a number of sub-commands
w = window()
' select graphics mode screen 1 for output
w.graphicsScreen1()
for i = 0 to 10
  print "this is printed on screen 1"
next i
w.message("1 click to continue. ")
pause
' select graphics mode screen 1 for output
w.graphicsScreen2()
color 1,3
cls
print "this is printed on screen 2"
w.message("2 click to continue. ")
pause
w.graphicsScreen1()
print "back to screen 1"
w.message("3 click to continue. ")
pause
' select the text mode for output
' text mode can display more text but is slow
' also this is currently broken and will cause a crash
'w.textScreen()
w.alert("This is an alert", "title")
w.ask("Yes or no?", "Question")
print "your answer was "; w.answer
w.message("4 click to continue. ")
pause
w.menu("option1", "option2", "option3")
' weirdly the result is sent to the keyboard handler
' it should at least go to w.answer. also there is no option for placement
select case asc(inkey)
case 0
  print "one"
case 1
  print "two"
case 2
  print "three"
case else
  print "unk"
end select
w.message("5 click to continue. ")
pause
' this raises the virtual keypad on android
w.showKeypad()
' set the font size
' arg1 = size
' arg2 = unit amount for size, "px" or "em"
'   px=  pixels
'   em= emphasis - this is a multiplication factor for the current size
' arg3= bold 1=on 0=off
' arg4= italic 1=on, 0=off
' this sets the font to be double in size with bold and italic
' using pixels is likely to give an unexpected result in android
w.setFont(2, "em", 1,1)
cls
? "How does this look?"
w.insetTextScreen(5,10,90,90)
for i = 0 to 200
  ? "This is in the text screen"
next i
' comment out the above cls to see the bug
w.message("spot the bug (see comments)?")
w.setFont(11, "px", 0,0)
? "press a key to end..."
pause
I'll have you know, I'm coding all the right commands, just not necessarily in the right order.

round157

Quote from: lettersquash on April 09, 2020, 11:52:15
The window example on the website needs a little debugging, as it interprets the square brackets in things like
w.message("[2] click to continue. ")
wrongly and gives an error about arrays or something

I ran this example several days ago but I faced the above problem. Now I understand why this problem happened. Very nice!

QuoteI'm not sure resetting the window is going to be high on the todo list,

Thus conversation is so important. :D I hope that the Author will spend more time on discussing with us(the community of SmallBASIC) about the direction of the development of SmallBASIC.

Quotebut in the meantime, you could do something like this:

Ha....thank you very much! ^-^

Quote
Here's the window example (debugged, Win7), by the way.

I tried this new example and no problem occurred. Thanks again!!

chrisws

Quote
Thus conversation is so important. :D I hope that the Author will spend more time on discussing with us(the community of SmallBASIC) about the direction of the development of SmallBASIC.

Hi,

At this stage I'm just making minor incremental changes, mostly from suggestions such as this one!

I'm using the github issue register to keep track of things:

https://github.com/smallbasic/SmallBASIC/issues

Cheers,
Chris

lettersquash

Chris, as I've probably said before, I can't thank you enough for maintaining and developing smallBASIC. I don't know about anyone else, but I often feel quite passionate about a programming language once I discover that it suits me. And then I worry it might not be maintained, as happened with a couple of my favourite languages in the past. I've sometimes been anxious to share suggestions and bug reports, here and elsewhere, because I hate to over-burden authors, and it can sometimes look like complaining. If I started to deliberately put a wish-list together, it might get quite long, but they're almost all that, just wishes, more icing on an already very tasty - and free - cake. So it's great to be reminded you're working on it and taking notes of suggestions. It might be good to put a pinned topic on the board with the link to the issues list. It's a pity it's not a dedicated forum. Can you add sections? It could really help to have a section for suggestions, bug reports, general chit chat, etc., rather than all of the threads being in one list.






     :P :P :P
f r e e      c a k e   !
I'll have you know, I'm coding all the right commands, just not necessarily in the right order.

chrisws

Adding a pinned topic is an excellent idea, but I don't seem to have permissions. I guess I could work something out with the forum maintainers, but it would be more awesome for people to create an account with git-hub.

Then you could register your suggestions and bug reports and they'd never be lost or forgotten:

https://github.com/smallbasic/SmallBASIC/issues

My ulterior motive is for people to help improve the documentation. Here's how:

1. Navigate to the documentation page:

https://github.com/smallbasic/smallbasic.github.io

2.  Click clone to create your own copy.

3. In your clone, navigate to any of the poorly documented SUBs/FUNCs

For example:

https://github.com/smallbasic/smallbasic.github.io/blob/master/_build/reference/569-data-data.markdown

4. Click the edit link to make some improvements.

Since this is BASIC, in a lot of cases there's already some other place that could be used for "inspiration" for example;

https://www.c64-wiki.com/wiki/DATA

5. Commit and raise a pull request.

Click "Create a new branch" for this commit and start a pull request.
Click "Learn more about pull requests."
Click "commit"

You don't need any special software to do any of this, just a web browser :)


round157

Quote from: lettersquash on April 10, 2020, 12:45:21
And then I worry it might not be maintained, as happened with a couple of my favourite languages in the past. I've sometimes been anxious to share suggestions and bug reports, here and elsewhere, because I hate to over-burden authors, and it can sometimes look like complaining. If I started to deliberately put a wish-list together, it might get quite long, but they're almost all that, just wishes

Discussing new ideas, proposals or suggestions is good. If there are ideas, proposals and suggestions from a lot of users of a software, the author of that software should be very glad. This is because that software is really popular. That author should be very satisfied with the software's popularity. Moreover, that author will have motive and be willing to continue to improve that software. Of course that author will not 100% accept new ideas, proposals and suggestions from those users.

If I am an author of a free programming language software, I want to see many active users. Not only several active users.

QuoteIt might be good to put a pinned topic on the board with the link to the issues list. Can you add sections? It could really help to have a section for suggestions, bug reports, general chit chat, etc., rather than all of the threads being in one list.

Pinned topic! I agree with you! Child boards!  I also agree. Now we are in great confusion since all kinds of threads are in one section. Quite strange.

There are three child boards in BlitzMax / BlitzMax NG sub-forum. SmallBASIC sub-forum also needs appropriate child boards. Look!
https://www.syntaxbomb.com/index.php/board,19.0.html

I am not familiar with SmallBASIC. Chrisws is also busy for making the next version of SmallBASIC better. You are familiar with SmallBASIC. You are very enthusiastic, too. Would you mind being the moderator of the SmallBASIC sub-forum? If you don't mind being the moderator, then we need to suggest in this thread:
https://www.syntaxbomb.com/index.php/topic,43.210.html


Quote
It's a pity it's not a dedicated forum.

Ha.....then I will not come frequently. Many official forums of BASIC languages are dead forums or inactive forums. Basic4GL, NaaLaa, etc. Visiting them once per several months is enough. :D

I frequently come to SyntaxBomb forum because it is active and I can get information or news of different BASIC dialects.

round157

Quote from: chrisws on April 10, 2020, 10:46:32
At this stage I'm just making minor incremental changes, mostly from suggestions such as this one!

Do you mean that the development of SmallBASIC nearly stopped? Oh....

Many programming languages died because of no more development. It is a nice example:
https://monkeycoders.boards.net

Anyway, SmallBASIC is a nice software.
:)






Steve Elliott

Quote
At this stage I'm just making minor incremental changes, mostly from suggestions such as this one!

Do you mean that the development of SmallBASIC nearly stopped? Oh....

No I think he means at this moment small changes are being made, he says nothing about stopping development at all.
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

lettersquash

Quote from: chrisws on April 11, 2020, 02:38:42
Adding a pinned topic is an excellent idea, but I don't seem to have permissions. I guess I could work something out with the forum maintainers, but it would be more awesome for people to create an account with git-hub.

Then you could register your suggestions and bug reports and they'd never be lost or forgotten:

https://github.com/smallbasic/SmallBASIC/issues
It's useful to know that's your preference, and I guess we'll all have our own. For me, github has always looked pretty daunting, and involves learning a new set of procedures to edit or submit things like bug reports, as well as involving setting up another account. Also, as I've just demonstrated a couple of times, a forum allows discussion and resolution of an issue that might look like a bug but is just a noob mistake, so nobody has to put it on github and you don't have to take it off again (meanwhile, probably not having time to explain why it wasn't a bug, so losing the learning potential for the noob)!

Quote
My ulterior motive is for people to help improve the documentation. Here's how:

1. Navigate to the documentation page:

https://github.com/smallbasic/smallbasic.github.io

2.  Click clone to create your own copy.

3. In your clone, navigate to any of the poorly documented SUBs/FUNCs

For example:

https://github.com/smallbasic/smallbasic.github.io/blob/master/_build/reference/569-data-data.markdown

4. Click the edit link to make some improvements.
Yeah, that all sounds a bit much, to be honest. Besides, I personally think the help files could be improved most not by improving each page of documentation (although they have value), but by rewriting it as either a set of html files with an index where every keyword is itemised in alphabetical order, linked to a details page, or - perhaps even better - a single html page with all the detail as well. I know the latter sounds mad, but it's surprisingly useful, because you can just have the page open in your browser and use Ctrl-F or whatever to find the info. It could maybe have tables and other layout types and would have hyperlinked index at the top. I would be happy to put something together like that. I just started experimenting with doing it using sB to write the text, hence the TSAVE experiment. Hopefully I'm better at writing html than text documents, lol.

For mostly-Windows users like me it's tempting to think the standard searchable help file is a good choice, but I guess this isn't so for something cross-platform. The RFO BASIC! help file is an alphabetical .pdf with a hot-linked index, which is also useful and also has the whole language documented in one single document, accessible on most platforms either by app or in a browser. What is most useful in a help document is searchability, and you can't easily do that with the sB help - it might be possible with a site-specific search-engine query, but really that's a big ask.

It may also seem a backward step to put every keyword together in alphabetical order, but one of the things that slowed down my introduction to sB was the sections, since it's not immediately obvious which section a keyword might be under. This is especially true when you don't know what you're looking for, but is actually just a logical problem with any tree or discrete section structure. It leads to repetitions, like PEN, which is listed under Console with barely any information, and under Graphics with the full list of parameters. What's ARC, or PTDISTLN, maths or graphics - so it goes on, slowing you down looking stuff up every time you write a new line of code as a newbie. Where should PRINT be, since it can be to the console or a file? It could be useful in an alphabetical list to indicate those categories with each keyword, but they're more like tags than sections.

Quote
Since this is BASIC, in a lot of cases there's already some other place that could be used for "inspiration" for example;

https://www.c64-wiki.com/wiki/DATA
Yes, but only for inspiration. Since every BASIC dialect/interpreter works differently, it is also confusing. I tried the first example on that very page and had to re-write it for sB, which doesn't use % in variable names and has different escaping of quotes. So this method is limited to fairly experienced programmers who know the differences, or you risk introducing errors into the sB help.

...
Quote

5. Commit and raise a pull request.

Click "Create a new branch" for this commit and start a pull request.
Click "Learn more about pull requests."
Click "commit"

You don't need any special software to do any of this, just a web browser :)
I think it's unrealistic to imagine ordinary users are going to bother to do any of that. When you're used to it, it probably doesn't seem a big deal. But as round157 said, it's good to discuss these sorts of things and I'm glad to hear where you're coming from.
I'll have you know, I'm coding all the right commands, just not necessarily in the right order.

lettersquash

Quote from: round157 on April 11, 2020, 09:20:42
I am not familiar with SmallBASIC. Chrisws is also busy for making the next version of SmallBASIC better. You are familiar with SmallBASIC. You are very enthusiastic, too. Would you mind being the moderator of the SmallBASIC sub-forum? If you don't mind being the moderator, then we need to suggest in this thread:
https://www.syntaxbomb.com/index.php/topic,43.210.html
Erm...I dunno, I guess it depends what it involved and if Chris or whoever- the forum owners - asked me, but I'm only slightly familiar with sB really. I ask lots of newbie questions myself. I've got long experience with BASIC, although mostly with an ancient version. Moderating would normally be day-to-day administration, like - if we had sub-boards - moving things to an appropriate place, 'policing' the guidelines, etc., so maybe you're as qualified as me for the role. :P

With numbers as they are, I don't suppose it would be a big job, but yeah, it looks like something Chris doesn't want to be doing too much of. From what he said earlier, it might also be useful if the moderator was actually fairly proficient with sB and with github - then they could add suggestions and bug reports posted here to the issues list there. Maybe if a moderator is an idea that catches on, the right person will volunteer.

Quote
Quote
It's a pity it's not a dedicated forum.

Ha.....then I will not come frequently. Many official forums of BASIC languages are dead forums or inactive forums. Basic4GL, NaaLaa, etc. Visiting them once per several months is enough. :D

I frequently come to SyntaxBomb forum because it is active and I can get information or news of different BASIC dialects.
I see. I'm less interested in the other languages on here. I've checked one or two out online, but I'm a bit fussy and there's usually something that puts me off. So far I only come here for the sB.
I'll have you know, I'm coding all the right commands, just not necessarily in the right order.

lettersquash

#41
Suggestion: reverse logic of window.ask

I hope it's okay to keep putting suggestions here.

The w.answer returned from w.ask is 0 for Yes and 1 for No. Also, maybe because of this, <Escape> triggers Yes and <Enter> triggers No. This would be better the other way, surely? (Windows - not tested how this works on Android.)

ETA: if reversing the logic risks breaking too many older scripts, would it be possible to add new option to redefine both button texts - then the user can choose which way to have them as well as using Cancel, OK, or whatever else they want to put on them?

Also tried this on my Android phone - same except I got a 2, I think when I used the Back button. Using the Home button when the dialog was up caused smallBASIC to hang - I guess perhaps the dialog got behind the console screen or something, so the phone went black. After some time the system reported that sB wasn't responding.
I'll have you know, I'm coding all the right commands, just not necessarily in the right order.

lettersquash

I also think absmin and absmax are the wrong way round:
a=[3,2,1,-42]
? absmin(a),absmax(a)
end


->  42  1
I'll have you know, I'm coding all the right commands, just not necessarily in the right order.

chrisws

Quote
It may also seem a backward step to put every keyword together in alphabetical order, but one of the things that slowed down my introduction to sB was the sections, since it's not immediately obvious which section a keyword might be under. This is especially true when you don't know what you're looking for, but is actually just a logical problem with any tree or discrete section structure. It leads to repetitions, like PEN, which is listed under Console with barely any information, and under Graphics with the full list of parameters. What's ARC, or PTDISTLN, maths or graphics - so it goes on, slowing you down looking stuff up every time you write a new line of code as a newbie. Where should PRINT be, since it can be to the console or a file? It could be useful in an alphabetical list to indicate those categories with each keyword, but they're more like tags than sections.

Do you have any specific suggestion of how you'd like this to appear? I can add it to this page:

https://smallbasic.github.io/pages/reference.html

There used to be a list of keywords on the old drupal based site.

chrisws

Quote from: lettersquash on April 12, 2020, 14:34:12
I also think absmin and absmax are the wrong way round:
a=[3,2,1,-42]
? absmin(a),absmax(a)
end


->  42  1

Good catch, I will fix.