MQL language

Overview

The MQL language interface consists of three functions, each of which differs from the others only in the kind of input it takes:

  • mqlExecuteFile takes a the name of a file
  • mqlExecuteStream takes a descendant of std::istream
  • mqlExecuteString takes a std::string

Arguments

The following are the other arguments, common to them all:

  • pEE is the execution environment.
  • bResult& is a boolean reference returning true on success and false on error.
  • bPrintResult is a boolean indicating whether the results should be dumped using the EMdFOutput object in the execution environment (true) or not (false). Set this to false if you plan to use the pStatement of the execution environment for getting the results.
  • bReportError is a boolean indicating whether any error message should be reported using the EMdFOutput object in the execution environment. This only has an effect if the output kind is kOKConsole, since any error message is always given in the XML output.

C++ interface


#include <mql_execute.h>

extern bool mqlExecuteFile(MQLExecEnv *pEE, 
                             std::string filename, 
                             bool& bResult, 
                             bool bPrintResult, 
                             bool bReportError);

extern bool mqlExecuteStream(MQLExecEnv *pEE, 
                               std::istream& strin, 
                               bool& bResult, 
                               bool bPrintResult, 
                               bool bReportError);

extern bool mqlExecuteString(MQLExecEnv *pEE, 
                               const std::string& input, 
                               bool& bResult, 
                               bool bPrintResult, 
                               bool bReportError);


Previous:MQL Error
Up:Part II: APIs
Next:Monads