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

    Unanswered: Any Success With Using VB Script?

    Has anyone here attempted to use any VB script inside of Brilliant Database and had it to work successfully? I am still trying to use an 'Exit For' command to break out of a 'For Each.... Next' loop and Brilliant Database does not like this (see attached screen shot) - this is a valid and very common command! I really need to exit the inner 'For Each' loop when a match is found rather than continue to loop wastefully. I have tried using several Visual Basic commands (legal commands!) and never experienced any successes with any of my attempts. Does anyone have any success stories with Brilliant Database and Visual Basic?
    Attached Thumbnails Attached Thumbnails vbscript jpg.jpg  
    Daryl G

  2. #2
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    379
    Provided Answers: 2
    I spent several hours over the past few days trying all sorts of combinations - both valid VBScripts and very creative derivations of VBScripts only to finally accept the fact that attempting to use VBScripts within a 'For Each... Next' loop is not possible in Brilliant Database.

    My issue was that I had three nested 'For Each... Next' statements and once the inner most loop found a match, it continued to very wastefully continue to execute because it is not possible to exit an inner loop and continue executing the next loop within Brilliant Database. Frustrated by this failure, I then attempted an approach that my friend James Tubbritt suggested to me after I was having a totally different problem. I very creatively incorporated a query that not only circumvented the issue with superfluous iterations after a match was found, it also eliminated all the earlier comparison checks - this discovery greatly sped up the operation of my project!

    The innermost 'For Each... Next' statement loops one time now rather than 256 (the number of records currently in that folder). Since the two outer 'For Each... Next' contains much other data, the total computations/data checks was reduced from hundreds of thousands to simply hundreds. In the end, this solution proves to be superior to the original answer I was seeking (and not finding) so I am proclaiming this to be serendipitous event!!!
    Daryl G

  3. #3
    Join Date
    Jun 2012
    Posts
    163
    Provided Answers: 1
    [QUOTE=fireant911;6612548]I spent several hours over the past few days trying all sorts of combinations - both valid VBScripts and very creative derivations of VBScripts only to finally accept the fact that attempting to use VBScripts within a 'For Each... Next' loop is not possible in Brilliant Database.

    something most be wrong with brilliant, i have the same issue, everytime i try to use a vbscript rutine i have errors..

    what has worked to me, is

    - inside brilliant, create an external vbs file, with the information i need, and then, "run" the external file...

    (it is kind of sad) but works

    fer

  4. #4
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    379
    Provided Answers: 2
    ferslash,
    That is certainly an interesting approach. I have come to the conclusion that VBScripts do NOT work in Brilliant Database (this is referring to the use of the action 'Execute VBScript'). I have used that scripting for greater than 10 years and I am certainly more knowledgeable with VB that I am with Brilliant Database... and I can say that it simply does not function in Brilliant Database.

    I may try your approach as I still have an issue with not being able to exit a 'For... Next' loop early - this would greatly speed up the execution of my project.
    Daryl G

  5. #5
    Join Date
    Sep 2011
    Location
    Australia
    Posts
    264
    Provided Answers: 2
    Hi all
    Have not used VBS but always interested in having a alternative tool in BD.
    After reading above posts I downloaded the VBS example from BD web site and untouched it appears to work ok on my computer. It does include a nested loop to generate a list of numbers. Just as experiment I modified it to use a couple of BD fields instead of fixed numbers in loop calculation which again seemed to work fine - untill I entered larger numers in fields. BD started to show a warning about the long time to process script and the result calculation terminated at 631 (like only a limited space allocated) -no actual error but self limited! Again I would warn potential users to test extensively even if it appears to work.
    Just as matter of interest does any one want to put a sample BD/VBS file of what they are trying to do with VBS and allow others to experiment with it - may be dead end but nothing to lose.
    Regards
    David

  6. #6
    Join Date
    Jul 2012
    Location
    Ireland
    Posts
    815
    Provided Answers: 17
    Just as matter of interest does any one want to put a sample BD/VBS file of what they are trying to do with VBS and allow others to experiment with it - may be dead end but nothing to lose.
    I'd love to see some working examples as this is one function of brilliant database I don't use. I'm not even sure I understand what advantages can be even got from using it.

    Same goes for the option that brilliant database has for sending and receiving information from other applications. Never managed to get that working either and that's something I know would be super useful.

    Regards
    James.

  7. #7
    Join Date
    Sep 2011
    Location
    Australia
    Posts
    264
    Provided Answers: 2
    Hi James
    My potential interest was the extra functions in VBS like ASC and CHR for working with bar codes (code 39 works ok directly but 128 versions need a calculated checksum --need above functions to process data).
    One day will get back to that project and experiment.
    Regards
    David

  8. #8
    Join Date
    Dec 2012
    Location
    Huntsville, AL
    Posts
    379
    Provided Answers: 2
    Brilliant Database scripts versus VBScripts is an interesting topic. Because of the way that Brilliant Database is set up, scripting in BD can be much more efficient that in Visual Basic... at least for certain things. I was amazed at how few lines of scripting was required for Brilliant Database to replicate the same objective in Visual Basic (there was several hundred less required in BD). I have not discovered any circumstance where VBScripts (via 'Execute VBScripts) will actually work in Brilliant Database and, trust me, I have tried repeatedly with no success.

    It would certainly be great if VBScripts was supported and functional because this could help take care of some of the shortcomings of Brilliant Database. I know now that I sound like a broken record but I would absolutely love to be able to exit out of a 'For Each... Next' loop early but Brilliant Database does not allow this (in Visual Basic all that is required is an 'Exit For' command).
    Daryl G

  9. #9
    Join Date
    Jun 2012
    Posts
    163
    Provided Answers: 1
    i got a similar problem using javascript inside an html in brilliant.

    i have not a back ground in html or javascript, but some times i have needed something, so i google it, copy the code and paste it in an empty html document and it works...

    but when i do it inside an html in brilliant i just dont work...

    some months ago i got communication with mikhail about this matter and he told me that the html was taked care by iexplorer and also he send me a working example of javascript working inside brilliant... that was the only java i got working in brilliant.

    but again... i have not a background in html so i dont know what could be wrong.

    i just guess that if we could use nice html inside brilliant... we could get amazing interfaces

  10. #10
    Join Date
    Jun 2012
    Posts
    163
    Provided Answers: 1
    by the way... i am having an issue right now, i want to use a dll, and when i try to call a procedure inside the dll brilliant crashes... does any one know something about it???

    best regards from mexico

    fer

  11. #11
    Join Date
    Jun 2012
    Posts
    163
    Provided Answers: 1
    Quote Originally Posted by fireant911 View Post
    ferslash,
    That is certainly an interesting approach. I have come to the conclusion that VBScripts do NOT work in Brilliant Database (this is referring to the use of the action 'Execute VBScript'). I have used that scripting for greater than 10 years and I am certainly more knowledgeable with VB that I am with Brilliant Database... and I can say that it simply does not function in Brilliant Database.

    I may try your approach as I still have an issue with not being able to exit a 'For... Next' loop early - this would greatly speed up the execution of my project.
    *** i got a new idea about this matter. to make some vbs code work we could..:

    1. inside brilliant create a file with the vbs code you need (taking the values from brilliant that you need)
    2. some how (i dont know how) make the vbs code to write a new file with the result of the code
    3. from brilliant "read" the files writen by the vbs code..

    the only gap that i dont know how to overcome is "how to make vbs to write into a file"

    best regards.

    (by the way... i am loving this forum)

Posting Permissions

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