Hello Guest it is April 19, 2024, 10:15:31 PM

Author Topic: User Defined Function  (Read 2279 times)

0 Members and 1 Guest are viewing this topic.

Offline 10k

*
  •  13 13
    • View Profile
User Defined Function
« on: December 23, 2011, 09:51:58 AM »
Is there a way to create user defined functions that are available globally?

In the screen designer, I have defined several buttons that execute VB code.  The functions are similar, but not identical.  I have a VB function that's defined in a large section of code.  I'd prefer not to include the code that defines the function in each of the calling buttons.  If I do, I have to keep editing every instance when I make a change.  What I'd like to do is:

     Button 1-10 - just a few lines of code that call function using different parameters.

     Large chunk of code defining function - located somewhere else.

I need to pass parameters to the function, and receive return parameters from the function.  The function needs to complete execution before returning control to the calling VB code.

Is there a way to do this?  I've searched the forum and so far it appears that you can't do this.

Thanks.

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: User Defined Function
« Reply #1 on: December 23, 2011, 10:08:25 AM »
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html