Spark! Fuzzy Logic Editor Help


Variables | Sets | Rules | API | Integration | Tutorial


get_msg_textA()

Returns the current message text of the Spark! model object.  This can be a warning or an error.

  const char* get_msg_textA()  

Parameters

none

Return Value

Returns a pointer to a string containing the error/warning message - or possibly no message if nothing went wrong.  In that case the string will be NULL.

Note that get_msg_textA() returns a const pointer - this means you do not have to worry about memory management of the message.  Of course C++ allows you to cast away the "constness" but you do that at your own risk!

FAQ

Q: What is that 'A' at the end of this function?
A: The 'A' stands for ASCII.  This version returns an ASCII character string.  In the future there will be a Wide character version and you can call the appropriate one for the type of character strings you're using.

 

Example


#include <iostream.h>
#include "SparkModel.h"

int main(int argc, char* argv[])
{
    int          return_val;   // return value from funcs
    SparkModel   model;        // model to load

    // load the SparkDemo model in debug mode
    return_val = model.load("DoesNotExist.spk", true); 

    if (return_val)
        {
        const char* err = model.get_msg_textA();
        cout << "Error calling Load(): " << err << endl;
        }

  return 0;

  } // end main()