Library of Code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • daniel aristidou
    Contributor
    • Aug 2007
    • 494

    Library of Code

    Hi guys this will probably seem like a very stupid......... ....question but i would like to store certain tasks for use in many programs e.g if printing is carried out using the same step more or less. I heard something about modules......Ca n anyone explain what a module is exactly and how i can use this to make a library of common scripts.
    Thanks Daniel(~_~)
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    I believe the answer to this will be heavily dependent on what version of VB you're using.

    Comment

    • daniel aristidou
      Contributor
      • Aug 2007
      • 494

      #3
      Hey killer42 im using vb08....

      Comment

      • daniel aristidou
        Contributor
        • Aug 2007
        • 494

        #4
        Originally posted by daniel aristidou
        Hey killer42 im using vb08....
        Does anyone out there deal with vbo8>>>>:((

        Comment

        • daniel aristidou
          Contributor
          • Aug 2007
          • 494

          #5
          Hello hello hello is there anybody outhere? :-{

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            It does seem to have fallen silent around here, huh.

            Unfortunately I can't help with this one, for a number of reasons including...
            • I work with VB6, and the way they handle this kind of thing is quite different
            • I'm very disorganised - have always intended to set up some code library/libraries along these lines, but haven't actually done it.

            Comment

            • daniel aristidou
              Contributor
              • Aug 2007
              • 494

              #7
              OK....Can anyone help me do this in vb6 or 2k5....???????

              Comment

              • Killer42
                Recognized Expert Expert
                • Oct 2006
                • 8429

                #8
                Originally posted by daniel aristidou
                OK....Can anyone help me do this in vb6 or 2k5....???????
                In VB6, I suppose you can just create a module in which you put all your Public Subs and Functions, then add that module to each project you create.

                That's the simple method. Beyond that... well, like I said, I'm not that organised. I hope someone else has some ideas.

                Comment

                • daniel aristidou
                  Contributor
                  • Aug 2007
                  • 494

                  #9
                  Originally posted by Killer42
                  In VB6, I suppose you can just create a module in which you put all your Public Subs and Functions, then add that module to each project you create.
                  So this basicly.... i need to standarize the name i give my controls....the n a module will work in any of my projects.....al so
                  I don't need to call the module? The code under a sub will automatically run if the event occurs eg...a sub in the module for a control on click will automatically be run when i click on the comtrol in a form?

                  Comment

                  • Killer42
                    Recognized Expert Expert
                    • Oct 2006
                    • 8429

                    #10
                    Originally posted by daniel aristidou
                    So this basicly.... i need to standarize the name i give my controls....the n a module will work in any of my projects.....al so
                    I don't need to call the module? The code under a sub will automatically run if the event occurs eg...a sub in the module for a control on click will automatically be run when i click on the comtrol in a form?
                    No. Unless later versions of VB have made some pretty radical changes, the code for an event procedure would have to reside within the form.

                    However, you could simply place a line of code there to pass control to your standard routine. I don't think standardising the names of your controls will help. But don't forget, you can pass the control to the common routine as a parameter.

                    Comment

                    Working...