Retrives a specifc Sofu.List from this Map indentified by key.
Parameters
- key (String)
- Identifies the List to get
Return Value
The List at key
Examples
CopyC#
Sofu.Sofu.Map file = SofuReader.LoadFile("file.sofu"); try { Sofu.Sofu.List parameters = file.list("Parameter"); foreach (SofuObject para in parameters) { Console.Out.Write("Parameter: "); try { Console.Out.WriteLine(para.AsValue().ToString()); } catch (SofuNotValueException e) { Console.Out.WriteLine("Parameter synatx wrong, expected Sofu Value"); } } } catch (SofuNoElementException e) { Console.WriteLine("No parameters defined"); } catch (SofuNotListException e) { Console.Out.WriteLine("Parameters synatx wrong, expected Sofu List"); }
Exceptions
Exception | Condition |
---|---|
SofuNoElementException | Will throw SofuNoElementException when the Key is not in this Map |
SofuNotListException | Throws a SofuNotListException if the requested element is not a List |