- Force String to accept any string.

From WeBWorK

Jump to: navigation

NAME - Force String() to accept any string.


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


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:


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.