Dead Badger, not to expose my own braindeadery, but how else would you do it?
Well, you could just access array[n] directly, but then if you’re consulting at an hourly rate it’s not nearly as lucrative.
If you don’t want to feel embarrassed, don’t read any further… X = ArrayName(n).
Ah, I see. Of course.
I guess I was assuming that you would not initially know which element of the array you needed to return.
But he stopped when i = n, so he knew.
Damn, I almost forgot again. Meant to mention this earlier. Same guy as before, different day. This is a paraphrase of a VB subroutine he wrote:
Sub MySub()
Dim MyVariable
'Lottsa code...
If MyVariable = 5 Then
Exit Sub
End If
End Sub
It would exit the sub anyway, regardless of the value of MyVariable. End Sub immediately follows End If.
Yeah, I could’ve been clearer. I was going to write the code but I figured I’d cock up the VB syntax and become a victim of Dorky Gaudere.
I once worked with a guy that wrote code this way:
Sub MySub()
Dim MyVariable
'Lottsa code...
If MyVariable = 5 Then
Exit Sub
End If
End Sub
Yes, with those sorts of indentations. Usually there were far more than 7 lines of code, though. Hundreds or thousands, mostly.
It wouldn’t cost much to have a simple text display instead of a light bulb behind a little engine logo.
Sure it would. I can easily use that code to find out how the problem will affect driveability of the car and even some possible ways to fix the car, potentially saving me hundreds of dollars.
There’s a simple answer really. As a coding golden-rule, any error message that is ever potentially displayable in a dialog box should have two messages; a common end-user message, and a developer/techie message.
The OP’s example could have been written as:
“User alert: Minesweeper was unable to find a necessary data file and failed to start.
Developer note: The SHLWAPI.DLL file is linked to missing export MSVCRT.DLL:_wtol”
That way, the end-user at least know generally what went wrong, and useful error information is still passed to one who has the expertise to analyze the error.
Yeah, that would work if the coder for mindsweeper returned his error messages that way. My understanding (and I could be wrong) was that this was a problem in a tertiary file. A printer driver or something. And then there are SQL Server errors with useless information like: Ambiguous syntax at “’”. Or “Field name not found.” Why not go ahead and give me what field it is? Or which frigging apostrophe?
And the one that really riles my ass. Errors from VB like: Expected “Then”. Well, hell, if you expected it, just add it and go on, dammit!
No, no, no. Sales.
How many of you have ever tried to write good error messages for a reasonably complex program? The problem is lack of context, and the fact that guessing the cause of the error will totally confuse the user more often than not - since you’ll be wrong.
I got a similar error when trying to open a file on the new version of Quicken I just installed on my wife’s computer. After a short chat with a support guy who seemed to know someone, he directed me to a hidden error page. It seems that installing over the demo version doesn’t work, and you have to reinstall in a new directory. Now, how someone writing the code to open a file would ever guess this is beyond me. I suspect a lot of pages giving resolutions for error messages get written after the code is released and tney see how things are screwed up.
It’s better to expect to Google than to expect the error messages to anticipate the root cause of all problems.
Not to alarm you, and all, but that error might be a bug-ridden virus or, possibly, spyware. It could be running happily until it meets some unexpected condition and crashes.
It really depends on the hair. Good hair = sales. Bad hair = management.
Bad teeth=BOFH
One of those computer nerds chiming in to point out that most error messages are not meant for the user. Sure, if you’re typing in your email address, and you put a # instead of an @, the error message should let you know that you need to type it back in. That’s something you can fix.
When you see a cryptic error message that you don’t understand, just imagine that it says “Wow, something went really wrong back there, and there is no way you you can fix it. Here’s some technical junk to tell to someone who can fix it for you.”
Sorry, but that’s patently not true.
Over the years, i’ve had a bunch of error messages which, with some Googling, i’ve been able to decipher and then fix the problem. Just the other day, my wife’s laptop popped up an error message after Windows started up. I wrote done the message, including the error number, and plugged it into Google. Sure enough, it turns out that there was a problem with Windows Defender that i then fixed relatively easily.
This sort of thing has happened a bunch of times. Now, it may be that writing a plain-text, easy-to-understand error message for all possible errors is completely impractical, but it’s just plain wrong to suggest that every cryptic error message represents some sort of catastrophic problem that only a paid expert can fix.
Good Lord.
If that’s right I must have got it in the first two weeks.
I have Spyware Detector, supposed to be one of the best (and not free as my unofficial advisor claims the free stuff is not worth it).
Also McAfee.
I think I’ll wait for a while and see. The tower unit weighs about three tons.
Sorry. I’m exaggerating.