Results 1 to 8 of 8
  1. #1
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    379
    Provided Answers: 2

    Unanswered: 'For Each Match By Regular Expression' difficulty

    I am attempting to use (for the very first time) the 'For each match by regular expression' loop so that I can experiment with an idea that came from suggestions from Ernie and Matty. I set up the script following the example provided in the User Guide and it did not work. I then set up another test using EXACTLY the same setup provided in the User Guide and it, too, did nothing. I stepped through each individual line of script in the script editor and nothing happened when it encountered these lines.

    I added a E-mail address field as referenced in the example. I added the script to the 'On edit:' portion on the field. When I edited this field it passed by the pertinent lines as if they did not even exist. I added a 'show comment' command just before and immediately after so that I can ensure that the script is being executed. The only bit that executed was the two 'show comment' statements.

    Has anyone here ever tried to use the 'For each match by regular expression' cycle? If so, were you able to make it work? It appears that the usage and required coding is straightforward; however, after repeated attempts, it simply does not function for me??? Please help.
    Daryl G

  2. #2
    Join Date
    Sep 2011
    Location
    Australia
    Posts
    264
    Provided Answers: 2
    Hi Daryl
    Can not help you with this action although I tried the example and all that happened was that the program crashes with with a runtime error. May be my syntax being incorrect, but a bit of a worry - even if you get it working I would test it for some time.
    Rgards
    David

  3. #3
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    379
    Provided Answers: 2
    David,
    I spent a few hours this morning further educating myself about 'Regular Expressions' as there is a plethora of material available on the Internet. I tried, tested, reattempted, ... and hoped only to reaffirm that, unfortunately, it does not work with Brilliant Database. There could be a nice addition since it provides so many possibilities.

    This is troubling as Brilliant Database indicates that VBScripts (this includes Regular Expressions) can be used but I have tried incorporating VBScripts on several occasions and never had ANY of it work.
    Daryl G

  4. #4
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    This smells like a bug at this point. I'd suggest that you report it (along with a demo database or steps to reproduce the problem) to Mikhail.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

  5. #5
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    379
    Provided Answers: 2
    Update. I continued experimenting with 'For each match by regular expression' and still was having no success. I then used the script 'RegExp Match' to see if that would work - my thinking was that both of these functions use 'Regular Expressions’ and if one worked, the other should also. My first test with 'RegExp Match' worked fine using a similar example. I then revisited the 'For each match by regular expression' and still was not able to make it work. Next, I googled 'Brilliant Database' and 'Regular Expression' and saw that Mikhail had included a downloadable example. I downloaded his example and it worked! I tried and tried and tried to replicate his simple example myself. I could not get it to work yesterday… I bounced back and forth from Mikhail’s working example and my non-functional model and simply could not identify the issue(s). This morning I revisited this problem and it worked – I have no explanation on what I did to make things work properly???

    I then attempted to include ‘For each match by regular expression’ into my actual project (I am looking for a series of alphanumeric characters separated by a space rather than Mikhail’s example of matching E-mail addresses). It worked perfectly in my project.

    A caveat to include: regular expressions appear to be very unforgiving if the ‘regular expression’ is not defined properly. During my experimentation, I saw that some attempts caused nothing to happen, while others froze up Brilliant Database, and some completely shut down Brilliant Database.

    Regular expressions do work in Brilliant Database and these are a very powerful tool set!
    Daryl G

  6. #6
    Join Date
    Sep 2011
    Location
    Australia
    Posts
    264
    Provided Answers: 2
    Hi Daryl
    I did what you have done by downloading the bbd file off BD site and yes it worked. Script looks the same as the one I manually created but it does not crash! Seems to rule a support file problem.
    Will print out both scripts tonight (AM here) and examine character by character, as I will not use this action unless I know what is the cause of problem.
    Regards
    David

  7. #7
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    379
    Provided Answers: 2
    David,
    If you match yours side-by-side against the file that did work, I would be very interested in finding out what was the difference. Yesterday, my script matched verbatim (i.e., exactly) and it would not work. Amazingly, this morning it did work... I am truly at a loss here. Please share your results if you find out what the difference was because I am totally confused.
    Daryl G

  8. #8
    Join Date
    Sep 2011
    Location
    Australia
    Posts
    264
    Provided Answers: 2
    Hi Daryl
    Compared scripts in notepad once exported to htlm. Could not see any real difference but not crashing at moment - just giving blank result in message box when it does not work. Currently all 3 files I am experimenting with are working.
    Just does not seem consistent.
    Regards
    David

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •