VB Programming


Programming is a process that requires us to organize our actions into three stages. These are:
  1. Entering information into the program.
  2. Processing the entered data.
  3. Outputing the results to a screen or a printer.
In this process we often find that we need to temporarily store data because we are not ready to process it just yet. For example when we calculate the payment due on a loan, we need to input the following information before the processing can occur.

Inputs Necessary for Loan Calculation
  • The amount of the loan.
  • The current interest rate.
  • The duration of the loan.
Until all three datum have been input, we cannot perform the calculation to determine the payment which will be due each period. So we cannot trigger the loan calculation after any of these three individual inputs occur, but we must wait until all three inputs have occurred before we can calculate.

The question is what do we do with each datum entered so that we will have it when we are ready to perform the calculation. The answer is simple. We put it in a safe place where we can go back and get it whenever we need it. If programming terms that 'safe place' is called a variable.

The beginning programmer in Visual Basic will usually say: "Well it is in a safe place, it is in the textbox where the user entered it," or "It is in the radiobutton which the user selected." They are correct, but only partly. In a simple programming we can indeed leave our data on the form and expect it to be there when we need it. However, as a person learns more about programming you learn that there are advantages to making a copy of the data which has been entered and storing it in a place which will not permit the user to accidentally change or remove it. The only real disadvantage is a bit of extra coding to create the variable and store the information in it.

Some of these adavantages are:
  • Data stored in a textbox is a string. If it is to be used as a number it must first be converted from string data type to one of the number data types. If we leave the data in the textbox then this conversion must be done everytime the data is needed. So the question is: should you do this conversion every time you need the datum or do it once and store the number as a number? Experience has shown that fewer conversions are more efficient and safer because there are fewer opportunities for errors to occur.
  • By storing the data we want to keep track of, we are certain to have it when we need it. A form's main purpose is to allow the user to input data, and to display output, not for holding or storing data. Information in textboxes and radiobuttons could be changed by the user. If we do not store the data we need to keep track of, it may not be there when we need it because it may have been accidentally or deliberately altered by the user. By placing the data in a variable we can control it better preventing the accidental or deliberate changing of our data.
  • Separating the entry of the data from the storage of the data allows us to check each time data is entered to see if it is the right kind of data. If it passes the error checks then we can store it in a variable. This way we are only asking our program to do one thing at a time. This is an approach which has been proven to be a more reliable way to do things for over fifty years.
  • Processing is sometimes done in stages. If we continually convert our data from number to string and back again we can lose precision. We should convert between data types as seldom as possible. Ideally that means twice: once just after the data is entered and second when we display the result for the user. The best way to do this is to use variables for data storage.
Examples of When a Variable can be Used
  • Q The data which has been input is stored in a textbox but it is not text data.
  • A Create a variable then convert the date to the proper data type and store it in that variable.
  • Q You have two numbers stored in two variables. How do you swap the numbers?
  • A Declare a third variable. Move second number into the third variable. Move first number into second variable. Now move second number, currently located in the third variable, into first variable.
  • Q You need to keep track of whether the data in your program has changed so that you will know whether the file needs to be saved.
  • A Declare a boolean variable and name it appropriately e.g. fileNeedsSaving When this variable is set to True the flie needs to be saved and when set to False it does not need to be saved. Now use this variable to note when your file needs saving. For example when we add data the file needs saving, When the file has just been saved it does not need saving.

Organizational Behaviour

Motivation - A New Look

If there is one topic which grabs the attention of people who are responsible for getting things done, it is motivation! Although to be truthful, most of these people are not really interested in motivating others, according to the usual interpretation of the term, they are primarily interested in getting the particular task at hand done. Motivation is defined as an internal process. "Motivation is defined as: those psychological processes that cause the arousal, direction and persistence of voluntary ations that are goal directed."1 So if they are not really interested in motivation, what are they interested in? In a word: movement! They really do not care how people feel about what they are doing, they only care that the task at hand gets done.

Hertzberg understood this process very well. In his well known article "One More Time: How Do You Motivate Employees?"2 he describes this exact issue. He points out that the simplest, most practical and fastest method of getting things done is KITA (a kick in the pants). In fact he goes into quite a bit of detail about the various types of KITA that have been perfected over the decades. Starting with Negative Physical KITA he points out that although it is effective and gets results quickly it has the following unfortunate side effects.

  • It is inelegant.
  • It contradicts the precious image of benevolence that most organizations cherish.
  • Since it is a physical attack, it directly stimulate the autonomic nervous system, and this often results in an automatic reaction: the employee kicks back.
For these reasons negative physical KITA has fallen out of favour. However the psychologist has galloped to the resscue of those in need of fast, sure and effective results with a new variation of KITA: Negative Psychological KITA!

This new form of KITA has numerous advantages.

  • The cruelty is not visible.
  • Since it tends to inhibit the higher cortical centers of the brain there is a reduced probability of pyhsical reaction.
  • Since the number of psychological pains a person can feel is almost infinite, there are numerous possible avenues of attack.
  • The person administering the kick can let the system do the work rather than administering it directly. They thus appear to remain above it all.
  • People who practice negative psychological KITA tend to get some ego satisfaction, whereas pysically drawing blood may seem abhorent to them.
  • If the recipient does complain, they can always be accused of being paranoid since there is no tangible evidence of an actual attack.
However, there is no motivation in this form of KITA either. The receipient normally does move, however it is the person who administers the KITA who is motivated, not the recipient of the KITA!

As our society has undergone repeated periods of enlightenment (presumably) over the last century, another suggestion has been made. How about offering a carrot instead of using a stick. So is born Positive KITA. The overwhelming view of many, people and business people in particular, is that this is motivation. However, we have again merely changed tatics. Instead of pushing, we are now pulling. The recipient is still moving in response to our action. They are not motivated, they are reacting to a stimulous. Hertzberg makes this clear with two examples. While a person may train their dog with negative physical KITA - a newspaper; after the training is finished one uses treats, rewards, incentives - Positive KITA instead of negative KITA. All this notwithstanding, if I push (kick), or pull (rewards) it is I who am motivated and the dog who moves. Hertzberg then likens negative KITA to rape and positive KITA to seduction. If rape is terrible, seduction is much worse because we have cooperated in our own downfall. So why is it so popular? - Tradition, and after all why kick someone when you can get them to kick themself?

So why is this important? There are two reasons. The first is illustrated by a story told by Robin Williams about how she learned the importance of naming things.
“Many years ago I received a tree identification book for Christmas. I was at my parent’s home, and after all the gifts had been opened I decided to go out and identify the trees in the neighbourhood. Before I went out, I read through part of the book. The first tree in the book was the Joshua tree because it took only two clues to identify it. Now the Joshua tree is a really weird-looking tree and I looked at that picture and said to myself, “Oh, we don’t have that kind of tree in Northern California. That is a weird-looking tree. I would know if I saw that tree, and I’ve never seen one before.” So I took my book and went outside. My parents lived in a cul-de-sac of six homes. Four of those homes had Joshua trees in the front yard. I had lived in that house for thirteen years, and I had never seen a Joshua tree. I took a walk around the block, and there must have been a sale at the nursery when everyone was landscaping their new homes – at least 80 percent of the homes had Joshua trees in the front yards. And I had never seen one before! Once I was conscious of the tree, once I could name it, I saw it everywhere. Which is exactly the point. Once you can name something, you are conscious of it. You have power over it. You own it. You’re in control.” 3
It is important to be able to name our concepts. It is essential to identifying them, understanding them and using them effectively.

The second point becomes clear when considering some advice I received as a young man. The finer the degree of distinction in your terminology, the deeper will be your understanding of the concept and all related phenomena. If motivation as a concept seems muddy, and it is to most people, then separating it into two concepts: Motivation and Movement helps clarify what is going on. Most business people are not at all concerned with motivation. They are only concerned with movement. This finer distinction enables us to better understand the concepts. There are two concepts here not just one. Knowing this enables us to make certain observations which will allow us to separate the concepts and make better use of the new distinction we have just made.

  • Motivation takes more time to create if it can be created at all.
  • Motivation contains its own initiating stimulous. It is self starting and possibly self sustaining.
  • Movement can be created quickly.
  • Movement requires the administration of an initiating stimulous.
Notice there seem to be two critical differences between the concepts: time to initiate, and the source of the stimulous. If something needs to be done in a hurry, it is hard to beat movement. However, if we want an activity to run unattended, movement will be insufficient. If we want quick action then Movement would seem to be the way to go but we should not fool ourselves into thinking we have created any motivation whatsoever.

If we want our unit to run mostly unattended then we need to take the time to create an atmosphere in which our agents (employees) can and do motivate themselves. This is much more difficult and takes much longer but the effects last longer and can become self-sustaining!

  1. TR Mitchell, "Motivation: New Directions for Theory, Research, and PRactice." Academy of Management Review, Vol 7 (1982): 80-88
  2. Frederick Hertzberg. "One More Time: How Do You Motivate Employees?" Harvard Business Review (January-February 1968)}
  3. Robin Williams The Non-Designer’s Design Book, Peach Pit Press Berkeley California, 1994, p. 13.

Desktop Publishing


In 1985 the introduction of an inexpensive laser printer (it sold for less than $5,000) and a software program from Aldus corporation called Pagemaker (cost about $1,000) triggered the creation of what today we call Desktop Publishing. Prior to the introduction of those two items, it was common to spend over $100,000 for computer hardware, software, image setters, and to hire a 'typesetter' or two and set up in business. By 1986 there were no more typesetters. Most of them had gone into business for themselves by buying a Macintosh computer, (Pagemaker only ran on Macintosh computers at the time) a laser printer and Pagemaker. Desktop Publishing allowed us to easily combine text and graphics on the same page, and anyone could do it!

The only advantage that typesetters had over a novice who bought the same equipment, was they knew what they were doing and how to do it quickly. The rest of us were on our own and what was produced by all those novices was thrilling, and at the same time rather chaotic. It took a few years for the novices to learn the rules that the typesetters knew well. Ironically the typesetters were in the best position to educate the rest of us, but by and large, they did not take up the gauntlet. The traditional way to learn the trade was to apprentice with an established typesetter and learn over time.

This is not an uncommon situation. When paradigms change it is the established people who have the first opportunity to take advantage of the changes. Often they are the last to see the inevitability of what is happening. So most of them resist such change, and it usually takes an outsider to see the real potential and act upon it. However this generalization is a story for another time.

One of the first people to provide instructions on how to get professional looking results with less time and effort was Robin Williams - the author and teacher not the commedian.

At this time a Maintosh computer could be purchased for about $2,000 to $3,000; the Laserwriter debuted at under $5,000, a real steal compared to other high quality printers at the time which could run as high as $100,000; and Pagemaker from Aldus Corporation weighed in at just under $1,000. For under $10,000 you were set up in the typesetting/publishing business. Just a year before a package of hardware and software to do the same thing had cost over $100,000. What an opportunity!

Of course, you could only actually do the first six steps of a traditional twenty-four step publishing process, but it was the most revolutionary advance since the introduction of the printing press by Johannes Gutenberg and others in the 1400's.