This macro brings all the power of the 1980's BASIC programming language to your WebGUI site!
Syntax
DATA
Example Program
10 FOR J=1 TO 10
20 PRINT "Hello World!<br />"
30 NEXT J
Installation
You're going to need the Language::Basic perl module installed on your server.
perl -MCPAN -e shell
install Language::Basic
exit
Then copy Basic.pm into your lib/WebGUI/Macro folder, add it to your WebGUI config file, and restart your web server.
Usage
To use this module simply create a Snippet asset with your program in it. Then use the URL of the snippet in combination with the Basic macro to execute your program:
^Basic(programs/helloworld.bas);
Caveats
Do not do anything that would cause a loop to not exit. The macro currently has no way to detect infinite loops and therefore the only way to kill a program in an infinite loop is to restart your web server. For this reason I recommend testing your program using a command line interpreter first. And it just so happens that I've included a command line interpreter as an attachment to this post. To use it just type:
perl basic.pl programname.bas
Versions
1.0.0 - Initial release
1.0.1 - Bugfix in output redirect thanks to Martin Kamerbeek