kollokollo / x11basic Goto Github PK
View Code? Open in Web Editor NEWX11-Basic BASIC programming language.
License: GNU General Public License v2.0
X11-Basic BASIC programming language.
License: GNU General Public License v2.0
would be nice and several users asked for that. Hmm... Ok, I am working on that.
I was trying out WAVE and SOUND
WAVE 1,1,0,,1 ! set sine wave, no attack
SOUND 1,500,1 ! play a permanent tone on channel 1
While it worked on Android (if channel 0 is chosen), I could not get any sound on Windows. (BEEP works, however)
I guess for Windows it is supposed to word with SDL. Any idea what could be the problem?
The windows/SDL version of Put_Bitmap does not match the description in the manual and the X11-version:
As the manual states, the correct behaviour is: Each line must start on a new byte. So a 9x12 Bitmap stores in 24 Bytes.
Let w denote the width of the image. Then the SDL-version (in function put_bitmap in window.c) expects the new line after exactly w bits! - So, if w is not a multiple of 8, the new line would start even in the middle of a byte.
I suppose it would not to hard to correct the code.
Also the GRAPHMODE has no effect in the SDL-version, but it does in Linux (X11).
System: Linux Mint 20.2 Cinnamon 64-bit
It should execute the program and launch fileselector
The interpreter produces a syntax error
WARNING at line 3: Syntax error: FILESELECT "load bitmap ...","./*.bmp","test.bmp",F$
Errors detected in examples/graphics/conv_bmp.bas. Can not run.
same thing happens on dla.bas
WARNING at line 9: Syntax error: CLEARW WARNING at line 19: Syntax error: COLOR COLOR_RGB(1,1/2,0) WARNING at line 22: Syntax error: COLOR YELLOW WARNING at line 29: Syntax error: PLOT J,Y1 WARNING at line 36: Syntax error: PLOT X,Y WARNING at line 37: Syntax error: SHOWPAGE WARNING at line 91: Syntax error: COLOR YELLOW WARNING at line 92: Syntax error: PLOT X,Y WARNING at line 93: Syntax error: SHOWPAGE WARNING at line 119: Syntax error: COLOR BLUE WARNING at line 120: Syntax error: PLOT X,Y WARNING at line 121: Syntax error: SHOWPAGE WARNING at line 136: Syntax error: SHOWPAGE WARNING at line 140: Syntax error: SAVEWINDOW "fractal.bmp" Errors detected in dla.bas. Can not run.
To compile I had to install libreadline8 since 7 wasn't available at the repository as well as some other dependencies. I am also attaching the list of warnings during compilation as a txt file.
I think that the message
#pragma message "######## switch of graphics!"
has some significance
In GFA basic you can also do:
SELECT i
CASE 1
PRINT 1
CASE 2 TO 30
PRINT "its in 2...30"
ENDSELECT
It would be nice to have this in X11-basic. Separating by comma is not feasible for large number ranges. Of course I can use an if-condition instead...
What do you think about it?
Is almost-compatibility with GFA-basic still a goal in this project?
The manual says: The Window is filled with the background color, which can be specified by COLOR.
In clearcw() in gkommandos.c we have:
#elif defined USE_SDL
SDL_FillRect(window[winnr].display,NULL,0);
The 3rd parameter should specify a pixel with the background color.
Hallo again. This time I am trying to install X11-Basic on Fedora.
./configure and make seem to work now without issues. When I do sudo make install
it seems that ImageMagick produces an error:
convert x11basic.eps x11basic.svg
convert: delegate failer `'potrace' --svg --output '%o' '%i'' @ error/delegate.c/InvokeDelegate/1952.
make: *** [Makefile:732: x11basic.svg] Error 1
I am using conda to build and install xbasic. However when I build with ./configure --prefix=/path/to/conda
, make fails to recognize this and will error out because it can't find the readline headers:
do_gets.c:22:10: fatal error: readline/readline.h: No such file or directory
#include <readline/readline.h>
^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
The issue where this occurs is at conda-forge/staged-recipes#8509
When I try to execute xbasic
in Fedora I get this error:
libx11basic.so.1.27: cannot open shared object file: No such file or directory
The log for make install was the following:
install -m 644 x11basic.svg /usr/local/share/icons/hicolor/scalable/apps/
install -m 644 x11basic.desktop /usr/local/share/applications/
install -s -m 755 xbasic /usr/local/bin/
install -s -m 755 fbxbasic /usr/local/bin/
install -m 755 ../examples/compiler/ybasic /usr/local/bin/
install -m 644 libx11basic.so.1.27 /usr/local/lib/
ln -s -f /usr/local/lib/libx11basic.so.1.27 /usr/local/lib/libx11basic.so.1
ln -s -f /usr/local/lib/libx11basic.so.1 /usr/local/lib/libx11basic.so
install -m 644 x11basic.a /usr/local/lib/
install -d /usr/local/share/man
install -d /usr/local/share/man/man1
install -m 644 doc/man-pages/x11basic.1 /usr/local/share/man/man1/x11basic.1
install -m 644 doc/man-pages/x11basic.1 /usr/local/share/man/man1/xbasic.1
install -m 644 doc/man-pages/ybasic.1 /usr/local/share/man/man1/ybasic.1
install -m 644 doc/man-pages/fbxbasic.1 /usr/local/share/man/man1/fbxbasic.1
install -s -m 755 xbc /usr/local/bin/
install -s -m 755 xb2c /usr/local/bin/
install -s -m 755 xbvm /usr/local/bin/
install -s -m 755 xbbc /usr/local/bin/
install -s -m 755 bas2x11basic /usr/local/bin/
install -d /usr/local/include/x11basic
install -m 644 x11basic.h /usr/local/include/x11basic/
install -m 644 xb2csol.h /usr/local/include/x11basic/
install -m 644 doc/man-pages/xbc.1 /usr/local/share/man/man1/
install -m 644 doc/man-pages/xbbc.1 /usr/local/share/man/man1/
install -m 644 doc/man-pages/xbvm.1 /usr/local/share/man/man1/
install -m 644 doc/man-pages/xb2c.1 /usr/local/share/man/man1/
install -m 644 doc/man-pages/bas2x11basic.1 /usr/local/share/man/man1/
There seems to be an issue when using open to retrieve information from a public API.
Calling http://worldtimeapi.org/api/timezone/Europe/Athens will produce a json string of the current time and some additional information.
However there seems to be no way to retrieve the information. The following code will produce an error
server$= "worldtimeapi.org/api/timezone/Europe"
open "UC",#2, server$,80
ERROR at line 2: Unknown Error init_sockadr
ERROR at line 2: Unknown Error OPEN
While this
server$= "worldtimeapi.org"
open "UC",#2, server$,80
print #2,"GET /api/timezone/Europe"
Will produce a
HTTP/1.1 400 Bad Request
Curl will correctly work with the API endpoints and fetch the json string. I imagine it's possible to use SYSTEM and call curl to workaround this, but it assumes that Curl will exist on the system and it's not quite as elegant as when handled by the language.
As one can see when comparing the 64bit linux with the (32bit) Windows versions.
Hm... this is a bigger task to fix...
X11-Basic is quite mature and versions are out for Android, Linux and WINDOWS. However there might be bugs which could be reported here or enhancement requests. Please feel free tp post them here in the issue list...
When I use the console on my mobile phone (Moto g6; Android 9) console doesn't show what I tipping in when I type in Letter, any other Symbol works. I also can't delete words.
I got the following error message when I execute "xbasic":
xbasic: error while loading shared libraries: libusb-0.1.so.4: wrong ELF class: ELFCLASS32
I'm using Ubuntu 20, on x64 architecture. How could I solve that issue?
Thanks in advance
When you use FSFIRST and FSNEXT the string returned is in the form:
"- filename.ext"
The workaround is to use REPLACE$(f$," -","") but I don't think this should be the expected behaviour.
This concerns the Windows/SDL platform.
KEYEVENT kc,ks,t$,k,x,y,xroot,yroot
after pressing "a", while holding the shift key I get
print kc,ks,t$,k,x,y,xroot,yroot
30 97 a 1 1 0 0 0
So the shift key is recognized. I expected t$='A' instead of 'a'.
Volume and mixing of channels could be influenced with a new command:
MIX ??,??
There is one more flaw with keyevent in Windows. The QWERTZ-keyboard layout isn't working for me. With the German and US keyboard layouts I get the same result, when I press the y-key on a QWERTZ keyboard:
print kc,ks,t$,k,x,y,xr,yr
44 122 z 0 1 0 0 0
The SDL_Keycode (in keyevent: ks) should be different for different keyboard mappings, only the SDL_SCANCODE (in keyevent: kc) should be unchanged.
This is the probably unresolved issue mentioned in #14
I'd like to generate macOS binaries and share with you.
Referring to the old discussion: https://sourceforge.net/p/x11-basic/discussion/mac/thread/b88a6293/#ce13
I simply did this:
git clone https://gitlab.com/kollo/X11Basic.git
cd X11Basic
git fetch origin apple
git checkout apple
cd src
./configure
This goes OK!
But with make
I get fatal errors:
$ make
gcc -Wall -MM -MT raw_keyboard.o -MT raw_keyboard.d raw_keyboard.c -o raw_keyboard.d
raw_keyboard.c:18:10: fatal error: 'linux/input.h' file not found
#include <linux/input.h>
^~~~~~~~~~~~~~~
1 error generated.
gcc -fPIC -shared -Wl,-Bsymbolic-functions -g -O2 -I/usr/X11/include -DUSE_X11 -O3 -Wl,-soname,libx11basic.so.1.27 -o libx11basic.so.1.27 xbasic.c tools.c loadprg.c file.c io.c io_basic.c parser.c variablen.c svariablen.c array.c parameter.c fft.c mathematics.c memory.c runtime.c wort_sep.c ltext.c functions.c sfunctions.c afunctions.c kommandos.c gkommandos.c bitmap.c do_gets.c errortxt.c window.c sysVstuff.c aes.c graphics.c sound.c number.c keywords.c decode.c virtual-machine.c vm-api.c type.c lodepng.c md5.c sha1.c -ldl -lm -lpthread -lutil -lreadline -llapack -lgmp -lgmp
io.c:104:9: warning: 'NAME_MAX' macro redefined [-Wmacro-redefined]
#define NAME_MAX FILENAME_MAX
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/syslimits.h:83:9: note: previous definition is here
#define NAME_MAX 255 /* max bytes in a file name */
^
io.c:820:95: warning: if statement has empty body [-Wempty-body]
if(setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &broadcastEnable, sizeof(broadcastEnable))<0) ; /* ignore error */
^
io.c:820:95: note: put the semicolon on a separate line to silence this warning
io.c:2668:15: warning: implicit declaration of function 'forkpty' is invalid in C99 [-Wimplicit-function-declaration]
pid_t pid = forkpty (&ret_fd,slavename, NULL, &win);
^
3 warnings generated.
sfunctions.c:235:50: warning: illegal character encoding in character literal [-Winvalid-source-encoding]
(*(n.pointer)=='`' && n.pointer[n.len-1]=='<B4>') ||
^
1 warning generated.
ld: unknown option: -Bsymbolic-functions
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libx11basic.so.1.27] Error 1
and then edited option.h
to add:
#define NOGRAPHICS 1
But I get linker error:
matt@matt:~/Projects/X11Basic/src$ make
gcc -Wall -MM -MT xb2c.o -MT xb2c.d xb2c.c -o xb2c.d
In file included from xb2c.c:25:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT xbvm.o -MT xbvm.d xbvm.c -o xbvm.d
In file included from xbvm.c:22:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT xbbc.o -MT xbbc.d xbbc.c -o xbbc.d
In file included from xbbc.c:31:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT main.o -MT main.d main.c -o main.d
In file included from main.c:34:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT raw_keyboard.o -MT raw_keyboard.d raw_keyboard.c -o raw_keyboard.d
raw_keyboard.c:18:10: fatal error: 'linux/input.h' file not found
#include <linux/input.h>
^~~~~~~~~~~~~~~
1 error generated.
gcc -Wall -MM -MT framebuffer.o -MT framebuffer.d framebuffer.c -o framebuffer.d
In file included from framebuffer.c:44:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT ccs.o -MT ccs.d ccs.c -o ccs.d
In file included from ccs.c:16:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT bytecode.o -MT bytecode.d bytecode.c -o bytecode.d
In file included from bytecode.c:25:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT type.o -MT type.d type.c -o type.d
In file included from type.c:13:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT vm-api.o -MT vm-api.d vm-api.c -o vm-api.d
In file included from vm-api.c:15:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT virtual-machine.o -MT virtual-machine.d virtual-machine.c -o virtual-machine.d
In file included from virtual-machine.c:17:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT number.o -MT number.d number.c -o number.d
In file included from number.c:16:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT sound.o -MT sound.d sound.c -o sound.d
In file included from sound.c:24:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT graphics.o -MT graphics.d graphics.c -o graphics.d
In file included from graphics.c:16:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT aes.o -MT aes.d aes.c -o aes.d
In file included from aes.c:16:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT sysVstuff.o -MT sysVstuff.d sysVstuff.c -o sysVstuff.d
In file included from sysVstuff.c:16:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT window.o -MT window.d window.c -o window.d
In file included from window.c:22:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT errortxt.o -MT errortxt.d errortxt.c -o errortxt.d
In file included from errortxt.c:9:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT do_gets.o -MT do_gets.d do_gets.c -o do_gets.d
In file included from do_gets.c:16:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT bitmap.o -MT bitmap.d bitmap.c -o bitmap.d
In file included from bitmap.c:23:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT gkommandos.o -MT gkommandos.d gkommandos.c -o gkommandos.d
In file included from gkommandos.c:19:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT kommandos.o -MT kommandos.d kommandos.c -o kommandos.d
In file included from kommandos.c:33:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT afunctions.o -MT afunctions.d afunctions.c -o afunctions.d
In file included from afunctions.c:15:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT sfunctions.o -MT sfunctions.d sfunctions.c -o sfunctions.d
In file included from sfunctions.c:23:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT functions.o -MT functions.d functions.c -o functions.d
In file included from functions.c:21:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT runtime.o -MT runtime.d runtime.c -o runtime.d
In file included from runtime.c:15:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT memory.o -MT memory.d memory.c -o memory.d
In file included from memory.c:11:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT mathematics.o -MT mathematics.d mathematics.c -o mathematics.d
In file included from mathematics.c:13:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT fft.o -MT fft.d fft.c -o fft.d
In file included from fft.c:5:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT parameter.o -MT parameter.d parameter.c -o parameter.d
In file included from parameter.c:14:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT array.o -MT array.d array.c -o array.d
In file included from array.c:14:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT svariablen.o -MT svariablen.d svariablen.c -o svariablen.d
In file included from svariablen.c:22:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT variablen.o -MT variablen.d variablen.c -o variablen.d
In file included from variablen.c:14:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT parser.o -MT parser.d parser.c -o parser.d
In file included from parser.c:20:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT io_basic.o -MT io_basic.d io_basic.c -o io_basic.d
In file included from io_basic.c:14:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT io.o -MT io.d io.c -o io.d
In file included from io.c:24:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
io.c:104:9: warning: 'NAME_MAX' macro redefined [-Wmacro-redefined]
#define NAME_MAX FILENAME_MAX
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/syslimits.h:83:9: note: previous definition is here
#define NAME_MAX 255 /* max bytes in a file name */
^
2 warnings generated.
gcc -Wall -MM -MT loadprg.o -MT loadprg.d loadprg.c -o loadprg.d
In file included from loadprg.c:15:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT tools.o -MT tools.d tools.c -o tools.d
In file included from tools.c:12:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT xbasic.o -MT xbasic.d xbasic.c -o xbasic.d
In file included from xbasic.c:47:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
gcc -Wall -MM -MT raw_keyboard.o -MT raw_keyboard.d raw_keyboard.c -o raw_keyboard.d
raw_keyboard.c:18:10: fatal error: 'linux/input.h' file not found
#include <linux/input.h>
^~~~~~~~~~~~~~~
1 error generated.
gcc -fPIC -shared -Wl,-Bsymbolic-functions -g -O2 -I/usr/X11/include -DUSE_X11 -O3 -Wl,-soname,libx11basic.so.1.27 -o libx11basic.so.1.27 xbasic.c tools.c loadprg.c file.c io.c io_basic.c parser.c variablen.c svariablen.c array.c parameter.c fft.c mathematics.c memory.c runtime.c wort_sep.c ltext.c functions.c sfunctions.c afunctions.c kommandos.c gkommandos.c bitmap.c do_gets.c errortxt.c window.c sysVstuff.c aes.c graphics.c sound.c number.c keywords.c decode.c virtual-machine.c vm-api.c type.c lodepng.c md5.c sha1.c -ldl -lm -lpthread -lutil -lreadline -llapack -lgmp -lgmp
In file included from xbasic.c:47:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from tools.c:12:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from loadprg.c:15:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from io.c:24:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
io.c:104:9: warning: 'NAME_MAX' macro redefined [-Wmacro-redefined]
#define NAME_MAX FILENAME_MAX
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/syslimits.h:83:9: note: previous definition is here
#define NAME_MAX 255 /* max bytes in a file name */
^
io.c:820:95: warning: if statement has empty body [-Wempty-body]
if(setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &broadcastEnable, sizeof(broadcastEnable))<0) ; /* ignore error */
^
io.c:820:95: note: put the semicolon on a separate line to silence this warning
io.c:2668:15: warning: implicit declaration of function 'forkpty' is invalid in C99 [-Wimplicit-function-declaration]
pid_t pid = forkpty (&ret_fd,slavename, NULL, &win);
^
4 warnings generated.
In file included from io_basic.c:14:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from parser.c:20:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from variablen.c:14:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from svariablen.c:22:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from array.c:14:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from parameter.c:14:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from fft.c:5:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from mathematics.c:13:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from memory.c:11:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from runtime.c:15:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from functions.c:21:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from sfunctions.c:23:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
sfunctions.c:235:50: warning: illegal character encoding in character literal [-Winvalid-source-encoding]
(*(n.pointer)=='`' && n.pointer[n.len-1]=='<B4>') ||
^
2 warnings generated.
In file included from afunctions.c:15:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from kommandos.c:33:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from gkommandos.c:19:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from bitmap.c:23:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from do_gets.c:16:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from errortxt.c:9:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from window.c:22:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from sysVstuff.c:16:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from aes.c:16:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from graphics.c:16:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from sound.c:24:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from number.c:16:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from virtual-machine.c:17:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from vm-api.c:15:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
In file included from type.c:13:
In file included from ./defs.h:17:
./options.h:88:11: warning: 'NOGRAPHICS' macro redefined [-Wmacro-redefined]
#define NOGRAPHICS
^
./options.h:8:9: note: previous definition is here
#define NOGRAPHICS 1
^
1 warning generated.
ld: unknown option: -Bsymbolic-functions
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [libx11basic.so.1.27] Error 1
(and same error when cloning from GitHub)
In a program I have the following expression
If (A% Mod 40=0)
This if clause is not working in X11-Basic.
After investigating a little, it seems that X11-Basic needs parentheses:
print 166 mod 40 = 0
returns -1.#IND
When I put extra parentheses, it works:
print (166 mod 40) = 0
returns 0
I suppose this is a bug. Otherwise, I would be happy to get an explanation.
(I am running the latest X11 version on debian stretch.)
I run from the shell:
xbasic blah.bas
At the end of the BASIC program, I am left in the xbasic prompt.
I would like to be dropped back to the shell. I can achieve this by adding QUIT at the end of my program, but this is inconvenient, and easily missed if, e.g. there is a conditional exit in the middle of the program, for which I am used to using END, the classic BASIC command for exiting the program. Or the code might not be mine, and it uses END to exit.
I would like to be able to do something like:
xbasic -q blah.bas
which would have the effect of quitting xbasic when the program ends.
I was trying to translate an old GFA-basic jump&run to X11Basic, but I cannot make the controls work.
Is there no function or workaround to detect if a key is currently pressed on the keyboard?
KEYEVENT does not help, because I cannot detect if or when the key is being released.
INKEY$ does not detect anything if the graphic window is active.
And concerning the joystick: Stick() and Strig() are not implemented.
Please pardon my ignorance but I am struggling to find relevant information’s
There should be clearily structured different Folders for installs and brief instruction included in that folder:
Windows_Install
Linux_Install
Android_Install
Within the each Folder (if user is interested in Windows does not need to see Linux info) there should be code/program to download and single few slide PowerPoint instruction:
Few PowerPoint instruction slides with arrows, and such structured in way if user is interested in Windows should be able to find in repository branch to Windows only and not seeing anything else not relevant.
I am interested in Windows only managed to download but- It opens some prompt command like looking program X11-BASIC, there is no info even how to even save programs within.
Allows to type/execute code and that’s it.
Currently I use BASIC-2 on 1986 Amstrad PC1512DD (8 MHz, 512 kb, 5.25’’ 360 kb floppies) under 1986 GEM Locomotive BASIC-2.** I have 1986 book "Simply BASIC2 programs on Amstrad PC1512" and clear original manuals and follow it easily- instantly.
I can instantly save my program on floppy and F9 to execute using interpreter- very good software.
I am trying to replicate the code, using your X11 one as can deal with bigger integer but I cannot even follow the GitHub or Sourceforge repository as it not structured well. To finalise my research and validate my code written on 37 years old software. I am stack in the beginning- as there are multiple documents and noting is clear.
Simplification is key- infographics are for such.
If you could guide me please would be greately appreciated.
Thank you
Michal
The Fileselector is limited to the drive you choose at the start. There is no way to choose drives. This doesn't happen in GFA BASIC for TOS, the fileselector there allows you to choose the drive.
Some more documentation is needed in how the Fileselector command works, especially since unix and TOS have different seperators for directories.
I fear there might be something wrong with the colon operator for arrays:
foo() = [1,2,3]
dim b(3)
b(0:1)=foo(1:2)
print b(0)
2
print b(1)
0
I expect print b(1)
to be 2 and print b(0)
to be 1.
Another experiment:
d()= foo(1:2)
print d(0)
2
print d(1)
2
I think print d(0)
should be 1.
What is going on? Am I doing something wrong?
Have MQTT Support, so that X11-basic can be used to implement rule engines and more for the IoT .
This is specially interesting on a Raspberry Pi.
GUI error (X11-Basic 1.25-47, Windows version)
Two typical example codes (from the X11-Basic 1.25 manual - pp. 97 and 414, respectively) are provided as an example together with identical original file menutest.bas from the source (examples2/tests). They both are working fine under the interpreter, i.e. in .bas format. However, upon compilation (by xbc.exe) to standalone .exe (option 1) or bytecode .b (option 3) the produced executable files lack the responding function of pull down menu. When a particular item (e.g. File-Quit) in the menu is hit by mouse cursor, no action is observed (in GUI / on console).
Options 2 and 4 (with tcc) were also tested but it was found no improvement.
See line 1555 and 1556 in https://github.com/kollokollo/X11Basic/blob/master/src/gkommandos.c:
case SDL_KEYDOWN:
if(e>0 && plist[0].typ!=PL_LEER) varcastint(plist[0].integer,plist[0].pointer,(event.type==SDL_KEYDOWN)?EVENT_MOUSEBUTTONPRESS:EVENT_MOUSEBUTTONRELEASE);
Instead of ?EVENT_MOUSEBUTTONPRESS:EVENT_MOUSEBUTTONRELEASE);
this should be ?EVENT_KEYPRESS:EVENT_KEYRELEASE);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.