|
My guess would be that it's "reverse" as in "undo", not "reverse" as in "go backwards".
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
The foreach operator is not an option I guess . Also, if they only wanted to reverse the list, why not use this? That is the forbidden stuff, and the unfaithful will be punished by torturing and banishing for forever.
|
|
|
|
|
There's nothing wrong with that code (other than it being called Reverse rather than Undo), if ReverseActions is called elsewhere with a partially enumerated IEnumerator ... which I'd bet it is.
|
|
|
|
|
Looks like the code will work and is more justification for my signature line.
Just because the code works, it doesn't mean that it is good code.
|
|
|
|
|
Apparently if you buy a Windows phone they'll throw in an old http://en.wikipedia.org/wiki/Ford_Cortina[^]Cortina. Now that would put the 'mobile' in mobile phone.
What's that?
Time for my jab?
But nurse! I'm having fun!
modified 21-Feb-14 3:12am.
|
|
|
|
|
They should have called it Cortana.
edit: *checks insider news* wait .. they did call it Cortana? OK then
|
|
|
|
|
if (buttontype == 0)
{
this.ViewState["id"] = 0;
this.ViewState["ceID"] = 0;
this.CreateOtmGridAndAutoCompleteJavascript();
if (buttontype == 2)
{
this.PopulateDefaultValues(form);
}
}
|
|
|
|
|
maybe CreateOtmGridAndAutoCompleteJavascript changes buttonType ... probably not but maybe
Don't comment your code - it was hard to write, it should be hard to read!
|
|
|
|
|
|
surely its obvious
ViewState increments it
|
|
|
|
|
Rich.Edwards wrote: This really pushes my buttons
or not
|
|
|
|
|
For some reason, I think they've made that second line overcomplicated...
If (rst!general_damages <> "100000+") Then
F.txtDamages = Left("" & rst!general_damages, InStr(1, "" & rst!general_damages, "-", vbTextCompare) - 1)
Else
F.txtDamages = Left("" & rst!general_damages, InStr(1, "" & rst!general_damages, "+", vbTextCompare) - 1)
End If
and further down...
MsgBox "Error occured with Worksource ID " & Val("" & F.txtWorksourceID) & " cannot be found"
txtWorksourceID is a text box, so this prepends an empty string to the contents of a text box, converts that to a number, then converts that back to a string to include in a message.
It works of course (there are many,m nay subtle bugs in this project), but doesn't exactly improve maintainability.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
modified 19-Feb-14 6:49am.
|
|
|
|
|
Looks like some VB4 code - prepending with an empty string is to cast the variable to a string. Usually only needed if you are concatenating strings which may hold numeric data.
Much better ways to castin VB6
|
|
|
|
|
"Looks like some VB4 code" - apparently not, the company was born in 2003!
The code is liberally littered with them. I can almost forgive it on db access:
Dim s As String
s = "" & rs!value
but really don't see its use in some cases, to paraphrase, things like:
Dim i As Integer
Dim s As String
s = 123
s = 123 & ("" & val(s)) && ("" & i)
I think the approach is "we're not sure when we need to cast, or how to do it, so we'll cast everywhere just in case.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
Rob Grainger wrote: The code is liberally littered with them. I can almost forgive it on db
access:
<SPAN class=code-keyword>Dim</SPAN> s <SPAN class=code-keyword>As</SPAN> <SPAN class=code-keyword>String</SPAN>
s = <SPAN class=code-string>"</SPAN><SPAN class=code-string>"</SPAN> & rs!value
Thats where I normally come across it - I'd suspect they found the same site/book to find out how to code it as the originators of the software I work on.
Rob Grainger wrote: I think the approach is "we're not sure when we need to cast, or how to do it,
so we'll cast everywhere just in case.
hehe at least they're consisent
|
|
|
|
|
Rob Grainger wrote: "Looks like some VB4 code" - apparently not, the company was born in 2003!
The brain guilty of creating that code must have been ossified for at least 6 years then. (VB5 came out in 97.)
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies.
-- Sarah Hoyt
|
|
|
|
|
Just found this:
private void trySave(ref clsWord objWord, string strFullPath, Format format)
{
try
{
objWord.save(strFullPath, format);
}
catch (InvalidOperationException ex)
{
if (ex != null)
{
trySave(ref objWord, strFullPath, format);
}
}
}
modified 18-Feb-14 9:11am.
|
|
|
|
|
'Tis a lesson you should heed:
Try, try, try again.
If at first you don't succeed,
Try, try, try again.
|
|
|
|
|
Yeah, but your version stops after three goes...
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
And what's that ex != null for?
|
|
|
|
|
For a moment I thought about that, but then I just gave up try ing.
|
|
|
|
|
I think he got NullReferenceException so added that condition to avoid the error
thatrajaCode converters | Education Needed
No thanks, I am all stocked up. - Luc Pattyn
When you're wrestling a gorilla, you don't stop when you're tired, you stop when the gorilla is - Henry Minute
|
|
|
|
|
Well, eventually it will, but detrimentously: the StackOverflowException won't be dealt with at this place.
|
|
|
|
|
The code is complete bullshit!
- What is the point of using ref?
objWord is not assigned any value. I guess, the author has never heard of reference types and value types, doesn't differentiate them and also is a former C++ developer. - If an exception is generated, a variable, representing it, can NEVER be
null . And the check
ex != null just looks stupid. - Also, it will sound very upsetting for the author, but if the exception mentioned above is ever generated, he is about to face an infinite recursion, hence he will also face the full power of the
StackOverflowException .
Summarizing the above, I'd say he better work in McDonald's. To get a chance to become a manager , that is a real chance to afford Ford Mustang GT... someday .
lifecycle of a lifecycle of a lifecycle
|
|
|
|
|
Lol. Btw, to add some background, I'm a contractor at a company that bought another company in the same business. A very successfull software came in the bundle (and of course they plan to merge its features into their own software), but little to no documentation came along and now people are having a hard time figuring bugs things out.
It is BS at so many levels, indeed, but the other products make up for it.
|
|
|
|