If Humans Were Objects – The Microsoft Excel Visual Basic Event-Handling Model In Human Terms

Visual Basic
by tind

There are 3 universal constants in human life: we are born; we receive married (maybe); and we die (there are many good pieces between, but we’ll exclude them from this article).

If people had an event-driven model (and who knows, possibly we do in our brains someplace?), the occasions will be as follows:

– Birth
– BeforeMarriage
– AfterMarriage
– Death

The initially thing to note is the fact that the Birth and Death occasions do not have before and after components – that’s because (religious views notwithstanding) not much occurs before you’re born, at smallest for the reasons of the post not much arises once you die either.

The interesting event is the Marriage 1.  To illustrate this, consider the well-known scene from Jane Eyre, when Mr. Rochester is going to receive married to his beloved Jane.  The priest asks the congregation if they learn of anybody who has any objection to the union, along with a guy speaks up and claims that Mr. Rochester is absolutely married.

This announcement cancels the BeforeMarriage event, in the same technique as possible interrupt BeforePrint and BeforeSave occasions in Excel.  The just difference is the fact that in Excel you do this by setting the boolean Cancel argument to True, while in real lifetime all that you need to do is stand at the back of the church and shout out at the appropriate time.

Had Mr. Rochester succeeded in getting married, this might have caused many AfterMarriage occasions, including the throwing of confetti as well as the change of Jane’s maiden name from Eyre to Rochester.  In the same technique, you are able to respond to an event like printing or saving in Excel utilizing the AfterPrint or AfterSave event.  At this point it’s too late to stop the printing or saving happening – the event has completed – but you are able to respond to the, maybe by exhibiting a content on screen or amending some parameters in a spreadsheet.

And today I have reached the finish of the post, so the ArticleFinished event may fire, followed soon by the ArticleSubmit event and (in rapid succession) the BeforeMakeCoffee and AfterMakeCoffee occasions.  If just everything in existence was as logical and easy as Visual Basic!

  • CommentLuv badge



    This blog uses premium CommentLuv which allows you to put your keywords with your name if you have had 3 approved comments. Use your real name and then @ your keywords (maximum of 3)