Go Back   Forum Care Forums > Development Reference Area > Visual Basic

Reply
 
LinkBack Thread Tools Display Modes
Using a module
Old
  (#1)
Jason Charalambides
Guest
 
Posts: n/a
Default Using a module - 06-04-2007, 08:56 AM

This may sound very basic. I have built a very long procedure with way too
many Ifs etc. I wonder if it is possible to transfer at least some of the
contents to modules so in case an if condition is satisfied the procedure to
be followed will be in a module. As an example, let me say that I have an
If condition stating:

If Hypo_length>35 Then
Do a bunch of stuff
End if

Can I have all that "bunch of stuff" in a module that I name "Module9"?

If this is a possibility, what is the command for activating the "Module9"?

Thanks in advance for your help

J.Charalambides.


P.S. Please do not send replies directly to me cause I removed my actual
address due to too much spam that I receive lately. A response in the group
will be greatly appreciated.


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: Using a module
Old
  (#2)
Roy Riddex
Guest
 
Posts: n/a
Default Re: Using a module - 06-04-2007, 08:56 AM

> This may sound very basic. I have built a very long procedure with way
too
> many Ifs etc. I wonder if it is possible to transfer at least some of the
> contents to modules so in case an if condition is satisfied the procedure

to
> be followed will be in a module. As an example, let me say that I have an
> If condition stating:
>
> If Hypo_length>35 Then
> Do a bunch of stuff
> End if
>
> Can I have all that "bunch of stuff" in a module that I name "Module9"?
>
> If this is a possibility, what is the command for activating the

"Module9"?
>
> Thanks in advance for your help
>
> J.Charalambides.
>


Select Project, then Add Module.
you can then say something like
VariableName = Module1.OtherVariable
I ***ume you'll be p***ing parameters, this is done in the same way as
p***ing parameters to a normal procedure.


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Using a module
Old
  (#3)
Larry Serflaten
Guest
 
Posts: n/a
Default Re: Using a module - 06-04-2007, 08:56 AM

"Jason Charalambides" <EMAIL REMOVED> wrote
> This may sound very basic. I have built a very long procedure with way too
> many Ifs etc. I wonder if it is possible to transfer at least some of the
> contents to modules so in case an if condition is satisfied the procedure to
> be followed will be in a module. As an example, let me say that I have an
> If condition stating:
>
> If Hypo_length>35 Then
> Do a bunch of stuff
> End if
>
> Can I have all that "bunch of stuff" in a module that I name "Module9"?


Yes, but that would be overkill. That If/Then code is in a procedure, either
a Sub, Function, or an event. To break it up simply add a new procedure
(Sub or Function) in the same module you are currently using. That way you
keep all the code that works together, in the same module.

LFS




-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top