2016-03-10 02:39:23 +00:00
|
|
|
package com.bytezone.diskbrowser.visicalc;
|
|
|
|
|
2016-03-12 22:38:03 +00:00
|
|
|
class IsError extends Function
|
2016-03-10 02:39:23 +00:00
|
|
|
{
|
2017-03-18 08:33:40 +00:00
|
|
|
public IsError (Cell cell, String text)
|
2016-03-10 02:39:23 +00:00
|
|
|
{
|
2017-03-18 08:33:40 +00:00
|
|
|
super (cell, text);
|
2017-03-03 23:41:08 +00:00
|
|
|
|
2017-03-18 09:21:11 +00:00
|
|
|
assert text.startsWith ("@ISERROR(") : text;
|
|
|
|
|
2017-03-19 01:03:57 +00:00
|
|
|
source = cell.getExpressionValue (functionText);
|
2017-03-18 21:23:44 +00:00
|
|
|
values.add (source);
|
2016-03-10 02:39:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-02-28 20:39:26 +00:00
|
|
|
public void calculate ()
|
2016-03-10 02:39:23 +00:00
|
|
|
{
|
2017-03-18 21:23:44 +00:00
|
|
|
source.calculate ();
|
|
|
|
|
|
|
|
value = source.isValueType (ValueType.ERROR) ? 1 : 0;
|
2016-03-19 05:31:30 +00:00
|
|
|
valueType = ValueType.VALUE;
|
2016-03-10 02:39:23 +00:00
|
|
|
}
|
|
|
|
}
|