diff --git a/src/net/apocalypselabs/symat/Functions.java b/src/net/apocalypselabs/symat/Functions.java index af6b221..b1cd57a 100644 --- a/src/net/apocalypselabs/symat/Functions.java +++ b/src/net/apocalypselabs/symat/Functions.java @@ -98,6 +98,16 @@ public class Functions { public void notify(Object message) { JOptionPane.showInternalMessageDialog(Main.mainPane, message.toString()); } + + /** + * Display message dialog. + * + * This is an alias to help JavaScript programmers. + * @param message The message + */ + public void alert(Object message) { + notify(message); + } /** * Display an input dialog box with a text field. @@ -108,6 +118,26 @@ public class Functions { public String ask(String question) { return JOptionPane.showInternalInputDialog(Main.mainPane, question); } + + /** + * Pause execution for the specified number of milliseconds. + * @param millis + */ + public void pause(long millis) { + try { + Thread.sleep(millis); + } catch (InterruptedException e) { + // Nothing to do. + } + } + + /** + * @see pause() + * @param millis + */ + public void sleep(long millis) { + pause(millis); + } /** * Quit SyMAT. diff --git a/src/net/apocalypselabs/symat/functions.py b/src/net/apocalypselabs/symat/functions.py index 9d9d6fc..3f81a51 100644 --- a/src/net/apocalypselabs/symat/functions.py +++ b/src/net/apocalypselabs/symat/functions.py @@ -56,3 +56,7 @@ def rand(min,max): return _.rand(min,max) def randb(): return _.randb() +def sleep(x): + _.sleep(x) +def pause(x): + _.pause(x)