base:GetXmlDate()

You can post your code snippets here for others to use and learn from

base:GetXmlDate()

Postby djrikki » Wed Apr 15, 2015 11:36 pm

Here is another XML parse function with a different set of pairs, in the instance <date>:

Code: Select all
Global base
base = {}

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

    If FindStr(data,"<key>") > -1
        If FindStr(data,key) > -1
            data = ReadLine(1)
            result = MidStr(data,FindStr(data,"<date>")+StrLen("<date>"),StrLen(data))
            result = UnleftStr(result,StrLen("</date>"))
        EndIf
    EndIf
   
    Return(result)
EndFunction
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
djrikki
 
Posts: 645
Joined: Wed Apr 06, 2011 12:26 am

Return to Code snippets area

Who is online

Users browsing this forum: No registered users and 1 guest

cron