Commit 0b7537f8 authored by Miguel de Icaza's avatar Miguel de Icaza Committed by Arturo Espinosa
Browse files

Implement ISERROR.

1999-02-19  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* src/fn-misc.c (gnumeric_min): Implement ISERROR.
parent f29179e1
1999-02-19 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/fn-misc.c (gnumeric_min): Implement ISERROR.
* src/clipboard.c (paste_cell): Do not render the value if the
result is an error.
......
1999-02-19 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/fn-misc.c (gnumeric_min): Implement ISERROR.
* src/clipboard.c (paste_cell): Do not render the value if the
result is an error.
......
1999-02-19 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/fn-misc.c (gnumeric_min): Implement ISERROR.
* src/clipboard.c (paste_cell): Do not render the value if the
result is an error.
......
1999-02-19 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/fn-misc.c (gnumeric_min): Implement ISERROR.
* src/clipboard.c (paste_cell): Do not render the value if the
result is an error.
......
......@@ -24,6 +24,7 @@ static char *help_clean = {
"@SEEALSO=")
};
static Value *
gnumeric_clean (FunctionDefinition *fn, Value *argv [], char **error_string)
{
......@@ -52,7 +53,39 @@ gnumeric_clean (FunctionDefinition *fn, Value *argv [], char **error_string)
return res;
}
static char *help_iserror = {
N_("@FUNCTION=ISERROR\n"
"@SYNTAX=ISERROR(exp)\n"
"@DESCRIPTION="
"Returns a TRUE value if the expression has an error\n"
"\n"
"@SEEALSO=")
};
static Value *
gnumeric_iserror (void *tsheet, GList *expr_node_list, int eval_col, int eval_row, char **error_string)
{
Value *v, *retval;
if (g_list_length (expr_node_list) != 1){
*error_string = _("Argument mismatch");
return NULL;
}
v = eval_expr (tsheet, (ExprTree *) expr_node_list->data, eval_col, eval_row, error_string);
if (v == NULL)
retval = value_int (1);
else {
retval = value_int (0);
value_release (v);
}
return retval;
}
FunctionDefinition misc_functions [] = {
{ "clean", "s", "text", &help_clean, NULL, gnumeric_clean },
{ "clean", "s", "text", &help_clean, NULL, gnumeric_clean },
{ "iserror", "", "", &help_iserror, gnumeric_iserror, NULL },
{ NULL, NULL }
};
......@@ -24,6 +24,7 @@ static char *help_clean = {
"@SEEALSO=")
};
static Value *
gnumeric_clean (FunctionDefinition *fn, Value *argv [], char **error_string)
{
......@@ -52,7 +53,39 @@ gnumeric_clean (FunctionDefinition *fn, Value *argv [], char **error_string)
return res;
}
static char *help_iserror = {
N_("@FUNCTION=ISERROR\n"
"@SYNTAX=ISERROR(exp)\n"
"@DESCRIPTION="
"Returns a TRUE value if the expression has an error\n"
"\n"
"@SEEALSO=")
};
static Value *
gnumeric_iserror (void *tsheet, GList *expr_node_list, int eval_col, int eval_row, char **error_string)
{
Value *v, *retval;
if (g_list_length (expr_node_list) != 1){
*error_string = _("Argument mismatch");
return NULL;
}
v = eval_expr (tsheet, (ExprTree *) expr_node_list->data, eval_col, eval_row, error_string);
if (v == NULL)
retval = value_int (1);
else {
retval = value_int (0);
value_release (v);
}
return retval;
}
FunctionDefinition misc_functions [] = {
{ "clean", "s", "text", &help_clean, NULL, gnumeric_clean },
{ "clean", "s", "text", &help_clean, NULL, gnumeric_clean },
{ "iserror", "", "", &help_iserror, gnumeric_iserror, NULL },
{ NULL, NULL }
};
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment