Results 1 to 5 of 5

Thread: What are the Sub Procedures in VB 6.0?

  1. #1
    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.

  2. #2
    Join Date
    May 2009
    Posts
    527

    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.

  3. #3
    Join Date
    Apr 2009
    Posts
    569

    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.

  4. #4
    Join Date
    May 2009
    Posts
    539

    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.

  5. #5
    Join Date
    Apr 2009
    Posts
    488

    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.

Similar Threads

  1. Extracting stored procedures
    By Maal-Gaadi in forum Software Development
    Replies: 3
    Last Post: 29-12-2010, 07:29 PM
  2. How to create procedures in VBScript
    By Betelgeuse in forum Software Development
    Replies: 4
    Last Post: 30-11-2010, 01:45 AM
  3. What is SQL Stored Procedures?
    By technika in forum Software Development
    Replies: 5
    Last Post: 20-02-2010, 05:00 PM
  4. Calling Oracle Stored Procedures with PHP
    By Landan in forum Software Development
    Replies: 5
    Last Post: 12-02-2010, 05:37 PM
  5. Call hierarchy of procedures
    By ArunJ in forum Software Development
    Replies: 4
    Last Post: 06-02-2009, 07:43 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,716,505,262.45976 seconds with 17 queries