Hello,
I had the following code in App.Open and it led to a strange error,
which I eventually solved.
dim reNombre,reChaine as new regex
reNombre.SearchPattern="\d+"
reNombre.Options.DotMatchAll=true
Parser.regExNombre=reNombre // The new regex is attached to a module's
property
reChaine.SearchPattern=chr(34)+".+"+chr(34)
reChaine.Options.DotMatchAll=true
Parser.regExChaine=reChaine // Idem
When running my app, the first RegEx, that was supposed to find
numbers, never returned any match. The second one worked fine. When I
used the debugger to check variables, I found that regExNombre and
regExChaine, although both were clearly and distinctly instantiated,
had the same SearchPattern. In fact, regExNombre had regExChaine's
pattern.
I splitted the dim statement into...
dim reNombre as new regex
dim reChaine as new regex
... and it solved the problem.
If I understand correctly the Language reference's entries for DIM and
NEW, it is possible to dim two new instances in the same statement. And
indeed, my two RegEx were instantiated. But somehow, it confused the
compiler and one got the other's property. Is this a bug ? Or am I the
one being confused ? I'm using RB2007r1.
Octave
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>