TextBox

TextBox is a ASP-like script host that will process any file you give it looking for:

TextBox pre-processes the text to turn the whole thing into into script and hands it to the scripting engine for execution, outputting the result to standard out. Whatever features of the scripting language you want to use, feel free.

Usage

To provide for I/O, TextBox emulates ASP somewhat. It provides two intrinsics, the request object and the response object. The Request object has a single property, QueryString, that works just like ASP. The Response object has a single property, Write, just like ASP. In fact, if you only use Request.QueryString and Response.Write, you should be able to test your script files using ASP.

To set name/value pairs for use by the script via the Request object, the usage of TextBox is like so:

    usage: textbox <file> [name=value]

For example, to interpret the file above, any of the following command lines would work:

    textbox test.cpp.asp
    textbox test.cpp.asp greeting="Double Wahoo!"
    textbox test.cpp.asp iostream=true greeting="Double Wahoo!"
    

The first would yield the following output:

    // test.cpp

    #include <stdio.h>

    int main()
    {
        printf("Hello, World.\n");
        return 0;
    }
    

while the last would yield the following:

    // test.cpp

    #include <iostream>
    using namespace std;

    int main()
    {
        cout << "Double Wahoo!" << endl;
        return 0;
    }
    

Errors and Debugging

If the scripting engine finds an error, it will notify TextBox, who will notify you. However, if you've got script debugging enabled on your machine, the scripting engine will ask you if you'd like to fire up the debugger, showing you exactly the offending code.

Not Just Code

Of course, TextBox is good for the generation of any text, not just code.

Download

TextBox is available for download. It's just a prototype, so please adjust your expectations accordingly. If you have any comments, please send them to csells@sellsbrothers.com.

Copyright

Copyright (c) 1998-2001, Chris Sells All rights reserved. NO WARRANTIES EXTENDED. Use at your own risk.