Exemple #1
0
        public ElaValue AsString(ElaValue val)
        {
            if (val.TypeId > SysConst.MAX_TYP)
            {
                var tid = val.TypeId;
                var sb  = new StringBuilder();
                var usb = val.Ref as ElaUserType2;
                var xs  = new List <String>();

                while (usb != null)
                {
                    xs.Add(usb.Value2.DirectGetString());
                    var td = usb.Value1.Ref;

                    if (td.TypeId == tid)
                    {
                        usb = td as ElaUserType2;
                    }
                    else
                    {
                        usb = null;
                        xs.Add(td.ToString());
                    }
                }

                for (var i = xs.Count - 1; i > -1; i--)
                {
                    sb.Append(xs[i]);
                }

                return(new ElaValue(sb.ToString()));
            }

            return(new ElaValue(val.AsString()));
        }
Exemple #2
0
 public ElaUnit WriteLine(ElaValue val)
 {
     Console.WriteLine(val.AsString());
     return(ElaUnit.Instance);
 }
Exemple #3
0
 public ElaUnit WriteLine(ElaValue val)
 {
     Console.WriteLine(val.AsString());
     return ElaUnit.Instance;
 }