Active X code reuse

  • Hi guys

    I am sure you can do this and I am missing something obvious....

    I am writing a series of transforms on various text files that I want to copy import then delete.  This all works fine. 

    My issue is that I for each activeX script I am having to write essentially the same code, whereas if I could write a function accessible to all my activex scripts I could save myself a lot of hassle.

    Can this be done, if so how?

    cheers

  • yes, it can be done.. but it is not as straight forward as you would guess it to be.  The basics are that you load a global text file into a non-active Active-x tack script... call it CodeLib...

    put a script in your declaration area of each of your active-x scripts that will load the contents of CodeLib's Task Script into a variable, Then perform the vb Execute method on the variable...

    This is all done above the Main Function (declaration area), so the contents are available to the Main Function and any other function/subroutines you have in the script...

    Everything in the CodeLib must have a unique name (and no Main Function).. or it will bomb.

    If you need further explaination on this.. i wrote a whitepaper on this abuot a year ago... send me an email; mgercevich_nospam@gmail.com (remove "_nospam" from address) and i'd be happy to send the document to you.

    -Mike

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply