Hi Clyde, I need more details of what you have tried. May I assume, that you have used Version 1.22? This is way outdated. You should try the moset recent version of X11-Basic, which is 1.28. Here are the most recent sources: https://codeberg.org/kollo/X11Basic Or if you need a .tar.gz file: https://codeberg.org/kollo/X11Basic/releases or a binary install file (most recent there is 1.27) (The files on sourceforge are not so recent, sorry there is nobody who has time to clean up or update the ancient...
Yes it is possible. However you would need to compile X11-Basic from the sources. Maybe you can create a fake libreadline.so.7 which is a copy of .8. but I do not know if that works. BTW: Olter versions of X11-Basic have the libreadline.so.7 as requirements. Try old .deb files from the time, .7 was most recent. (however you would get an old version of X11-Basic, thats not so good).
Hi me, It looks like the libreadline is missing. Usually this can be installed from the readline package. But it needs to be the correct version (8). Older linux distributions come with the Version 7 of readline. This X11-basic package needs Version 8.
Ich habe den Fehler mal in unser Bug-Tracking auf codeberg mit aufgenommen. (Ich hoffe, das ist so i.O. für Dich) Die Haupt-Code-Entwicklung geschieht inzwischen nicht mehr auf Sourceforgse sondern dort. https://codeberg.org/kollo/X11Basic/issues/6
Ich habe den Fehler mal in unser Bug-Tracking auf codeberg mit aufgenommen. (Ich hoffe, das ist so i.O. für Dich) Die Haupt-Code-Entwicklung geschieht inzwischen nicht mehr auf Sourceforgse sondern dort.
Ja, stimmt. Mit dem WIndows-Emulator (wine) kann ich es reproduzieren. Seltsam!
Hab gerade Dein Programm laufen lassen. Offenbar auch alles in Ordnung. > xbasic test.bas > more testb.txt dez hex bin Dann muss es ein spezifisches WINDOWS Problem sein.
Hallo Hartmut, Danke für das Feedback. Das ist ja ein Ding. Offenbar wird die letze Ziffer abgeschnitten. Aber ich habe versucht, das mal auf die Schnelle zu reproduzieren (hier auf meinem Linux-System), da ist zumindest alles in Ordnung. print bin$(8) 1000 print bin$(4) 100 print bin$(8,8) 00001000
Well, you can at least put the array as "by reference" in the parameter list. (See the VAR statement). This way your subroutine can modify the array content.
Well there is actually an installation package for X11-Basic on WINDOWS. It is on codeberg: https://codeberg.org/kollo/X11Basic/releases Maybe this is what you want?
Well, to make use of more Processor-cores, I had the idea to use OpenMP wherever it makes sense, but, in the end, I thought: who needs that? It is a big effort for little gain. The FORK kommand works at least. And one can split the most critical tasks in several sub-programs which can be excecuted (with SYSTEM) in parallel, if needed. Interprocess communications via files (/run/shm/) or so. To keep it easy. But If you really want, and can provide help, one could improve X11-basic step by step also...
Well, as said in the manual: This command is not fully implemented and at the moment messes up the program execution stack of the interpreter since all internal control structures are accessed by two threads. Anyway, in a natively compiled program this can work as expected. It definitively does not work on WINDOWS and ATARI/TOS. On Android maybe. It is realized with the fork() command internally (and this does not behave like threads, which you probably have in mind.) and I am not sure if an app...
What is your concern about in detail?
I have made a .deb for debian jessie. Still Interested?
A new version is out. 1.27-62 See here: https://codeberg.org/kollo/X11Basic/releases
sqlite should work (again) with the new versions of X11-Basic 1.27-63. So this issue is fixed now.
Well, there is the tool barcode on liniux. You can simply do a SYSTEM "barcode -b "Hello World" -E -o barcode.eps" to generate a barcode (into the file barcode.eps).
OK. So at least this is not a general issue here. Thanks for testing. So, i suggest, if the OP has no further details, we can close this issue here.
Ok, great. Thanks for testing. So this issue can be closed.
This is a good question. I have encountered this also on a linux system. It looks like the port (in your case 5510) gets blocked for a long time. This can happen, when the socket is not closed. e.g. when the program aborts (with an error or even crashes) before the close. Or if the connection gets broken/interrupted. Why it takes so long for the system to detect this, I dont know. If you can always close the socet, then it should not happen and the port would get released. If you want to write a...
X11-Basic now at codeberg
This library is only needed if you want to compile standalone excecutables for MS WINDOWS. It need to be installed in the general X11-Basic folder. It is already outdated.
Hm. That would be a mayor issue. Unfortunately I do not have any Android 10 Device to confirm or test. Does anybody else also have this problem?
Great, many thanks!
It works (at least on linux). Maybe this is an issue for the WINDOWS version. (?) Am I right?
At least it used to have a syntax definitoin file for X11-Basic. Maybe it is removed now, I have not recently tested it. The systax definition file for X11-Basic for "920 Text-Editor" can be found here: https://codeberg.org/kollo/X11Basic/src/branch/master/doc/editors/920.conf
Spaces are significant. If you want X11-Basic to calculate something, without assigning it to a variable or printing, the line has to start with a digit (0-9) otherwise the first word is interpreted as a command. so, do a 1*sqrt(2) instead. Yes, the variable ANS will hold the result of the latest of such calculations.
The issue on Android 5.0 up to 9 has been fixed now. Please test the most recent version: 1.27-63 (163) p.ex. found here: https://f-droid.org/en/packages/net.sourceforge.x11basic/
Yes, the sqlite excecutable is likely to work on Android (tested from 5.0 up to 9 with X11-Basic for Android recent version currently availabe on f-droid, Version 1.27-63 (163) ). https://f-droid.org/en/packages/net.sourceforge.x11basic/ But: You will have to delete the old sqlite excecutable file in the bas/ folder. For the example programs, please look at the repository: https://codeberg.org/kollo/X11-Basic_examples
Hm, OK. I am open for suggestions how to fix this. In most cases SDL is only used with one single screen or window. (linux does not have this problem, because SDL is not used there, instead direct calls to X.org are made, and so you can open and manage multiple windows.)
The problem is Android related. sqlite is called as a native excecutable from X11-Basic. This is not possible anymore in more recent Android versions. So sqlite needs to be implemented as a library or something like that. I am not an expert on sql at all, so I would need advice/suggestions how this should be implemnted in X11-Basic (maybe as a built-in command).
You can read and write thouse files, but you would not be able to seek into the area >2GB. Maybe with successive RELSEEK in steps. LOF also cannot report the correct file size. You would also contruct a workarount (with RELSEEK). Or: use shell commands to split the file first, then read parts. Or call system sunctions (LINK and CALL) directly....
Unfortunately there is no buildin command for this. You can just save an image or a video from the camera app and then access it as a file from X11Basic.
Hm, yes. The windows version is incomplete. Sorry.
Well, I have no good idea. I would put it to the Folder with the other files (xbc.exe).
Hi Duke, OK, I see, its the WINDOWS Version. Have I really again not put it into the package? So I am going to upload a recent version to the files section. SOrry for this.
Fixed: I had myself defined an internal sgn-macro, which was wrong. This error must have been in X11-Basic for decades.... Next release should have that fixed.
confirmed. Strange enough X11-Baic uses a system function sgn() for it. And I cannot find any documentation for it. Looks like I have to reimplement it. Thanks! It should also work for big integer numbers...
I think, on WINDOWS, the root path "/" does not exist. So "d /" will cause that error. However it probably defaults to something (like "C:/" or the current directory). Have you tried to use "d C:/" on windows? IF WIN32? AllDirs$() = [ "d C:/" ] ! Looking for adventure else AllDirs$() = [ "d /" ] ! Looking for adventure endif
I think, on WINDOWS, the root path "/" does not exist. So "d /" will cause that error. However it probably defaults to something (like "C:/" or the current directory). Have you tried to use "d C:/" on windows? IF WIN32 AllDirs$() = [ "d C:/" ] ! Looking for adventure else AllDirs$() = [ "d /" ] ! Looking for adventure endif
I dont know. One would have to test that. But why should it have an impact?
I dont know. But why should it? There is a compatibility level in Android. Old apps can run on newer Android versions. I think the issue mentioned above is just about the Play store and API level 28 (for the compilation of the app). The f-droid play store has no such restrictions, at least until now.
The parser operates on values not on references. So it takes the content of C$ and passes it to LEN(). VARPTR() would be different, here the content ist the reference to the variable. Therefor VARPTR(a$+b$) would not work. BTW: my favrite would be VARLEN().
We could either introduce a function STRLEN(svar$) or VARLEN(var), or a function STRPTR(svar$). STRLEN would be streight forward: return the length of the string. VARLEN would be more general: return the amount of bytes belonging to the content of the variable. this would return 8 for float variables and 4 for int variables, and maybe some useful value for arrays. STRPTR would return a pointer into memory where the length could be received from with LPEEK(). Also the pointer of the string could be...
We could either introduce a function STRLEN(<svar>) or VARLEN(), or a function STRPTR(<svar>).</svar></svar> STRLEN would be streight forward: return the length of the string. VARLEN would be more general: return the amount of bytes belonging to the content of the variable. this would return 8 for float variables and 4 for int variables, and maybe some useful value for arrays. STRPTR would return a pointer into memory where the length could be received from with LPEEK(). Also the pointer of the string...
No not really, because the parser cannot handle it this way. One could introduce new functions STRLEN() or something like that, which can take only(!) a variable reference as argument (and not an expression). But maybe the workaround with ARRPTR() and BMOVE could do well enough: ' This function is faster than MID$() if the string is longer than ' 100000 Bytes (interpreted) or 20000 bytes (compiled). function fast_mid$(VAR t$,a,b) LOCAL ret$ ret$=SPACE$(b) BMOVE VARPTR(t$)+a,VARPTR(ret$),b return...
X11-Basic GUI
The USB-SUpport is now compiled in by default in the LINUX systems. (Only if libusb is present). On WINDOWS and Android it is still not working.
It has been solved in following way:CTRL-D now quits the interpreter in interactive mode, but on INPUT only the INPUT command is aborted and the rest of the program can continue. Thank you for mentioning this issue. And also for your patch and comments.
Ctrl-D (EOF) causes seg fault
It has been solved in following way:CTRL-D now quits the interpreter in interactive mode, but on INPUT only the INPUT command is aborted and the rest of the program can continue.
I do not know it. So it would also be hard for me to target it and test it. I always wantet to target NodeMCU, because I own some, but I had no pressure to do so so far.
Well, I think the user interface is most important. How to open a file, write a program, access documentation, compile the program to an .exe. There should be no obstacles, otherwise nobody would want to use it. A competitor is "yabasic" (an interpreter) but I think X11-Basic is already better. ALso "freebasic" (a compiler) is very popular on WINDOWS.
I am using the system timer of WINDOWS plus a UNIX timestamp saved when the TIMER was first used. So this means: STIMER and TIMER can be off by up to 1 Second. Also maybe the systemtimer is not in sync with the clock. So STIMER and TIMER can slightly drift away.
Yes. The WINDOWS version is most neglected by me. This is because I do not own any computer running WINDOWS. So I always have to test the stuff on a friends comupter. Which is very uncomfortable. I am looking for a maintainer for the WINDOWS-Version, but until now, nobody has volunteered.
I think I have fixed this now. in version 1.27-59.
No, not really. I was rather thinking of MATLAB like matrix functions and also recusive definitions (matrix of matricies, etc...) X11-Basic is prepared for this in the sense of that the concept and the way it is implemented would more easily allow this. However, the implementation is still stub, because the concept of matrix of anything was not so useful, or at least I have not needed it so far.
I have fixed this now. TIMER now behaves the same on WINDOWS, LINUX and ANDROID. Can be tested in the next release (1.27-59).
Yes, UNMAP und MSYNC are already implemented, but MMAP is not. (for some reason I have forgotten).
Yea, the timer-value on WINDOWS resets to zero every time the interpreter restarts. I do not think that there is a system timer like on UNIX machines. But one can implement one maybe calculating the UNIXtimer from the clock values. Maybe this would be a good issue for improvement. Corrently the TIMER does following on WINDOWS: return((double)clock()/CLOCKS_PER_SEC); So it uses the OS function "clock()". I was partially wrong: STIMER works and gives the UNIX-timestamp of the current local time. However...
Aha, thank you. Another bug. I could not see it, because on my WINDOWS machine (which I rarely use) ther was a permission denied error when saving the .exe. I am not sure on which version this bug showed up. I> fear that it has been there unseen for a long time....
Yea, the timer-value on WINDOWS resets to zero every time the interpreter restarts. I do not think that there is a system timer like on UNIX machines. But one can implement one maybe calculating the UNIXtimer from the clock values. Maybe this would be a good issue for improvement. Corrently the TIMER does following on WINDOWS: return((double)clock()/CLOCKS_PER_SEC); So it uses the OS function "clock()".
Yea, I had forseen the MMAP function in X11-Basic for this, But I think I have never really used it, so I cannot say, if it is useful or not.
Hm. indeed, I can confirm this. Thank you for mentioning. I had not seen this. This is a new bug introdiced in 1.27-58 (I think). Hm. I still have no Idea what caused this. Something in loadprg/loadbytecode. But I do not see this on linux. Hm...
It looks for it in the directory from which xbc was called. That is C:\Users\trollollio
Looks like the 24bit address space is exaustet (32bit WINDOWS in reallity only 24bit?) I dont know. On Linux the program continues until all 2GBytes RAm plus some SWAP space is eaten up, Then the program was killed by the OS.
new.bas.~~~ is generated by an EDIT command. It is just a temporary file. Concerning this error: I think I have found it. (The crash manifested only on the WINDOWS version, al though the error was also in the linux version). It was a bug in the LOAD mechanism. It was introduced with the dynamic stack handling. I have released new files for WINDOWS. Thanks for testing. However, even in the 1.27-58-unstable release I do see an error on WINDOWS: run the compiler, select demo.bas, select option "1" and...
new.bas.~~~ is generated by an EDIT command. It is just a temporary file. Concerning this error: I think I have found it. (The crash manifested only on the WINDOWS version, al though the error was also in the linux version). It was a bug in the LOAD mechanism. It was introduced with the dynamic stack handling. I have released new files for WINDOWS.
Is it possible to enter commands (like XRUN?)
Ups. I have not noticed this. I have no idea what was wrong. Maybe I should roll out the more stable older versions 1.26-57 (without unstable) first.
UPS, it seems that I have messed something up in the compiler. I was so much focused on fixing the bugs in the interpreter.... Thank you for testing.
UPS, it seems that I have messed some up in the compiler. I was so much focused on fixing the bugs in the interpreter.... Thank you for testing.
It was a stupid bug, and is fixed now. Wait for 1.27-58.
UPS, it seems that I have messed some up in the compiler. I was so much focused on fixing the bugs in the interpreter....
And here (in case you are inerested) is the complete list ofall commits, all changes to X11-Basic: https://gitlab.com/kollo/X11Basic/-/network/master And you can see the relations to the tags/releases
Here is the list with tagged commits: You can see exactly which changes have been made for which release. https://gitlab.com/kollo/X11Basic/-/tags However, the -unstable releases have intermediate states, so in most cases they reflect at least(!) the state given by the release-number/tag but may also have already further fixes, which had not been released at that time.
All -unstable releases are a littlebit different depending on the exact commit used at the time of building it.
Well, the TomTom platform is nearly dead. There is no possibility anymore to install external apps on it. You can only use it wih old devices navcore<v.9.
Please be patient, the build of the Android version is very difficult and always takes time (more than an hour). FLUSH should not be used in this contect (it is very expensive on Disk operations).
I have fixed it. Now the statck sizeis dynamically adjusted in steps of 512 up to a (hardcoded) maximum which is 8000 (recusion depth) at the moment, or better say in the next release of X11-Baisic. Also the app will not crash, when the limit is reached, but will print out an error message instead. The upper maximum is necessaary, because an endless recursion loop would oherwise eat all of the available system memory which in the end causes a crash, but before wold slow down and freeze the device....
I have fixed it. Now the statck sizeis dynamically adjusted in steps of 512 up to a (hardcoded) maximum which is 8000 (recusion depth) at the moment, or better say in the next release of X11-Baisic. Also the app will not crash, when the limit is reached, but will print out an error message instead. The upper maximum is necessaary, because an endless recursion loop would oherwise eat all of the available system memory which in the end causes a crash, but before wold slow down and freeze the device....
I have fixed it. Now the statck sizeis dynamically adjusted in steps of 512 up to a (hardcoded) maximum which is 8000 (recusion depth) at the moment, or better say in the next release of X11-Baisic. Also the app will not crash, when the limit is reached, but will print out an error message instead. The upper maximum is necessaary, because an endless recursion loop would oherwise eat all of the available system memory which in the end causes a crash, but before wold slow down and freeze the devic...
I have fixed it. Now the statck sizeis dynamically adjusted in steps of 512 up to a (hardcoded) maximum which is 8000 (recusion depth) at the moment, or better say in the next release of X11-Baisic.
Well, increasing the stack size from 512 to any other number would be a quick fix. Implementing a dynamic adaption is a lot of work. Thats why I ask.
FYI: The call stack size is 512. This will limit recusion depth. The value is arbitrary and comes from 20 years ago when RAM was expensive and limited. What stack size would your program need?
OK, I am also confused why I have to approve your post.... Well, SF has bugs.
Hm, OK. Can you be more specific? What version of X11-Basic are you using? What is the kind of recursion problem you see?
Yes, ASC returns a signed byte, which is later converted to int and then double. Do you think it is a problem? Should it be like this or would the user prefer unsigned values in any case?
No, the string content of Huge$ would get copied by the parser. So a PEEK(VP) is faster in nearly any case. On the other hand the eypression (CHR$, PEEK, AND, +, .) is more complicated, so for small strings probably the MID$() would be faster.
The string length is kept in an internal structure, not officially accessable. There are other information stored as well, like the type of the variable, its name, if they are local or not etc, static or dynamic... the adress of this structure could be returned by arrptr(), but arrptr() only allows arrays as argument.
yes exactly. a copy of the content of a$ is not needed when adding b$+c$+d$ to it.
len does not operate on variables, but on content. a string itself need not be linked to a variable, it can as well be an intermediate result in an expression.
The string length is kept in an internal structure, not officially accessable. There are other information stored as well, like the type of the variable, if they are local or not etc...
The sample programs are built in the X11-Basic apk file (they are not downloaded). Unfortunately they cannot be removed. Sorry. Since you are not the first with requesting beeing able to remove them, I think of it. Maybe the issue can be solved with a better file selector which would allow selecting from subfolders. The the sample programs would be in their own folder.
Hm, are you sure, you have posted this in the right forum? Here it is about X11-Basic, the BASIC programming language.
I am proud to announce that we now have syntax highlighting files for gedit and nano.
Yes, the icon currently can only be the bomb. Can you be more specific about the inadequate results when your program is started from the desktop shortcut?
I wanted to keep you in the loop in case you were interested. I was able to finally get a shortcut after trying several things from page 17 of the manual. By the way, I have V5.1.1 Android. The icon is that of a fused bomb. Is that per design (scary to try).? However, the object file does not provide the same (adequate results) as the .bas or .b file loaded from the x11 launcher, so I’m going to have to give up on that for now. Thanks for your help again… Kevin
I think I know what you’re thinking, and it probably goes something like “if this guy can’t figure this out, then he probably shouldn’t be using X11 in the 1st place. And I understand. I am a retired engineer with a fairly extensive s/w background, but all of it is old tech, 8080, 8085, etc. I have googled this, and tried several things, but I am not savvy with cell phone technology. Would you mind a primer on how to create a desktop shortcut from a compiled basic app? I would appreciate it. - K...
X11-Basic in F-Droid