Пример #1
0
types::Function::ReturnValue sci_scicos_debug(types::typed_list &in, int _iRetCount, types::typed_list &out)
{
    if (in.size() > 1)
    {
        Scierror(999, _("%s: Wrong number of input arguments: %d or %d expected.\n"), funname.c_str(), 0, 1);
        return types::Function::Error;
    }

    if (_iRetCount != 1)
    {
        Scierror(999, _("%s: Wrong number of output arguments: %d expected.\n"), funname.c_str(), 1);
        return types::Function::Error;
    }

    if (in.empty())
    {
        types::Double* ret = new types::Double(C2F(cosdebug).cosd);
        out.push_back(ret);
    }
    else
    {
        if (!in[0]->isDouble())
        {
            Scierror(999, _("%s: Wrong type for input argument #%d : A real matrix expected.\n"), funname.data(), 1);
            return types::Function::Error;
        }
        types::Double* pIn = in[0]->getAs<types::Double>();

        if (!pIn->isScalar())
        {
            Scierror(999, _("%s: Wrong size for input argument #%d : A real scalar expected.\n"), funname.data(), 1);
            return types::Function::Error;
        }
        if (pIn->get(0) != floor(pIn->get(0)))
        {
            Scierror(999, _("%s: Wrong value for input argument #%d : An integer value expected.\n"), funname.data(), 1);
            return types::Function::Error;
        }

        C2F(cosdebug).cosd = pIn->get(0);
    }

    return types::Function::OK;
}
Пример #2
0
types::Function::ReturnValue sci_disp(types::typed_list &in, int _iRetCount, types::typed_list &out)
{
    types::typed_list::reverse_iterator it;

    if (in.empty())
    {
        Scierror(999, _("%s: Wrong number of input arguments: At least %d expected.\n"), "disp", 1);
        return types::Function::Error;
    }

    for (it = in.rbegin() ; it != in.rend() ; it++)
    {
        scilabForcedWriteW(L"\n");
        if (VariableToString(*it, SPACES_LIST) == types::Function::Error)
        {
            return types::Function::Error;
        }
    }

    return types::Function::OK;
}