Perils of GoTo

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
That is hilarious!

I learned Basic as my first programming language 30 years ago and Goto was the only branching option available. I have over the years grown away from using but occasionally come upon a situation where I really want to use it, and am stymied by the years of being beat over the head that Goto's were EVIL!

This cartoon captures the essence of my internal struggles perfectly!

Owen
 
Is there actually a situation where you would absolutely have to use a GoTo? (referring to VBA in particular). Personally I don’t even think about them when I’m writing code, I’ve never used one in VBA and never intend to!! My earliest programming was done as a little kid using TIBasic on a Texas Instruments graphical calculator. It was fairly limited in functionality so I got into the habit of using GoTo for most loops but my father always reprimanded me for it so I soon changed my ways and never looked back since! God bless parents!! :LOL:
 
Well,

On Error Goto Err_Handler

utilises a Goto and my VBA apps would be much the worse for not incorporating something like this...

:biggrin:
 
Yep, a lot of people (including myself) use them in Error Handling (and it usually just to jump to the end, do some debugging and exit).

However, that is the only place that I use them.
 
So that's what happened to the guy in Jurassic Park.

A velociraptor found he was using GoTo unnecessarily in his code and decided to take the appropriate action.:)
 
So that's what happened to the guy in Jurassic Park.

A velociraptor found he was using GoTo unnecessarily in his code and decided to take the appropriate action
:LOL: :LOL: :LOL:

Code:
Sub ParkSecurity()
On Error GoTo WaitingHelicopter
If Dinosaur.Escape = True then
	FrozenEmbryos.InBag = True
	FatDude.TravelSpeed = Fast
	If ParkJeep.InRain.Reliability < Average then
		Rain = xlVeryHeavy
	End If
End If
Select Case SmallFrillyDinosaur
	Case Squeaks
		FatDude.Affection = High
	Case Growls
		FatDude.Affection = Medium
	Case Screams
		FatDude.Affection = Low
		FatDude.Pants = Brown
		FatDude.Intelligence = xlVeryStupid
End Select
If FatDude.Pants <> White then
	FatDude.Alive = False
	MsgBox “Uh, Uh, Uh, You didn’t say the magic word!!!”
End If
End Sub
 
VBA humor...gotta love it!!!! :wink: :) :biggrin: :p :LOL:

This whole thread is hilarious...thanks guys!
 

Forum statistics

Threads
1,214,523
Messages
6,120,042
Members
448,940
Latest member
mdusw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top