package org; import java.io.IOException; import javax.microedition.lcdui.Display; import javax.microedition.midlet.MIDlet; import javax.microedition.midlet.MIDletStateChangeException; import org.hecl.HeclException; import org.hecl.Interp; import org.hecl.Thing; import org.hecl.midp20.MidletCmd; import org.hecl.misc.HeclUtils; public class Test extends MIDlet { protected Interp interp = null; protected void destroyApp(boolean b){ notifyDestroyed(); } protected void pauseApp() { } protected void startApp() { Display display = Display.getDisplay(this); try { interp = new Interp(); // load extensions into interpreter... // RMSCmd.load(interp); // HttpCmd.load(interp); MidletCmd.load(interp, this); String scriptcontent = HeclUtils.getResourceAsString(this.getClass(),"/test.hcl", "UTF-8"); Thing ret_value = interp.eval(new Thing(scriptcontent)); System.out.println(ret_value.toString()); } catch (HeclException e) { e.printStackTrace(); destroyApp(true); } catch (IOException e) { e.printStackTrace(); destroyApp(true); } } }