Passing a sub to a function???

Discussion in 'AutoCAD' started by Mark Dubbelaar, May 13, 2004.

  1. hi

    i was wondering if it is possible to pass a sub routine into a function in a different project. I have some standard functions and subs, one of which opens a list of drawings and does something to them. i usually put this 'something' into another sub routine. ie...

    open drawing

    'run my sub

    close my drawing

    currently i'm adding a reference to these common subs and functions. what i was hoping to do was... in a new project, reference the 'open / close' sub from the common project and also pass a sub (which is in the new project) to the 'open / close' referenced project. ie.

    CommonProject
    ->Module1 (opens / closes)

    NewProject (with reference to CommonProject)
    ->Module1 (runs CommonProject.Module1.OpenClose passes NewProject.Module2.DisplayMsgbox to it)
    ->Module2 (displays msgbox)

    i'm thinking to only way to do it would be to add a reference in th CommonProject to the NewProject.

    any help would be great, i'm not to sure if i'm explaining myself right either.


    cheers

    mark
     
    Mark Dubbelaar, May 13, 2004
    #1
  2. Mark Dubbelaar

    bcoward Guest

    Mark,

    This seems like common functionality that you can encapsulate in a class....no??

    While referencing other projects is a viable solution it looks like, if I read you correctly, you want a msgbox class.

    Regards,

    Bob Coward
    CADS, Inc

    800-366-0946
     
    bcoward, May 13, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.