Loading ...

How to Write a Pseudocode in Visual Basic

Pseudocode stands for "false code." It is lines of statements that are used as a rough first draft of real computer code, regardless of the computer code language that will take its place during the real coding phases. Writing pseudocode in Visual Basic is similar to writing regular pseudocode, except you insert known variable names and known code snippets along the way. You can create pseudocode by hand or by typing it in a word processing program.

Loading ...
  1. List the main functions of the new software and what the end results are to be. For example: The user is to press the "X" button, and an "X" is supposed to display on the appropriate box. Same for the O's.

  2. Identify and write down the variable names for the different items needed in the program. For example: Box 1 = labelBox1; Box 2 = labelBox2; Box 3 = labelBox3; X Button = buttonX; O Button = buttonO.

  3. Write the beginning of the pseudocode with "Run Program" and skip a line. Make a left curly bracket with the "{" key on your keyboard. Drop down one more line and place a right curly bracket directly underneath it, "}." If you are writing the code by hand, then do not place this bottom bracket until you finish the first module.

  4. Write "Form Load" under the first curly bracket. Skip down one line and indent in five spaces with another left curly bracket under "Form Load." Write "buttonX = labelBox1.text ("X")" without the outside quotation marks.

  5. Skip down one line and directly under the first "buttonX" statement write "buttony= labelBox2.text("Y")" without the outer quotation marks. Skip down and make the right curly bracket directly below the inner left curly bracket.

  6. Write "End Routine" directly under all of that on the left so it lines up with "Form Load." Make the final right curly bracket on the very bottom all the way to the left if you have not done so already.

  7. Tip

    Each Visual Basic module is encapsulated between a left and a right curly bracket always on the left. Between those curly brackets and tabbed in approximately five spaces is the description of the function or routine you are describing. The actual coding directions are encapsulated again inside a second set of curly brackets indented from the description title. If you drew a line down the left column next to all the appropriate indentations, it would look similar to an arrow pointing to the right or a triangle with the top pointing to the right. There is no one correct way to create pseudocode in Visual Basic, as each programmer's level of expertise is different. The main goal of pseudocode is to help programmers get the feel and format of what the final code may look like.


    Be consistent throughout your pseudocode, keeping all variable names the same. For example, if you are using "labelBox1" as the name for "Box 1" then use "labelBox1" throughout the code, rather than switching to "Box 1" or "The O Box" halfway through the code.

Loading ...

About the Author

Misty S. Bledsoe has been writing since 1995. She specializes in writing about religion, technology and solar concepts, and her articles appear on various websites. She holds a Bachelor of Science in information technology from American Intercontinental University.

Loading ...