Page 1 of 4 123 ... LastLast
Results 1 to 15 of 49
  1. #1
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    379
    Provided Answers: 2

    Unanswered: Script freezes during normal activation but not when debugging

    I am experiencing a really strange behavior. I have a script that is activated via a button. I have records for 36 individuals and can run this report for each person when I select their record and press the button. Most of the time, the script executes perfectly; however, there are occasions when the script runs and it freezes up Brilliant Database and this is AFTER the script is complete. It does this only for certain individuals and it always freezes for these same people. When I select an individual where it has been freezing up on and debug the script manually through each line of script and it does not freeze anything... it just does it when I activate it normally through clicking on the button.

    I have spent hours last night and today examining the records and everything is intact but I cannot find why Brilliant Database freezes during normal script execution and NOT when stepping through the script line by line. Has anyone else experienced this sort of odd behavior?
    Daryl G

  2. #2
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    379
    Provided Answers: 2
    More details... If I place a 'Show Message' command at the end of each loop it works right EVERY time even on those individuals that caused the program to freeze earlier. I am not understanding why the program is behaving so oddly. Currently, there are about 12 'For Each... Next' loops so having to acknowledge the message each time is not a realistic solution (nor is stepping through the script one line at a time) but that is the only way that Brilliant Database does not freeze up. This is a peculiar issue and I undoubtedly am not the first to encounter this (I hope!). Has this happened to any of you BD professionals?
    Daryl G

  3. #3
    Join Date
    Sep 2011
    Location
    Australia
    Posts
    264
    Provided Answers: 2
    Hi Daryl
    Can't actually help but if no one has an answer you could post a copy of your file with script if contents not too sensitive. An email attachment to selected members can be an alternative if no progress.
    Sounds like a timing issue (bug?) but only guessing - wondering if a delaying action that really does nothing might help (something like refresh field or select same current folder as experiment).
    Regards
    David

  4. #4
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    It's almost like the pause your giving it time to catch up, which it shouldn't need.

    This is technically a totally pointless idea but have you tried to give brilliant database something else to do that doesn't require you to click a show message button before it goes to the next each.

    For example, get it populate a variable with a value of 1 for no reason whatsoever, and write a little “IF” loop that makes it check the variable.

    Variable = 1
    If the variable = 1, then variable = variable + 1.
    “Go to” - Loop back to the line above,
    Else if Variable = 10
    Go to your next Each Loop.

    Basically your getting brilliant database to count to 10 silently for no reason at all before it moves onto your next each loop.

    Technically a waste of time, but there's something funky going on here that doesn’t sound normal, so.... it might be worth a try.

    Regards
    James

  5. #5
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    379
    Provided Answers: 2
    James and David,
    I tried delaying the timing using James' suggestion yet it still freezes (see attached screenshot). During normal execution the folders turn gray for a couple seconds; however, when it freezes the folders remain gray and there is no control over the program - see blue arrow on screenshot. At that point I have to do a Ctrl+Alt+Delete to close Brilliant Database.

    Another odd this is that elsewhere in the program I have the exact same function but it looks at everyone (36 doctors) and it ALWAYS works flawlessly... and the script is identical - exactly identical. The only different is that the Recordset variable has only one name on the screen that freezes whereas the Recordset variable for the other function can have the full 36 doctors. That variable is global and is defined outside the script. I am truly at a loss as to what is making it freeze... it always freezes on the same people but not every time it is run on those individuals.
    Attached Thumbnails Attached Thumbnails freeze BD.jpg  
    Daryl G

  6. #6
    Join Date
    Jun 2012
    Posts
    163
    Provided Answers: 1

    my 2 cents

    i had buggie behaibor in old versions of brilliant.

    1. check if you can update to the news brilliant version

    2. try to delete the record had gives you problems, run your script to see if without the record it stills frezes, if it does not frezes then try to enter again manually the information of the deleted record.

    3. check if in some point of your script you are using the function "Close window" (i got some issues with this function in older versions, when i stoped using the window stuff the scripts worked)

    4. check if you are using the "change folder" function, try not to use it, or on the other hand, include it inside your loop, when you see that the loop fails, use the change folder function (go to a folder and then get back to your working folder)

    best regards

    fer

    (i have had this sort of behaivor in brilliant and it is a pain in the "#$ i tottaly understand your situation)

  7. #7
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    379
    Provided Answers: 2
    In trying to pinpoint exactly what is happening, I wrote a query to pull up all the records of one of the doctors where the program seizes. Next, I added a step to the query to change the doctor's name from the original (whose name caused the program to freeze) to another doctor's name as to see if the data itself caused the freezing. After doing this, I re-ran the script and it worked without an issue so this should confirm that the issue does not lie within the data.

    fer,
    I have deleted the data and re-entered it and it still freezes. I have not used the 'Close window' nor the 'change folder' commands. I have deleted the 'problem' doctors out and added their data back and it still freezes up Brilliant Database. I will try updating to V10.54 to see if that helps (as I do not know what else to check...).

    The script actually completes running and provides the exact answers - yet it freezes then and locks up Brilliant Database. I am dumbfounded!!!

    Update: On a whim, I tried to test out another avenue. I pulled up my same query that I mentioned and changed the name back to the original doctor (this is the one that caused the freezing) and it ran perfectly. Something is definitely unstable though I cannot figure out where or what is causing the freezing issue.
    Last edited by fireant911; 06-25-14 at 16:16. Reason: added update with testing results
    Daryl G

  8. #8
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    Hi Daryl.
    If it helps any, I'd be happy to take a look at your file. Just send it on over with instructions on what to click on to cause the problem.

    Regards
    James

  9. #9
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    379
    Provided Answers: 2
    James,
    It has been sent. I am about ready to pull my hair out over this!
    Thanks,
    Daryl G

  10. #10
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    Hi Daryl
    The code for your button “Calculate Objectives Completed” seems to have some issues.

    Take line 16 for example. Your pushing a list of all the “Completed Activities” for the selected person into a variable called $completed_activities. This is never going to work as a variable has a limited amount of memory.

    Viewed alphabetically the first person in your “Completed Activities” folder already has 1063 records that are all trying to be loaded into a single variable. Some people currently have much less records which is why your script is working for some, random for others and not at all for some people.

    If you need to find records using a query and work with that list of records found, there is no need at all to use a “For each record” loop. A query has the ability all on it's own to process every record it finds without the need for any variables and is therefore able to work with an unlimited amount of records.

    If you take a look at the query editor, on the Actions tab you will see a option to “execute as script for each record”. You need to work that function into your database instead of populating a variable with a query to ensure your database will work with an unlimited amount of records.

    Regards
    James

  11. #11
    Join Date
    Sep 2011
    Location
    Australia
    Posts
    264
    Provided Answers: 2
    Hello again
    James may be on to something here with variables. A few weeks back I was experimenting and found when the items in a variable went past the 1000 or so mark the data seemed to be truncated.
    Regards
    David

  12. #12
    Join Date
    Apr 2013
    Posts
    226
    Hi David,

    Could you clarify what you mean by "items in a variable"? Does this limitation apply to recordset variables - they can only hold a maximum of 1000 records?

    Matty

  13. #13
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    379
    Provided Answers: 2
    matty1965,
    I have no knowledge about the exact details about how many records the Recordset variable can or should hold but I do have a little experience. In my problem, some Recordset variables had well over 4,000 records and these work perfectly. The issue I was seeing was that problems arose when the person was selected that had the fewer records (the usage of 'fewer' is somewhat subjective as the least records I had was 1,016 and the most was 4,426). Those with less than 1,500 typically failed whereas the ones in excess of 2,500 seemed to always work. The process did not exactly 'fail'... it produced the correct answers but froze up Brilliant Database AFTER the solution was presented. I spent hours manually tabulating the results for both the smaller and larger volumes of records so I know that the results were right.

    I will follow James' recommendation and reduce that volume of records that the Recordset is holding because that is just good advice (when James speaks, people listen!!! - I know that I do) and good programming practice. It is the absence of such information that creates these (potential) problems.

    James, you have a PM.
    Daryl G

  14. #14
    Join Date
    Jun 2012
    Posts
    163
    Provided Answers: 1
    woooooooooooow, i just have learned a lot with this post...

    as i had sayed... a lot of times brilliant just crashesss i have never realized that is could be due for this practice... i will check this for my development...

    guys... i am getting addict to this forum...

    i insist... we should organice ourselves better...

    does anyone knows the owner or administrator of "dBforums"???

    best regards

    fer

  15. #15
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    379
    Provided Answers: 2
    fer,
    Your comment was spot on. There is really no source of information regarding such practices with Brilliant Database... except for this forum. I have never seen any reference to any of this in the User's Manual. I usually start out with some fake data, write some scripting and test it out, and, if it appears to work, I move on. Because data was not available when I started my project, I just made up records and it all worked great in this 'imaginary environment'. It was when I received the real data (just last week) did I discover that something was amiss. I, too, have learned a HUGE lesson with this... I must go now as I have a lot of scripting to redo!

    Pat Phelan is one of the administrators here on dBforums and although he says that he is not savvy with Brilliant Database, he is quite active here.
    Daryl G

Posting Permissions

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