Example #1
0
        /// <summary>
        ///   set the value of this argument to a given field
        /// </summary>
        /// <param name = "destFld">the destination field
        /// </param>
        internal void setValueToField(Field destFld)
        {
            String val;
            bool   isNull;

            switch (_type)
            {
            case ConstInterface.ARG_TYPE_FIELD:
                val    = _fld.getValue(true);
                val    = convertArgs(val, _fld.getType(), destFld.getType());
                isNull = _fld.isNull() || val == null;
                break;

            case ConstInterface.ARG_TYPE_EXP:
                val    = _exp.evaluate(destFld.getType(), destFld.getSize());
                isNull = (val == null);
                if (isNull)
                {
                    val = getEmptyValue((destFld.getType() == StorageAttribute.BLOB ||
                                         destFld.getType() == StorageAttribute.BLOB_VECTOR));
                }
                break;

            case ConstInterface.ARG_TYPE_VALUE:
                val    = convertArgs(_val, _valueAttr, destFld.getType());
                isNull = _valueIsNull || val == null;
                break;

            default:
                return;
            }

            // Update destination field's _isNULL with the value from record. This is needed to identify
            // if the variable is modified.
            destFld.takeValFromRec();

            destFld.setValueAndStartRecompute(val, isNull, ((Task)destFld.getTask()).DataViewWasRetrieved, false, true);
        }
Example #2
0
 /// <summary>
 ///   This method fills the argument data from the mainProgVar strings
 /// </summary>
 /// <param name = "mainProgVar">- a vector of strings of main program variables</param>
 /// <param name = "mainProgTask">- the main program task</param>
 internal void fillDataByMainProgVars(String mainProgVar, Task mainProgTask)
 {
     if (mainProgVar.Equals("Skip"))
     {
         _skip = true;
     }
     else
     {
         int fldId = Int32.Parse(mainProgVar) - 1;
         _type        = ConstInterface.ARG_TYPE_VALUE;
         _fld         = (Field)mainProgTask.getField(fldId);
         _val         = _fld.getValue(true);
         _valueIsNull = _fld.isNull();
         _valueAttr   = _fld.getType();
     }
 }