Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
4337660
ANDROID: fix method
chrisws Sep 12, 2015
f8d5fb4
ANDROID: fix display issues
chrisws Sep 13, 2015
4a6ca2b
ANDROID: edit line no used for scrolling
chrisws Sep 14, 2015
7a0bb66
SDL: update packaging
chrisws Sep 17, 2015
227efe0
SDL: update icon
chrisws Sep 21, 2015
133846c
UI: context menu edit completion
chrisws Sep 23, 2015
f43f143
SDL: fix osx build
chrisws Sep 24, 2015
64a3005
UI: added new file option
chrisws Sep 26, 2015
a6159d9
UI: update help
chrisws Sep 28, 2015
2deb2ed
UI: update help
chrisws Sep 28, 2015
e99806a
UI: update help
chrisws Sep 30, 2015
d0e187c
UI: update help
chrisws Oct 1, 2015
658b389
ANDROID: update edit help
chrisws Oct 2, 2015
7c817dc
UI: fix help scrolling
chrisws Oct 3, 2015
b5c30e2
UI: update help
chrisws Oct 4, 2015
f64e0c1
UI: fix line wrapped comments
chrisws Oct 6, 2015
67967f0
UI: fix line wrapped comments
chrisws Oct 6, 2015
f556382
UI: fix line wrapped comments
chrisws Oct 8, 2015
51edd44
UI: fix line wrapped comments
chrisws Oct 8, 2015
4d2a1bf
ANDROID: update freetype
chrisws Oct 11, 2015
ad1e3c4
UI: avoid editing online files
chrisws Oct 11, 2015
ebcad61
UI: fix loop when failing to load net file
chrisws Oct 12, 2015
9be583f
DOC: fix stray quote
chrisws Oct 13, 2015
bb5d0b7
UI: avoid unwanted scrolling
chrisws Oct 14, 2015
3a8049f
UI: completion includes non keywords
chrisws Oct 15, 2015
c69d716
UI: completion includes non keywords
chrisws Oct 15, 2015
292e7f3
UI: add copy paste keys
chrisws Oct 16, 2015
7c268d8
COMMON: update notes
chrisws Oct 17, 2015
8f005d8
COMMON: fix LET assignment to map/array field
chrisws Oct 20, 2015
a4e8c2b
COMMON: fix error handling segfault
chrisws Oct 22, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
2015-10-20
Fix LET when assigning a value to a MAP/ARRAY field

2015-09-15
SDL Update PEN(3) to work more like FLTK
Fix display output before PEN
Fix BOLD and ITALIC font display
Context menu edit keyword completion
Updated program icon
Editor line number widget can be used for scrolling
Updated editor help display
Fix TSAVE with try/catch

2015-08-26
Editor fixes:
- now displays an i-beam/edit cursor
Expand Down
39 changes: 2 additions & 37 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,49 +1,14 @@
# SmallBASIC
# Copyright(C) 2001-2012 Chris Warren-Smith.
# Copyright(C) 2001-2015 Chris Warren-Smith.
#
# This program is distributed under the terms of the GPL v2.0 or later
# Download the GNU Public License (GPL) from www.gnu.org
#

SUBDIRS = @BUILD_SUBDIRS@

EXTRA_DIST = \
AUTHORS \
ChangeLog \
configure.in \
NEWS \
README \
autogen.sh \
documentation/export_csv.bas \
documentation/sbasic_ref.csv \
documentation/HOWTO/HOWTO-DOCUMENT.TXT \
documentation/HOWTO/HOWTO-PORT.TXT \
documentation/HOWTO/DEVELOP.TXT \
documentation/LICENSE \
documentation/README \
documentation/README.UNIX \
images/logo.gif \
images/sb16x16.png \
images/sb32x32.png \
images/sb-desktop-16x16.png \
images/sb-desktop-32x32.png \
ide/smallbasic.lang \
ide/small-basic-mode.el \
ide/smallbasic.syn \
rpm/README \
rpm/SPECS/opensuse.spec

install-exec-hook:
(mkdir -p $(DESTDIR)$(pkgdatadir) && \
mkdir -p $(DESTDIR)$(pkgdatadir)/plugins && \
mkdir -p $(DESTDIR)$(pkgdatadir)/ide && \
mkdir -p $(DESTDIR)$(pkgdatadir)/samples && \
cp documentation/sbasic_ref.csv $(DESTDIR)$(pkgdatadir) && \
cp plugins/*.* $(DESTDIR)$(pkgdatadir)/plugins && \
cp ide/*.* $(DESTDIR)$(pkgdatadir)/ide)

deb:
fakeroot dpkg-buildpackage
fakeroot dpkg-buildpackage -b

test:
(cd @TEST_DIR@ && make test)
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
SmallBASIC is a fast and easy to learn BASIC language interpreter ideal for everyday calculations, scripts and prototypes. SmallBASIC includes trigonometric, matrices and algebra functions, a built in IDE, a powerful string library, system, sound, and graphic commands along with structured programming syntax

## Building the SDL version

Initial setup on linux
```
$ sudo apt-get install git autotools-dev automake gcc g++ libsdl2-dev libfreetype6-dev libfontconfig1-dev
$ git clone https://github.com/smallbasic/SmallBASIC.git
$ cd SmallBASIC
$ sh autogen.sh
```
Build in linux
```
$ ./configure --enable-sdl
$ make
Expand Down
42 changes: 19 additions & 23 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
dnl
dnl Configure script for SmallBASIC
dnl
dnl Copyright(C) 2001-2014 Chris Warren-Smith.
dnl Copyright(C) 2001-2015 Chris Warren-Smith.
dnl
dnl This program is distributed under the terms of the GPL v2.0
dnl Download the GNU Public License (GPL) from www.gnu.org
dnl

AC_INIT([smallbasic], [0.11.20])
AC_INIT([smallbasic], [0.12.0])
AC_CONFIG_SRCDIR([configure.ac])

AC_CANONICAL_TARGET
Expand Down Expand Up @@ -204,9 +204,24 @@ function buildSDL() {
dnl do not depend on cygwin.dll under cygwin build
PACKAGE_CFLAGS="${PACKAGE_CFLAGS} -mms-bitfields"
PACKAGE_LIBS="${PACKAGE_LIBS} -lwsock32 -lws2_32 -static-libgcc -static-libstdc++"
PACKAGE_LIBS="-Wl,-Bstatic ${PACKAGE_LIBS} `sdl2-config --static-libs` `freetype-config --libs`"
AC_DEFINE(_Win32, 1, [Windows build])
;;

*darwin*)
# OSX Check fontconfig configuration
PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= 2.2)
AC_SUBST(FONTCONFIG_CFLAGS)
AC_SUBST(FONTCONFIG_LIBS)

PACKAGE_CFLAGS="${PACKAGE_CFLAGS} ${FONTCONFIG_CFLAGS}"

dnl backlinking support for modules
PACKAGE_LIBS="${PACKAGE_LIBS} -ldl"
PACKAGE_LIBS="${PACKAGE_LIBS} ${FONTCONFIG_LIBS}"
PACKAGE_LIBS="${PACKAGE_LIBS} `sdl2-config --libs` `freetype-config --libs`"
;;

*)
# Unix - Check fontconfig configuration
PKG_CHECK_MODULES(FONTCONFIG, fontconfig >= 2.2)
Expand All @@ -218,17 +233,10 @@ function buildSDL() {
dnl backlinking support for modules
PACKAGE_LIBS="${PACKAGE_LIBS} -ldl"
PACKAGE_LIBS="${PACKAGE_LIBS} ${FONTCONFIG_LIBS}"
PACKAGE_LIBS="-static-libgcc ${PACKAGE_LIBS} `sdl2-config --static-libs` `freetype-config --libs`"
esac

PACKAGE_CFLAGS="${PACKAGE_CFLAGS} `sdl2-config --cflags` `freetype-config --cflags` -fno-exceptions"
case "${host_os}" in
*mingw*)
PACKAGE_LIBS="-Wl,-Bstatic ${PACKAGE_LIBS} `sdl2-config --static-libs` `freetype-config --libs`"
;;

*)
PACKAGE_LIBS="${PACKAGE_LIBS} `sdl2-config --libs` `freetype-config --libs`"
esac

dnl preconfigured values for SDL build
AC_DEFINE(_SDL, 1, [Defined when building SDL version])
Expand Down Expand Up @@ -339,19 +347,7 @@ function buildConsole() {
AC_SUBST(BUILD_SUBDIRS)
}

function buildDist() {
TARGET="Building source code release."
defaultConditionals
BUILD_SUBDIRS="src/common src/platform/gtk/src src/platform/gtk/data src/platform/gtk/icons"
BUILD_SUBDIRS="${BUILD_SUBDIRS} src/platform/fltk"
BUILD_SUBDIRS="${BUILD_SUBDIRS} src/platform/sdl"
BUILD_SUBDIRS="${BUILD_SUBDIRS} src/platform/unix"
AC_SUBST(BUILD_SUBDIRS)
}

if test x$ac_build_dist = xyes; then
buildDist
elif test x$ac_build_fltk = xyes; then
if test x$ac_build_fltk = xyes; then
buildFLTK
elif test x$ac_build_sdl = xyes; then
buildSDL
Expand Down
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
smallbasic (0.12.0) unstable; urgency=low
* Various - see web site

-- Chris Warren-Smith <cwarrensmith@gmail.com> Sat, 17 Sept 2015 09:45:25 +1000

smallbasic (0.11.17) unstable; urgency=low
* Fix compiler ignoring unused assignment values
* Implement IMAGE
Expand Down
8 changes: 1 addition & 7 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ endif
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
cp -f /usr/share/misc/config.guess config.guess
endif
./configure $(CROSS) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="-Wl,-z,defs" --enable-fltk
./configure $(CROSS) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --enable-sdl

build: build-stamp

Expand Down Expand Up @@ -69,17 +69,11 @@ binary-indep: build install
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs ChangeLog
dh_installdocs
dh_installexamples
dh_install --exclude=".git" documentation/sbasic_ref.csv plugins samples/distro-examples usr/share/smallbasic
dh_installman
dh_link
dh_strip
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
Expand Down
2 changes: 1 addition & 1 deletion documentation/build_kwp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ int main(int argc, char *argv[]) {
}

fprintf(stdout, "/* automagicaly generated file */\n");
fprintf(stdout, "struct KEYWORD_HELP {\n");
fprintf(stdout, "static struct KEYWORD_HELP {\n");
fprintf(stdout, " const char *package;\n");
fprintf(stdout, " const char *keyword;\n");
fprintf(stdout, " const char *signature;\n");
Expand Down
2 changes: 1 addition & 1 deletion documentation/sbasic_ref.csv
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ Language,keyword,SUB,657,"SUB foo (a, b)","Declare a sub procedure. Sub's do not
Language,keyword,THEN,658,"THEN","foo = 1: if foo==1 THEN: ? ""one"": fi"
Language,keyword,UNIT,659,"UNIT name","Units are a set of procedures, functions and/or variables that can be used by another program or unit."
Language,keyword,UNTIL,660,"UNTIL","a = 0: repeat: a++: ? a: UNTIL a = 10"
Language,keyword,USE,661,"USE","Used with various commands for passing a user-defined expression. eg SPLIT s," ",v USE TRIM(x). Trim each element of v."
Language,keyword,USE,661,"USE","Used with various commands for passing a user-defined expression. eg SPLIT s,"" "",v USE TRIM(x). Trim each element of v."
Language,operator,AND,662,"a AND b","Logical AND. Right side is not evaluated if left side evaluates to False."
Language,operator,BAND,663,"a BAND b","Bitwise AND."
Language,operator,BOR,664,"a BOR b","Bitwise OR."
Expand Down
2 changes: 1 addition & 1 deletion ide/android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package="net.sourceforge.smallbasic"
android:installLocation="preferExternal"
android:versionCode="15"
android:versionName="0.11.19">
android:versionName="0.12.0">
<!-- This is the platform API where NativeActivity was introduced. -->
<uses-sdk android:minSdkVersion="9"/>

Expand Down
46 changes: 42 additions & 4 deletions ide/android/assets/main.bas
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ func mk_bn(value, lab, fg)
bn.value = value
bn.label = lab
bn.color = fg
bn.backgroundColor = 0
mk_bn = bn
end

Expand Down Expand Up @@ -56,7 +55,7 @@ sub do_about()
print "(_ ._ _ _.|||_) /\ (_ |/ "
print "__)| | |(_||||_)/--\__)|\_"
print
print "Version 0.11.20"
print "Version 0.12.0"
print
print "Copyright (c) 2002-2015 Chris Warren-Smith"
print "Copyright (c) 1999-2006 Nic Christopoulos" + chr(10)
Expand All @@ -82,6 +81,40 @@ sub do_about()
cls
end

sub do_newfile()
color 3, 0
cls
print boldOn + "Create new program."
print boldOff + "To enable editing, display the menu then select Editor [ON]."
print "Press <enter> to leave this screen without making any changes."
print
local valid_file = false
while (!valid_file)
input "Enter file name: ", file
if (len(file) == 0) then
exit loop
endif
if (leftoflast(file, ".bas") == 0) then
file += ".bas"
endif
try
if (exist(file)) then
print "File " + file + " already exists"
else
dim text
text << "REM SmallBASIC"
text << "REM created: " + date
tsave file, text
valid_file = true
endif
catch e
print "Error creating file: " e
end try
wend
color 7, 0
cls
end

sub do_setup()
color 3, 0
cls
Expand Down Expand Up @@ -177,13 +210,14 @@ end

sub main
local basList, dirList, path
local frm, bn_about, bn_online
local frm, bn_about, bn_online, bn_new
local do_intro

dim basList
dim dirList

bn_setup = mk_menu("_setup", "Setup", -1)
bn_new = mk_menu("_new", "New", -1)
bn_about = mk_menu("_about", "About", -1)
bn_online = mk_menu(onlineUrl, "Online", 0)
bn_online.isExit = true
Expand All @@ -194,6 +228,7 @@ sub main
if (osname != "SDL") then
frm.inputs << bn_setup
endif
frm.inputs << bn_new
frm.inputs << bn_about

if (welcome) then
Expand All @@ -202,7 +237,6 @@ sub main

listFiles frm, path, basList, dirList
frm.color = 10
frm.backgroundColor = 0
rect 0, 0, xmax, lineSpacing COLOR 1 filled
at 0, 0
make_ui = form(frm)
Expand Down Expand Up @@ -249,6 +283,10 @@ sub main
frm.close()
do_setup()
frm = make_ui(path, false)
elif frm.value == "_new" then
frm.close()
do_newfile()
frm = make_ui(path, false)
elif frm.value == "_back" then
frm.close()
go_back
Expand Down
Binary file added images/sb-desktop-128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/sb-desktop-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/sb-desktop-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/sb-desktop-48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/sb-desktop-64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/sb4w.ico
Binary file not shown.
25 changes: 25 additions & 0 deletions samples/distro-examples/tests/uds.bas
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,28 @@ next i
inner.foo="bar"
m.b << inner
s = " " + m.b(0).foo

rem ------------------------------------

dim bar.x(2), foo(2)
bar.x(0).barx = 1024
foo(0).fooY = 999
if (bar.x(0).barx <> 1024) then
throw "Error 1"
fi

if (foo(0).fooY <> 999) then
throw "Error 2"
fi

if (1024 <> bar.x(0).barx) then
throw "Error 3"
fi

if (999 <> foo(0).fooY) then
throw "Error 4"
fi

bar.x(1).barx=bar.x(0).barx+976
bar.x(1).barx/=1000
if bar.x(1).barx <> 2 then throw "Yuck, I can't read red print on black background."
5 changes: 4 additions & 1 deletion src/common/blib_db.c
Original file line number Diff line number Diff line change
Expand Up @@ -751,9 +751,12 @@ void cmd_fsaveln() {
return;
}

dev_fopen(handle, (char *)file_name.v.p.ptr, flags);
int success = dev_fopen(handle, (char *)file_name.v.p.ptr, flags);
v_free(&file_name);
CHK_ERR(FSERR_GENERIC);
if (!success) {
return;
}
}

if (var_p->type == V_ARRAY) {
Expand Down
Loading