Retrives a specifc SofuObject from this Map indentified by key.
Declaration Syntax
C# |
public SofuObject Object( string key )
Parameters
- key (String)
- Identifies the SofuObject to get
Return Value
The Object requested
Examples
CopyC#
Sofu.Sofu.Map file = SofuReader.LoadFile("file.sofu"); bool debug=false; try { SofuObject val = file.Object("Debug"); debug=true; if (val.isMap()) { Console.Out.WriteLine("Debug Info"); val.AsMap().Write(Console.Out); } if (val.isValue()) { Console.Out.WriteLine(val.AsValue().ToString()); } } catch (SofuNoElementException e){ debug=false; }
Exceptions
Exception | Condition |
---|---|
SofuNoElementException | Will throw SofuNoElementException when the Key is not in this Map |