File: f_gettag.srf
Size: 683
Date: Tue, 22 Jan 2008 23:39:15 +0100
$PBExportHeader$f_gettag.srf
global type f_gettag from function_object
end type

forward prototypes
global function string f_gettag (readonly string as_source, readonly string as_tag)
end prototypes

global function string f_gettag (readonly string as_source, readonly string as_tag);string ls_tagval, ls_tagname
long ll_posi,ll_posi2

ls_tagname = "<"+as_tag+">"
ll_posi = pos(as_source,ls_tagname) 

if ll_posi <=0 then return ""
ll_posi += len(ls_tagname)

ls_tagname = "</"+as_tag+">"
ll_posi2 = pos(as_source,ls_tagname, ll_posi)

if ll_posi2 <=0 then return ""

ls_tagval = mid(as_source,ll_posi,(ll_posi2 - ll_posi))

return ls_tagval
end function