How to Use a Subprogram in Visual Basic 6.0

Visual Basic is part of the Visual Studio package for Microsoft operating systems. Visual Basic is a programming language that is integral to creating executable applications for Windows. Version 6.0 was the last release for the early Visual Basic program. Visual Basic .NET succeeded Visual Basic. A subprogram is housed within a program that can operate independently of the main program. Using a subprogram allows less manual programming in the main program.

Instructions

    • 1

      Open the Visual Basic program. Click "File > New Program" twice to create two new templates for programming. You will be prompted to name the projects. You can name them whatever you like.

    • 2

      Select one of the windows and then click "File > Make (Project Name).exe to turn one of the programs into an executable file. This is the file that will be used as a subprogram.

    • 3

      Click the "X" box in the top-right corner of the .exe file window to close the window.

    • 4

      Minimize Visual Basic and go to the location on the computer where the two programs were saved. Drag the .exe file into the main Visual Basic program folder that you just created.

    • 5

      Open Visual Basic again and choose the section of the source code where you want to put the subprogram. Type a code like this one into the program event:

      Shell App.Path & "\(Name of executable file).exe", vbNormalFocus

      Type in the actual .exe file name without the parentheses.

    • 6

      Test the program to make sure the subprogram is running correctly by clicking the "Start" button on the toolbar. If everything runs correctly, save the changes by click "File > Save Project."

Related Searches:

References

Comments

You May Also Like

Related Ads

Featured