base:GetXMLString()

You can post your code snippets here for others to use and learn from
Post Reply
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

base:GetXMLString()

Post by djrikki »

This is the first of a handful of xml-based parsing routines.

Code: Select all

Global base
base = {}

;; base:GetXmlString(data,key)
; You should call this recursively in a While ... data = ReadLine(1)...Wend  structure; ex. call line$ = base:GetXmlString(data,"Album")
Function base:GetXmlString(data,key)
    Local result = ""

    If FindStr(data,"<key>") > -1
        If FindStr(data,key) > -1
            data = ReadLine(1)
            result = MidStr(data,FindStr(data,"<string>")+StrLen("<string>"),StrLen(data))
            result = UnleftStr(result,StrLen("</string>"))
        EndIf
    EndIf
    
    Return(result)
EndFunction
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
Post Reply