ON ERROR RESUME NEXT
-
"IF THEN MAYBE", "DO SOMETHING" and "GO SOMEWHERE" have always had a special place in my heart.... MAYBEBOL
-
Not quite - the modern version would require wrapping every single statement in its own "Pokémon exception-handling" block. Which would mean splitting all variable declarations from their assignments, since a variable declared inside a
try
block can't be used outside of that block. Which would also mean giving every variable some sort of default value, either when they're declared, or in the emptycatch
block for the first line that assigns them. And don't forget to update the properties of the globalErr
object, in case the user gave any thought to checking for errors on the following line, and didn't just let their code trundle on regardless and destroy the program state / database / computer / world. Having worked with VBScript many years ago, where this was the only form of error handling allowed, it's an horrendous construct. Whoever came up with the idea deserves a good beating with the clue-bat.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
That's more like ON ERROR BAIL.
Steve
-
Not quite - the modern version would require wrapping every single statement in its own "Pokémon exception-handling" block. Which would mean splitting all variable declarations from their assignments, since a variable declared inside a
try
block can't be used outside of that block. Which would also mean giving every variable some sort of default value, either when they're declared, or in the emptycatch
block for the first line that assigns them. And don't forget to update the properties of the globalErr
object, in case the user gave any thought to checking for errors on the following line, and didn't just let their code trundle on regardless and destroy the program state / database / computer / world. Having worked with VBScript many years ago, where this was the only form of error handling allowed, it's an horrendous construct. Whoever came up with the idea deserves a good beating with the clue-bat.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
For some reason, that just popped into my head.......I wasn't even looking at anything code related, was watching the "Couch Commander" video :laugh: Anyway, the question is are there any other "statements" such as the one in the subject' in any other programming language that so eloquently and succinctly tell you exactly what it's doing.......? The more obscure the language the better. And if anyone says this is a programming question, which it is, but it's not, will get a skelped dock!
Dave Find Me On:Web|Youtube|Facebook|Twitter|LinkedIn Folding Stats: Team CodeProject
I've worked at places where it's ON ERROR RESUME UPDATE. (You'll have to imagine the accents)
I wanna be a eunuchs developer! Pass me a bread knife!
-
For some reason, that just popped into my head.......I wasn't even looking at anything code related, was watching the "Couch Commander" video :laugh: Anyway, the question is are there any other "statements" such as the one in the subject' in any other programming language that so eloquently and succinctly tell you exactly what it's doing.......? The more obscure the language the better. And if anyone says this is a programming question, which it is, but it's not, will get a skelped dock!
Dave Find Me On:Web|Youtube|Facebook|Twitter|LinkedIn Folding Stats: Team CodeProject
DaveAuld wrote:
just popped into my head
I mumble this when something goes wrong...of course the wife doesn't get it. :laugh: It's the be-all, catch-all of error handling constructs, and not a bad way to approach life sometimes! I can always apply a condition based on Err.Number! :laugh:
"Go forth into the source" - Neal Morse
-
For some reason, that just popped into my head.......I wasn't even looking at anything code related, was watching the "Couch Commander" video :laugh: Anyway, the question is are there any other "statements" such as the one in the subject' in any other programming language that so eloquently and succinctly tell you exactly what it's doing.......? The more obscure the language the better. And if anyone says this is a programming question, which it is, but it's not, will get a skelped dock!
Dave Find Me On:Web|Youtube|Facebook|Twitter|LinkedIn Folding Stats: Team CodeProject
break;
The language is JavaScript. that of Mordor, which I will not utter here
This is Javascript. If you put big wheels and a racing stripe on a golf cart, it's still a fucking golf cart.
"I don't know, extraterrestrial?" "You mean like from space?" "No, from Canada." If software development were a circus, we would all be the clowns. -
"IF THEN MAYBE", "DO SOMETHING" and "GO SOMEWHERE" have always had a special place in my heart.... MAYBEBOL
ON ERROR FORGET ABOUT IT
from MAYBEBOL seems to be most directly in the spirit of the OP.
Software Zen:
delete this;
-
For some reason, that just popped into my head.......I wasn't even looking at anything code related, was watching the "Couch Commander" video :laugh: Anyway, the question is are there any other "statements" such as the one in the subject' in any other programming language that so eloquently and succinctly tell you exactly what it's doing.......? The more obscure the language the better. And if anyone says this is a programming question, which it is, but it's not, will get a skelped dock!
Dave Find Me On:Web|Youtube|Facebook|Twitter|LinkedIn Folding Stats: Team CodeProject
I like INTERCAL's
ABSTAIN.
You get statements like:PLEASE ABSTAIN FROM CALCULATING
Also, to exit the program, you use:
PLEASE GIVE UP
The
PLEASE
is optional. If you don't use it enough, through, the compiler will reject your program for not being polite enough. You do have to be careful with it: usingPLEASE
too often will get your program rejected for excessive politeness. -
Not quite - the modern version would require wrapping every single statement in its own "Pokémon exception-handling" block. Which would mean splitting all variable declarations from their assignments, since a variable declared inside a
try
block can't be used outside of that block. Which would also mean giving every variable some sort of default value, either when they're declared, or in the emptycatch
block for the first line that assigns them. And don't forget to update the properties of the globalErr
object, in case the user gave any thought to checking for errors on the following line, and didn't just let their code trundle on regardless and destroy the program state / database / computer / world. Having worked with VBScript many years ago, where this was the only form of error handling allowed, it's an horrendous construct. Whoever came up with the idea deserves a good beating with the clue-bat.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
You hold 'im, I'll hit 'im. Then we can swap places. Repeatedly.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
-
For some reason, that just popped into my head.......I wasn't even looking at anything code related, was watching the "Couch Commander" video :laugh: Anyway, the question is are there any other "statements" such as the one in the subject' in any other programming language that so eloquently and succinctly tell you exactly what it's doing.......? The more obscure the language the better. And if anyone says this is a programming question, which it is, but it's not, will get a skelped dock!
Dave Find Me On:Web|Youtube|Facebook|Twitter|LinkedIn Folding Stats: Team CodeProject
-
The only people who complain about this statement are the same ones who didn't know how to use it properly. :-\
There are only 10 types of people in the world, those who understand binary and those who don't.
The only way to use
On Error Resume Next
properly is to never use it. :)
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
For some reason, that just popped into my head.......I wasn't even looking at anything code related, was watching the "Couch Commander" video :laugh: Anyway, the question is are there any other "statements" such as the one in the subject' in any other programming language that so eloquently and succinctly tell you exactly what it's doing.......? The more obscure the language the better. And if anyone says this is a programming question, which it is, but it's not, will get a skelped dock!
Dave Find Me On:Web|Youtube|Facebook|Twitter|LinkedIn Folding Stats: Team CodeProject
Just about any COBOL will fit that, `ADD 1 TO COUNT` for instance.
veni bibi saltavi
-
You'd have to go a long way to beat the eloquence of this:
$HODOR: hhodor? Hodor!? Hodor!? oHooodorrhodor orHodor!? d = HoDoRHoDoR () {
hodor.hod('Hhodor? Hodor!? Hodor!? o HODOR!? orHodor!? d!');
};hhodor? Hodor!? Hodor!? oHooodorrhodor orHodor!? d();
Hodor Programming Language[^] :-D
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Richard Deeming wrote:
That would be funnier if it didn't look almost exactly like a lot of the Java code I've had to manage.
I wanna be a eunuchs developer! Pass me a bread knife!
-
Not quite - the modern version would require wrapping every single statement in its own "Pokémon exception-handling" block. Which would mean splitting all variable declarations from their assignments, since a variable declared inside a
try
block can't be used outside of that block. Which would also mean giving every variable some sort of default value, either when they're declared, or in the emptycatch
block for the first line that assigns them. And don't forget to update the properties of the globalErr
object, in case the user gave any thought to checking for errors on the following line, and didn't just let their code trundle on regardless and destroy the program state / database / computer / world. Having worked with VBScript many years ago, where this was the only form of error handling allowed, it's an horrendous construct. Whoever came up with the idea deserves a good beating with the clue-bat.
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Richard Deeming wrote:
he modern version would require wrapping every single statement in its own "Pokémon exception-handling" block. Which would mean splitting all variable declarations from their assignments, since a variable declared inside a
try
block can't be used outside of that block. Which would also mean giving every variable some sort of default value, either when they're declared, or in the emptycatch
block for the first line that assigns them. And don't forget to update the properties of the globalErr
object, in case the user gave any thought to checking for errors on the following line, and didn't just let their code trundle on regardless and destroy the program state / database / computer / worldAh! Now I understand why you love VB so much!
I wanna be a eunuchs developer! Pass me a bread knife!
-
The only way to use
On Error Resume Next
properly is to never use it. :)
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Not the best War Games paraphrase I've ever seen, but it'll do.
I wanna be a eunuchs developer! Pass me a bread knife!
-
Just about any COBOL will fit that, `ADD 1 TO COUNT` for instance.
veni bibi saltavi
Well,
PERFORM sthg VARYING FROM 1 BY 1 UNTIL COUNT > 5
could do with a little work, but your point is still 90% valid.I wanna be a eunuchs developer! Pass me a bread knife!
-
I like INTERCAL's
ABSTAIN.
You get statements like:PLEASE ABSTAIN FROM CALCULATING
Also, to exit the program, you use:
PLEASE GIVE UP
The
PLEASE
is optional. If you don't use it enough, through, the compiler will reject your program for not being polite enough. You do have to be careful with it: usingPLEASE
too often will get your program rejected for excessive politeness.Does it have private and public statements, too? e.g:
PRIVATE PLEASE SHAKE_IT_BABY
I wanna be a eunuchs developer! Pass me a bread knife!
-
For some reason, that just popped into my head.......I wasn't even looking at anything code related, was watching the "Couch Commander" video :laugh: Anyway, the question is are there any other "statements" such as the one in the subject' in any other programming language that so eloquently and succinctly tell you exactly what it's doing.......? The more obscure the language the better. And if anyone says this is a programming question, which it is, but it's not, will get a skelped dock!
Dave Find Me On:Web|Youtube|Facebook|Twitter|LinkedIn Folding Stats: Team CodeProject
Common Lisp's loop macro can be pretty interesting. It lets you do things like:
(loop for i in *random*
counting (evenp i) into evens
counting (oddp i) into odds
summing i into total
maximizing i into max
minimizing i into min
finally (return (list min max total evens odds))) -
For some reason, that just popped into my head.......I wasn't even looking at anything code related, was watching the "Couch Commander" video :laugh: Anyway, the question is are there any other "statements" such as the one in the subject' in any other programming language that so eloquently and succinctly tell you exactly what it's doing.......? The more obscure the language the better. And if anyone says this is a programming question, which it is, but it's not, will get a skelped dock!
Dave Find Me On:Web|Youtube|Facebook|Twitter|LinkedIn Folding Stats: Team CodeProject
Bloody hell, nobody mentioned GOTO or even GOSUB. It may not be error handling bit it was/is almost as abused as RESUME NEXT. There were some doozies in the Lotus 123 macro language as well but I can't remember them. And did you ever look under the hood of early Lotus Notes, now there was a whole collection of nightmares!
Never underestimate the power of human stupidity RAH