Go Back   TechArena Community > Software > Windows Software
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



What are the Sub Procedures in VB 6.0?

Windows Software


Reply
 
Thread Tools Search this Thread
  #1  
Old 25-12-2010
Member
 
Join Date: Mar 2010
Posts: 515
What are the Sub Procedures in VB 6.0?
  

Hello guys, I wanted to the term Sub Procedures in VB 6.0 which is been very complicated to me. I tried to understand but every time I try I end up knowing nothing. I have a test next week so, I am trying to get this concept but every time I try I end up with a new problem. I don’t know what to do? If Anyone who knows the solution to this query then please let me know as I am very keen to know the concept of sub procedures in VB 6.0. Anyone having any knowledge about this query, then please let me know.

Reply With Quote
  #2  
Old 25-12-2010
Member
 
Join Date: May 2009
Posts: 523
Re: What are the Sub Procedures in VB 6.0?

A Sub Procedure is a procedure which performs actions. It is used when the same code is used repeatedly at different places. Using a procedure makes the code readable and shorter. They make debugging and testing easier. This is used by a programmer when he/she is coding a project which is quite big. I think that sub procedures are one the important part while a programmer is coding a project in visual basic. One should use sub procedures when they are coding a project in a visual basic.
Reply With Quote
  #3  
Old 25-12-2010
Member
 
Join Date: Apr 2009
Posts: 567
Re: What are the Sub Procedures in VB 6.0?

You can create a sub procedure in visual basic 6.0 which quite simple. Creating a New Sub Procedure Steps to create a new Sub is as follows:
Procedure: 1. Display the code window for the form.
Procedure: 2. Select Add Procedure from the Tools menu.
Procedure: 3. Enter a name in the Add Procedure dialog box.
Procedure: 4. Select the Type as Sub.
Procedure: 5. Select the type of Scope (Private or Public)
Procedure: 6. Click OK.
Reply With Quote
  #4  
Old 25-12-2010
Member
 
Join Date: May 2009
Posts: 532
Re: What are the Sub Procedures in VB 6.0?

The arguments to be passed are specified in parenthesis after the name of the procedure. Multiple arguments can be specified by separating them with commas. If the Optional keyword is specified, passing that argument is optional. All Optional arguments must be to the right. If By Val is specified, a copy of the value of variable is passed to the Procedure. Thus, if the procedure modifies the value of the argument, the value of the passed variable remains unchanged.
Reply With Quote
  #5  
Old 25-12-2010
Member
 
Join Date: Apr 2009
Posts: 484
Re: What are the Sub Procedures in VB 6.0?

If ByRef is specified, the reference of the variable is passed to the Procedure. Thus, if the procedure modifies the value of the argument, the value of the passed variable also changes. ByRef is default. viii. ArgName is any valid identifier used to access the argument in the scope of the procedure. Example Private Sub Sum(X As Integer, Y As Integer) Me. Print X + Y End Sub The above procedure prints the sum of its arguments viz. X and Y on the form.
Reply With Quote
Reply

  TechArena Community > Software > Windows Software
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "What are the Sub Procedures in VB 6.0?"
Thread Thread Starter Forum Replies Last Post
Extracting stored procedures Maal-Gaadi Software Development 3 29-12-2010 07:29 PM
How to create procedures in VBScript Betelgeuse Software Development 4 30-11-2010 01:45 AM
What is SQL Stored Procedures? technika Software Development 5 20-02-2010 05:00 PM
Calling Oracle Stored Procedures with PHP Landan Software Development 5 12-02-2010 05:37 PM
Call hierarchy of procedures ArunJ Software Development 4 06-02-2009 07:43 PM


All times are GMT +5.5. The time now is 12:04 AM.