Quintiq file version 2.0
#parent: #root
Method ExtractAttribute (
  NamedValue nv,
  output String type_o,
  output String value_o
) id:Method_LibOpt_FormSnapshotColumns_ExtractAttribute
{
  #keys: '[139164.4.760817179]'
  Body:
  [*
    value_o := '<?>';
    type_o := '<?>';
    if( not isnull( nv ) )
    {
      val := nv.GetValue();
      if( val.istype( BinaryValue ) )
      {
        type_o := 'BinaryValue';
        value_o := [String] nv.GetValueAsBinaryValue();
      }
      else if( val.istype( Boolean ) )
      {
        type_o := 'Boolean';
        value_o := [String] nv.GetValueAsBoolean();
      }
      else if( val.istype( Char ) )
      {
        type_o := 'Char';
        value_o := [String] nv.GetValueAsChar();
      }
      else if( val.istype( Date ) )
      {
        type_o := 'Date';
        value_o := [String] nv.GetValueAsDate();
      }
      else if( val.istype( DateTime ) )
      {
        type_o := 'DateTime';
        value_o := [String] nv.GetValueAsDateTime();
      }
      else if( val.istype( Duration ) )
      {
        type_o := 'Duration';
        value_o := [String] nv.GetValueAsDuration();
      }
      else if( val.istype( Key ) )
      {
        type_o := 'Key';
        value_o := [String] nv.GetValueAsKey();
      }
      else if( val.istype( Number ) )
      {
        type_o := 'Number';
        value_o := [String] nv.GetValueAsNumber();
      }
      else if( val.istype( Real ) )
      {
        type_o := 'Real';
        value_o := [String] nv.GetValueAsReal();
      }
      else if( val.istype( String ) )
      {
        type_o := 'String';
        value_o := [String] nv.GetValueAsString();
      }
    }
  *]
}
