Quantcast
Channel: Small Basic
Viewing all articles
Browse latest Browse all 669

Small Basic Featured Program - Program Database

$
0
0

This was a challenge to write a database program with Small Basic.  I started to write this program in June last year in a Challenge of the Month.  But suspended because of Combo Box coding.  Code of Combo Box has been completed last month.  Then I restarted to write my database program and reported about the program to a thread in Small Basic forum.  Ed Price made this thread sticky.  Thanks Ed.

This project is still beta but I will introduce it as current status.

This project has three components. One for deciding folders to search.  One for collecting information from Small Basic source programs and create a CSV database.  And the last one is to select data from the CSV database.  Following list shows the latest versions of the components.

  1. Program Folder Manager 0.41 - CRK000-2
  2. Program Scanner 0.3b - PMG585-1
  3. Program Database 0.5b - HMK932-1

Program Folder Manager

This program creates a file ProgramScanner.settings.  This setting file contains an array of folders to be scanned by Program Scanner.  An array roots is given to this program (lines 13 - 15 below).  And this program gets all sub folders.

 1.' Program Folder Manager 0.41
 2.' Copyright © 2014-2015 Nonki Takahashi. The MIT License.
 3.' Repository https://programdbsb.codeplex.com
 4.'  
 5.' History:
 6.' 0.41 2015-12-16 #2 Changed for Windows 10. (CRK000-2)
 7.' 0.3 2014-06-13 Supported sub folders. (CRK000-1)
 8.' 0.2 2014-06-06 Added other folders. (CRK000-0)
 9.' 0.1 2014-06-04 Created. (CRK000)
10.'  
11.Settings_GetName()
12.Settings_GetFolder()
13.roots[1] = "C:\Users\Nonki\OneDrive\Documents\MySmallBasic\"
14.roots[2] = "C:\Users\Nonki\OneDrive\Documents\SmallBasic\"
15.roots[3] = "C:\Users\Nonki\OneDrive\Documents\SmallBasic\Shapes\Art\"
16.Settings_GetSubFolders()

Following list shows the result of this program - the content of ProgramScanner.settings (array of folders).  105 folders were found.

Basic\\ParserGenerator;78=C:\\Users\\Nonki\\OneDrive\\Documents\\SmallBasic\\Pia
no;79=C:\\Users\\Nonki\\OneDrive\\Documents\\SmallBasic\\Player;80=C:\\Users\\No
nki\\OneDrive\\Documents\\SmallBasic\\Polygons;81=C:\\Users\\Nonki\\OneDrive\\Do
cuments\\SmallBasic\\Polyline;82=C:\\Users\\Nonki\\OneDrive\\Documents\\SmallBas
ic\\ProgramDB;83=C:\\Users\\Nonki\\OneDrive\\Documents\\SmallBasic\\Puyopuyo;84=
C:\\Users\\Nonki\\OneDrive\\Documents\\SmallBasic\\Roulette;85=C:\\Users\\Nonki\
\OneDrive\\Documents\\SmallBasic\\Ruler;86=C:\\Users\\Nonki\\OneDrive\\Documents
\\SmallBasic\\Shapes;87=C:\\Users\\Nonki\\OneDrive\\Documents\\SmallBasic\\Shape
s1x;88=C:\\Users\\Nonki\\OneDrive\\Documents\\SmallBasic\\Simon;89=C:\\Users\\No
nki\\OneDrive\\Documents\\SmallBasic\\SmallQuest;90=C:\\Users\\Nonki\\OneDrive\\
Documents\\SmallBasic\\SmallQuest - Copy;91=C:\\Users\\Nonki\\OneDrive\\Docume
nts\\SmallBasic\\SmallSVGEditor;92=C:\\Users\\Nonki\\OneDrive\\Documents\\SmallB
asic\\SmallWikiPad;93=C:\\Users\\Nonki\\OneDrive\\Documents\\SmallBasic\\Spirogr
aph;94=C:\\Users\\Nonki\\OneDrive\\Documents\\SmallBasic\\SVGViewer;95=C:\\Users
\\Nonki\\OneDrive\\Documents\\SmallBasic\\Tangram;96=C:\\Users\\Nonki\\OneDrive\
\Documents\\SmallBasic\\TextBrowser;97=C:\\Users\\Nonki\\OneDrive\\Documents\\Sm
allBasic\\TextTools;98=C:\\Users\\Nonki\\OneDrive\\Documents\\SmallBasic\\Tic-ta
c-toe;99=C:\\Users\\Nonki\\OneDrive\\Documents\\SmallBasic\\TRON;100=C:\\Users\\
Nonki\\OneDrive\\Documents\\SmallBasic\\Turtle;101=C:\\Users\\Nonki\\OneDrive\\D
ocuments\\SmallBasic\\Typewriter;102=C:\\Users\\Nonki\\OneDrive\\Documents\\Smal
lBasic\\Wood;103=C:\\Users\\Nonki\\OneDrive\\Documents\\SmallBasic\\WordList;104
=C:\\Users\\Nonki\\OneDrive\\Documents\\SmallBasic\\Zigsaw;105=C:\\Users\\Nonki\
\OneDrive\\Documents\\SmallBasic\\Shapes\\Art\\;
Press any key to continue...

Program Scanner

This program reads ProgramScanner.settings, gets folders from it, scans program source files, get information from them, and then writes them to ProgramDB.csv.  Program Scanner gathers following properties from each Small Basic source code.

  • Program ID
  • Source Filename
  • Screen Shot (Filename)
  • Description
  • Last Update
  • Version
  • Author
  • (Number of ) Lines
  • Subroutines
  • Challenge

This program has room for improvement.  For example, following list shows that a program ID written in a history can be gotten like HMX882 but failed with FGC959 written after "Program ID".

' 2012/09/08 20:42:17 Generated by Shapes Editor 0.3
'
' initialize shapes
,C:\Users\Nonki\OneDrive\Documents\SmallBasic\Shapes\Art\WaterMelon.smallbasic,, Water melon,,,,120,Shapes_Init Shapes_Add,' Windmill
' Copyright c 2015 Nonki Takahashi. The MIT License.
' 2015-02-05 2:13:11 Shapes generated by Shapes 2.1b.
' Program ID FGC959
'
,C:\Users\Nonki\OneDrive\Documents\SmallBasic\Shapes\Art\windmill.smallbasic,,Wi ndmill,,,Nonki Takahashi,336,Shapes_Init Math_CartesianToPolar SB_RotateWorkarou nd SB_Workaround Shapes_Add Shapes_CalcRotatePos Shapes_CalcWidthAndHeight Shape s_Move Shapes_Remove Shapes_Rotate,' Chirstmas Tree 0.1
' Copyright (c) 2012 Nonki Takahashi. All rights reserved.
'
' History:
' 0.1 2012/12/11 Created. (HMX882)
HMX882,C:\Users\Nonki\OneDrive\Documents\SmallBasic\Shapes\Art\XmasTree01.smallb asic,,Chirstmas Tree,2012-12-11,0.1,Nonki Takahashi,368,AddFlashLights BlinkFlas hLights Tree_Init Robot_Init Shapes_Add Shapes_CalcWidthAndHeight Shapes_CalcRot atePos Shapes_Move Shapes_Remove Shapes_Rotate Math_CartesianToPolar, Press any key to continue...

Program Database

This program has GUI (Graphical User Interface) and select programs with given properties.  Actually, I found a text compare subroutine like following parameters and modified it for this program.

Operators used in this program are from WHERE clause in SQL (Structured Query Language).

  • =
  • >
  • <
  • >=
  • <=
  • <>
  • AND
  • OR
  • LIKE

But in the current version, LIKE works just as partial match.

I will continue to develop for this project.  So please watch following discussion or repository.  Thanks.

See Also


Viewing all articles
Browse latest Browse all 669

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>