Report Bug

Search BUGZ


Recently Closed

Browse Bugs


Inside AddedValues

Join Now

Bug Report 000018

Reported : 15:55; 16Sep2002 (changed 23:25; 15Oct2005)
Reported By : David Bayly
Status : Unknown ( Update)
Software Item : Frontier 9.5
Abstract : xm.compile deletes the variable passed in a parameter if it fails
What I did : Coded to catch an error from xm.compile <br><br>local (tbl)<br>try<br> xml.compile(str, @tbl)<br>else<br><br> do something with tbl
What I Expected : That local variable tbl would still exist after the xml.compile threw an error
What Happened : tbl vanishes as a declaration.
Impact : I can work around it
Supporting Notes : on getTagURL(inpStr, adrMatchTbl=nil) &amp;#123;<br> &Ccedil;getTagURl ; 01/04/15, 15:17:19 by DAB<br> &Ccedil;extract a url from a glossary entry <br> &Ccedil;an a tag has a href attribute<br> &Ccedil;an img tage has a src attribute<br> &Ccedil;01/05/14, 15:40:02 by DAB<br> &Ccedil;area tag as well as img and a<br> &Ccedil;02/09/09, 14:54:31 by DAB<br> &Ccedil;the xml.decompile version - Brents Simmons trick for speed<br> local (tbl, tagname, attname);<br> try &amp;#123;<br> try &amp;#123; &Ccedil;assume a properly closed tag<br> xml.compile(inpStr, @tbl)&#125;<br> else &amp;#123; &Ccedil;no, try a forcibly closed tag then<br> xml.compile(string.popTrailing(string.trimwhitespace(inpStr), &quot;&amp;gt;&quot;) + &quot;/&amp;gt;&quot;, @tbl)&#125;;<br> tagname = string.lower(string.nthField( nameof(tbl[1]), &quot;t&quot;, 2));<br> case tagname &amp;#123;<br> &quot;img&quot; &amp;#123;<br> attname = &quot;src&quot;&#125;&#125;<br> else &amp;#123;<br> attname=&quot;href&quot;&#125;;<br> url = tbl[1].[&quot;/atts&quot;].[attname];<br> if adrMatchTbl &amp;#8800; nil &amp;#123;<br> new(tabletype, adrMatchTbl);<br> adrMatchTbl^.matchString = url;<br> adrMatchTbl^.matchOffset = string.patternmatch(url, inpStr);<br> adrMatchTbl^.matchLength = string.length(url)&#125;;<br> return true&#125;<br> else &amp;#123;<br> scriptError(&quot;getTagURl:&quot; + tryError)&#125;&#125;;<br>bundle &amp;#123;<br> local (tag = &quot;&amp;lt;area shape='rect' coords='5, 255, 204, 330' href='<a href="http://www.dab.dot:8080/sandozFondation/en/technologien/revolution">http://www.dab.dot:8080/sandozFondation/en/technologien/revolution</a>'&amp;gt;&quot;);<br> getTagURl(tag, @temp.getTagURL)&#125;
Supporting Files :
Developer :

Last update: Saturday, October 15, 2005 at 11:25:26 PM. Send spam to gotcha@baylys.com