parserAutoStrings.pl - Force String to accept any string.

From WeBWorK

Jump to: navigation


NAME

parserAutoStrings.pl - Force String() to accept any string.

DESCRIPTION

This file allows you to force String() to accept ANY string as a legal value. (It will add the string to the context if it isn't already defined.)

To accomplish this, put the lines

        loadMacros("parserAutoStrings.pl");
        AutoStrings();

at the beginning of your problem file. (You can also pass AutoStrings a context pointer if you wish to alter context other than the current one.)

There is also a routine to help make strings easier to predefine. For example:

        loadMacros("parserAutoStrings.pl");
        DefineStrings("string1","string2");

would define two new strings (string1 and string2). You can pass a context reference as the first argument to add strings to that context rather than the active one.