@@ -207,10 +207,8 @@ public Function_REGEX(FunctionBase func1, FunctionBase func2) : base(func1, func
207207
208208 public override Operand Evaluate ( AlgorithmEngine work , Func < string , Operand > tempParameter )
209209 {
210- var args1 = func1 . Evaluate ( work , tempParameter ) . ToText ( "Function '{0}' parameter {1} is error!" , "Regex" , 1 ) ;
211- if ( args1 . IsError ) { return args1 ; }
212- var args2 = func2 . Evaluate ( work , tempParameter ) . ToText ( "Function '{0}' parameter {1} is error!" , "Regex" , 2 ) ;
213- if ( args2 . IsError ) { return args2 ; }
210+ var args1 = func1 . Evaluate ( work , tempParameter ) ; if ( args1 . IsNotText ) { args1 = args1 . ToText ( "Function '{0}' parameter {1} is error!" , "Regex" , 1 ) ; if ( args1 . IsError ) { return args1 ; } }
211+ var args2 = func2 . Evaluate ( work , tempParameter ) ; if ( args2 . IsNotText ) { args2 = args2 . ToText ( "Function '{0}' parameter {1} is error!" , "Regex" , 2 ) ; if ( args2 . IsError ) { return args2 ; } }
214212
215213 var b = Regex . Match ( args1 . TextValue , args2 . TextValue ) ;
216214 if ( b . Success == false ) {
@@ -869,7 +867,8 @@ public Function_HAS(FunctionBase func1, FunctionBase func2) : base(func1, func2)
869867 public override Operand Evaluate ( AlgorithmEngine work , Func < string , Operand > tempParameter )
870868 {
871869 var args1 = func1 . Evaluate ( work , tempParameter ) ; if ( args1 . IsError ) { return args1 ; }
872- var args2 = func2 . Evaluate ( work , tempParameter ) . ToText ( "Function '{0}' parameter {1} is error!" , "Has" , 2 ) ; if ( args2 . IsError ) { return args2 ; }
870+ var args2 = func2 . Evaluate ( work , tempParameter ) ;
871+ if ( args2 . IsNotText ) { args2 = args2 . ToText ( "Function '{0}' parameter {1} is error!" , "Has" , 2 ) ; if ( args2 . IsError ) { return args2 ; } }
873872
874873 if ( args1 . IsArrayJson ) {
875874 return Operand . Create ( ( ( OperandKeyValueList ) args1 ) . ContainsKey ( args2 ) ) ;
@@ -921,7 +920,7 @@ public Function_HASVALUE(FunctionBase func1, FunctionBase func2) : base(func1, f
921920 public override Operand Evaluate ( AlgorithmEngine work , Func < string , Operand > tempParameter )
922921 {
923922 var args1 = func1 . Evaluate ( work , tempParameter ) ; if ( args1 . IsError ) { return args1 ; }
924- var args2 = func2 . Evaluate ( work , tempParameter ) . ToText ( "Function '{0}' parameter {1} is error!" , "HasValue" , 2 ) ; if ( args2 . IsError ) { return args2 ; }
923+ var args2 = func2 . Evaluate ( work , tempParameter ) ; if ( args2 . IsNotText ) { args2 = args2 . ToText ( "Function '{0}' parameter {1} is error!" , "HasValue" , 2 ) ; if ( args2 . IsError ) { return args2 ; } }
925924
926925 if ( args1 . IsArrayJson ) {
927926 return Operand . Create ( ( ( OperandKeyValueList ) args1 ) . ContainsValue ( args2 ) ) ;
0 commit comments