How to Write a Pseudocode in Visual Basic

by Misty S. Bledsoe

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.

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.

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.

Photo Credits

  • photo_camera binary digits - computer science image by drx from Fotolia.com