Funniest code snippet ever! Must See!

Mucman

Diamond Member
Oct 10, 1999
7,246
1
0
select case selectedCruiseline
case "1"
selectedCruiseline = 1
case "2"
selectedCruiseline = 2
case "3"
selectedCruiseline = 3
case "4"
selectedCruiseline = 4
case "5"
selectedCruiseline = 5
case "6"
selectedCruiseline = 6
case "7"
selectedCruiseline = 7
case "8"
selectedCruiseline = 8
case "9"
selectedCruiseline = 9
end select

Had to troubleshoot a customer whose ASP website is bringing down the server. If I hit a certain URL the
dllhost.exe process consumes all the CPU and all the RAM! Administering shared hosting feels more and more
like being a babysitter. The above code is actually used in their website!
 

GtPrOjEcTX

Lifer
Jul 3, 2001
10,784
6
81
pure stupidity.

I bet the person who coded that worked on Bestbuy.com. Horrible horrible experiences with the site and security.
 

dabuddha

Lifer
Apr 10, 2000
19,579
17
81
wtf. Who programmed that and are their companies hiring to replace those idiots? :)
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: gigapet
someone explain the humor

It's the equivelant of:

If this number is 1, make this number be 1.
If this number is 2, make this number be 2.
...
Up through 9...
 

DnetMHZ

Diamond Member
Apr 10, 2001
9,826
1
81
mmmm.....code-bloat
rolleye.gif
 

Viper GTS

Lifer
Oct 13, 1999
38,107
433
136
Originally posted by: gigapet
someone explain the humor

They're using a select case to reassign the same value that was previously assigned to a variable.

Viper GTS
 

Viper GTS

Lifer
Oct 13, 1999
38,107
433
136
Originally posted by: notfred
Originally posted by: gigapet
someone explain the humor

It's the equivelant of:

If this number is 1, make this number be 1.
If this number is 2, make this number be 2.
...
Up through 9...

It's worse than that, they're reassigning the value to the SAME VARIABLE.

Viper GTS
 

I've only taken elementary C++, so I might not know what I'm talking about, but do you need 'break' statments when writing a case statement also?
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: Viper GTS
Originally posted by: notfred
Originally posted by: gigapet
someone explain the humor

It's the equivelant of:

If this number is 1, make this number be 1.
If this number is 2, make this number be 2.
...
Up through 9...

It's worse than that, they're reassigning the value to the SAME VARIABLE.

Viper GTS

Um, that's what I said. Unless you're differentiting between "this number" and "this number" and somehow thinking I implied two different variables... :confused:
 

Mucman

Diamond Member
Oct 10, 1999
7,246
1
0
Originally posted by: jumpr
I've only taken elementary C++, so I might not know what I'm talking about, but do you need 'break' statments when writing a case statement also?

It's VBScript

 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: jumpr
I've only taken elementary C++, so I might not know what I'm talking about, but do you need 'break' statments when writing a case statement also?

It's ASP code, not C++ did you read the first post?
 

Viper GTS

Lifer
Oct 13, 1999
38,107
433
136
Originally posted by: notfred
Originally posted by: Viper GTS
Originally posted by: notfred
Originally posted by: gigapet
someone explain the humor

It's the equivelant of:

If this number is 1, make this number be 1.
If this number is 2, make this number be 2.
...
Up through 9...

It's worse than that, they're reassigning the value to the SAME VARIABLE.

Viper GTS

Um, that's what I said. Unless you're differentiting between "this number" and "this number" and somehow thinking I implied two different variables... :confused:

My way of saying it was clearer.

:p

Viper GTS
 

Originally posted by: notfred
Originally posted by: jumpr
I've only taken elementary C++, so I might not know what I'm talking about, but do you need 'break' statments when writing a case statement also?

It's ASP code, not C++ did you read the first post?
Right, I know. But I was wondering if ASP uses break statements just like C++. So you didn't really answer my question. :p
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: Viper GTS
My way of saying it was clearer.

:p

Viper GTS

Your way of saying it will only make sense to people who only know what it means already :p
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Originally posted by: jumpr
Originally posted by: notfred
Originally posted by: jumpr
I've only taken elementary C++, so I might not know what I'm talking about, but do you need 'break' statments when writing a case statement also?

It's ASP code, not C++ did you read the first post?
Right, I know. But I was wondering if ASP uses break statements just like C++. So you didn't really answer my question. :p

Apparently not, since the code runs.
 

Electric Amish

Elite Member
Oct 11, 1999
23,578
1
0
Originally posted by: manly
Nah, that isn't funny besides the laughing at someone elses's stupidity.

Since I don't know VB, is that actually completely redundant, or is it essentially converting a string to an integer?

It's a case statement. They're the same function in all languages that support it, only the syntax may be a little different.