Author Topic: Small Basic Notes  (Read 855 times)

B+

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
Small Basic Notes
« on: 16. January 2016, 20:51:46 »
The main thing to remember about SmallBASIC is that it is NOT MS Small Basic. (note the different spellings)

MS Small Basic is basically a trainer for VB programming.

SmallBASIC is very compatible to old style Basic programming, but has plenty of modern updates. Not the most powerful or sophisticated, the interpreter (only) is general purpose and good for quick program applications.

Here is link for downloads, language reference, forum, Code Library and more:
http://smallbasic.sourceforge.net

John

  • Sr. Member
  • ****
  • Posts: 361
    • View Profile
Re: Small Basic Notes
« Reply #1 on: 17. January 2016, 05:59:20 »
Hi Mark,

The latest version of SmallBASIC for Linux 64 bit seems to work this time for me. A couple examples screen shots from the package. Cool to see your stuff as part of the distribution. From what I have read, the GUI is based on FLTK for forms and SDL for graphics.

I'm actually hoping to pickup a few SDL tips from SmallBASIC to enhance what I have going with the Script BASIC SDL_gfx extension module.




« Last Edit: 17. January 2016, 10:11:35 by ScriptBasic »

B+

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
Re: Small Basic Notes
« Reply #2 on: 17. January 2016, 15:45:24 »
Hi Scriptbasic,

Thanks for screen shots, I am happy to get feed back from Linux users as I don't have direct access (yet?). I think Chris the developer of SmallBASIC has moved from FLTK as it has been discontinued. I am not clear on tech details but I can pass questions on to Chris. I do know the Windows FLTK editor and samples have been removed from Download board and his goal is to get all platforms working from one version of SmallBASIC currently at 0.12.2 (or as close to one version as possible).

A couple more notes:

You will find 2 constants xmax and ymax that give you your screen dimensions (in pixels) you have to work within. Unlike other Basics you don't set the screen size or mode, its all from the same screen, so a newbie is saved from those details getting started with SmallBASIC. Check with this
Code: [Select]
print "My screen width is ";xmax
? "My screen height is "; ymax         '<= comment is common symbol and at least on other BASIC uses ? as PRINT shortcut

There is a built in editor or you can use plain text files with .bas (and I think .txt) extensions, say from Windows Notepad.
 
From command line, use -e or -r switches for edit or run.

In Windows, at least, you can drag drop files onto SmallBASIC application icon and of course register .bas in Windows to SmallBASIC and just click the .bas file (not recommended unless SmallBASIC is your main BASIC)

The built in editor is rather quirky (and new). The general rule is whenever it seems hung, like after a help or run and syntax error found, PRESS esc to get 'focus' back into main part of editor.
+ Errors from runs are posted in top right corner of screen and until you press esc, you can't start editing the error.
+ Language reference help including keyboard shortcuts are accessed ctrl+h, until you press esc the 'focus' is in help, the right side of the screen.

B+

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
Re: Small Basic Notes
« Reply #3 on: 28. April 2017, 01:38:39 »
For most recent update of SmallBASIC, 0.12.9, if you have the exe pinned to toolbar, click it and this screen will come up.

I call it the navigation screen. Folders are shown in brackets and files list is below folders listing (no brackets).
Click a file to run or edit it, click a folder to change directory to it...

On the navigation screen there is also a [File] menu, an [On-line] samples menu and an [About] menu.

File maintenance can be done from the [File] menu.
« Last Edit: 28. April 2017, 04:43:33 by B+ »

B+

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
Re: Small Basic Notes
« Reply #4 on: 28. April 2017, 01:42:21 »
Click the Files menu and you see normal file maintenance options:

But for running or editing files, use the first navigation screen.
« Last Edit: 28. April 2017, 01:44:42 by B+ »

B+

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
Re: Small Basic Notes
« Reply #5 on: 28. April 2017, 01:58:04 »
I personally have this (screenshot) setup on my desktop and use Windows 10 to do my file maintenance (and navigation).
I just click a bas file and I am in the SmallBASIC editor. Right click and I have Cut/Copy/Paste along with Run option and more.

Before 0.12.9 there was no Save As menu option under Files menu, I did not like the label for new files so I coded my own versions.

New bas file.bas
Save As bas file.bas

Eval.bas, I use for quick calculator
Tab2Space, I use to detab a file, say from Geany

Quick test.bas, I use to try out code (Copy/Paste) and do allot of Save As from that file.
Full factor.bas, factors a number
Handy.bas, some of my most reusable subs and functions to Copy/Paste from


You can get very use to running code from right clicking mouse and then clicking RUN.
2nd screen shot, I have Full factor.bas loaded in editor and right clicked mouse to show the menu to RUN it.
« Last Edit: 28. April 2017, 03:16:40 by B+ »

B+

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
Re: Small Basic Notes
« Reply #6 on: 28. April 2017, 02:37:28 »
If the quick (and very terse) help from the editor is not enough, I have written an extended help file that has help from Language Reference board at the SmallBASIC site. It has similarities to SmallBASIC's help when the IDE was more conventional working with FLTK.

Screenshot is of Index button pressed and a full listing of keywords displayed, click one for reference and maybe code examples.
« Last Edit: 28. April 2017, 02:40:10 by B+ »