public void ConsultString(string text)
{
using (var sr = new StringReader(text))
{
string savedFileName = Prolog.CurrentSourceFile;
int savedLineNumber = Prolog.CurrentSourceLineNumber;
try
{
Prolog.CurrentSourceFile = null;
Prolog.CurrentSourceLineNumber = 0;
Consult(sr);
}
finally
{
Prolog.CurrentSourceFile = savedFileName;
Prolog.CurrentSourceLineNumber = savedLineNumber;
}
}
}