I've made a version of the original Cellular basic that reads from the
jar with some additional changes.
- Full screen mode in graphics screen.
- no numbers printed when pressing the keys.
- can load very big .bas files but you can not edit them.
how to use :
if you want to add basic programs you must rename the JAR file to ZIP
and then place
inside the 'programs' folder your programs.After that , rename it back
to JAR.
run the jar , select 'load a program from jar' type the name of the
program without the .bas extension , press 'read' , go back to the
menu and run it.
get it here
[
http://groups.google.com/group/cbasjf/files]
or here
[
http://rapidshare.com/files/406959635/CellularBasic-JF.jar]
I would like to see the 'PRO' version with this feature ;)
--------------------------------------------------------------------------------------
the core of the hack is in the " read() ;" in "CellularBasic.java"
import java.io.DataInputStream;
public void read() {
Thread t = new Thread() {
public void run() {
try {
String select = srcTextBox.getString(); // i use the text in the
srcTextBox as filename
DataInputStream in = new DataInputStream( //jf
this.getClass().getResourceAsStream("/programs/"+select+".bas")); //
jf
text = new StringBuffer(); ;
byte[] bb = new byte[1];
// read the file
while( in.read(bb) != -1 ) {
if ((char)bb[0] == '\r') { continue; }
text.append(new String(bb));
}
in.close(); //jf
// write contents into srcTxtBox
srcTextBox.setString(select+".bas ok_"); //jf
display.setCurrent(srcTextBox);
} catch (Exception e) { e.printStackTrace();
display.setCurrent(new Alert("Error")); }
}
};
t.start();
}
JF