ReadDictionary
Function ReadDictionary(FilePathOrURL As String) As Dictionary
ReadDictionary(...) is an easy way to read in a previously stored dictionary from a file (XML files storing object values of dictionaries in a human-readable format). You may even read html webpages with this function.
But it works only for XML files in plist format (at least for me). What doesn't work is reading HTML pages as stated by the Reference. I have looked at the NSDicitionary reference which states one has to stay with the plist format and doesn't show support for HTML format.
- Code: Select all
Dim myDic As Dicitionary
' although a URL can be given to initialize the values
' the referenced XML file needs to be in the format specified
' by Apple as property lists (plist)
' opening any other format results in a stack dump within
' ObjectiveBasic
' init dicitionary with keys and values of Info.plist
' local file in the user's home directory
' myDic = ReadDicitionary("file:///Users/HU/Desktop/hund/Contents/Info.plist")
' remote file on a web server
myDic = ReadDicitionary("http://home.htp-tel.de/ukillermann/Info.plist")
' this fails
' myDic = plist("http://home.htp-tel.de/ukillermann/index.html")
Can someone shed a light on this?
Thanks
Udo