|
We also have some old legacy projects which need maintenance from time to time. However the gain of updating them to .NET would probably never justify the costs involved.
|
|
|
|
|
The project we have basically produces forms (word docs printed), each one of the form has one or more input masks. Actually over 200. These docs are not allowed to be saved, therefore the application.
The signature is in building process.. Please wait...
|
|
|
|
|
Could this sentence be one of those which could be my last:
"Whats wrong with VB6?"
|
|
|
|
|
It was fine for a product of its time, but is flawed compared to modern languages, for a whole variety of reasons.
Wikipedia (VB on Wiki[^] mentions some of its shortcomings, but actually its not as bad as its reputation - it largely suffered from being easy to hack in, so a lot of VB6 programs have appalling design and plenty of moments that make your jaw drop. It really is truly awful at string-handling though - appending to a string would generally reallocate the whole thing, copy, then append. I came a across apps that frequently added 10-20 characters to a 10MB string, which would grind to halt due to this.
It should absolutely not be used for any new projects, and existing code should be ported to alternatives now though - Microsoft dropped support a while ago, it will now only work (the IDE) on an XP machine (or VM), and there is no guarantee that the runtime will run on new versions of Windows.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
Alan Kay.
|
|
|
|
|
Thanks for clarification. I was in false impression that "VB" would be also referring to VB.NET but now I see VB.NET is just another compiler for .Net framework and is far from same thing as VB. Then there is VBA which I often confuse with too.
Although VBA is something I have to use sometimes when some Excel-crazy person begs me do something within excel which seems only possible with VBA, then I get to tackle some hundred-sheet workbook with thousands character long cell functions.
|
|
|
|
|
Before a month ago ,i started a project on umbraco cms...
It's totally new for me ...Worried about how will i complete my task...
But finally it's done..
nothing is impossible in this digital world...
eNJOY c0ding....
|
|
|
|
|
This forum is intended for code examples that make you wince or want to punch the author.
Not for random discussions - try the lounge: http://www.codeproject.com/Lounge.aspx[^]
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|
|
As mentioned, this is the wrong forum. However, since this is one of the few times I've seen somebody post about Umbraco here, you may want to check out my article: Umbrazure: Limitless Websites with Umbraco on Azure. Also, I created a thread in case anybody wants to ask me Umbraco questions.
|
|
|
|
|
While converting old FoxPro project to new .NET solution.. This is what I am putting up with...
IF printer_type = 1 then
* ELECTRIC LABEL
IF ALLTRIM(lin_array(2)) = "ENVIRO" then
DO eleclabv4
ELSE
DO eleclabv1
ENDIF
* label form testlab noconsole TO PRINTER
ELSE
IF printer_type = 2 then
* GAS LABEL
DO gaslabv1
ELSE
IF printer_type = 3 then
SET FILTER TO dpl.dpl_part = "50V136G" && need to trick the label printing routine to see 1 record to print .. enamel chain items don't have any records in the datplate (dpl) file, therefore nothing will print if we don't trick the program
DO echnlabv1
ELSE
IF printer_type = 4 then
DO gaslabv2
ELSE
IF printer_type = 5 then
*Sunpro gas
DO gaslabv3
ELSE
IF printer_type = 6 then
*Sunpro electric
DO gaslabv3
ELSE
IF printer_type = 7 then
* Titan
DO eleclabv2
ELSE
IF printer_type = 8 then
* Centaur
DO eleclabv3
ELSE
IF printer_type = 9 then
* GEneric label
DO genlabelele
ELSE
IF printer_type = 10 then
* GEneric label
DO genlabelgas
ELSE
IF printer_type = 11 then
* Revision D Electric label
DO genlabeleleRevD
ELSE
IF printer_type = 12 then
* Revision D Electric label
DO genlabelgasRevD
ELSE
IF printer_type = 13 then
* Revision D Electric label
DO conergyelec
ELSE
IF printer_type = 15 then
* Therman electric label
DO genlabeleleThermann
ELSE
IF printer_type = 16 then
* Therman electric label
DO genlabeleleChina2
ELSE
IF printer_type = 17 then
* H4047 A version label
DO eleclabv5
endif
endif
endif
endif
endif
endif
endif
endif
endif
endif
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
ENDIF
Zen and the art of software maintenance : rm -rf *
Math is like love : a simple idea but it can get complicated.
|
|
|
|
|
Hey, at least they tabbed it in nicely for you!!
|
|
|
|
|
give me the blue pill!!!
you want something inspirational??
|
|
|
|
|
Apparently he had no idea what DO CASE ENDCASE was, unless I'm not reading it right and it really does need to be nested...
|
|
|
|
|
I hath been through it, it can be a simple CASE block.
Reality is an illusion caused by a lack of alcohol
"Nagy, you have won the internets." - Keith Barrow
|
|
|
|
|
Agree!!!
|
|
|
|
|
Looks like a fallen tree..
The signature is in building process.. Please wait...
|
|
|
|
|
that code sure is a pain in a neck
What???
|
|
|
|
|
"Zen and the art of software maintenance : rm -rf * " - The best maintenance ever
|
|
|
|
|
I think you shouldn't change this code...
You could angry the titans and centaurs who can ignite some gas using an electric cable. You will end up with a label with a printed "ownd by Therman, the undead coder".
I warned you, mortal.
Greetings - Jacek
|
|
|
|
|
At least it works. I once had to rewrite an entire module because it contained more nesting than the Microsoft C 5.1 compiler could handle.
Hooray for greenbar tractor feed paper and multiple colored pens.
Oh yeah, that code had Goto's in it. Not only the normal backwards ones, but forward ones too.
|
|
|
|
|
Dim strBrowser As String = Request.Browser.Browser.ToString()
Dim strBroswerVersion As String = Request.Browser.Version.ToString()
If strBrowser.ToString() = "IE" Then
If IsNumeric(strBroswerVersion.ToString()) Then
If strBroswerVersion < 9 Then
End If
End If
End If
While fixing compiler errors after enabling option strict, I have come across a prodigious level of crap. I can't post it all, but this one stood out for being crap on almost every level imaginable. Here are a few notes off the top of my head:
- Generally, you should avoid checking browser versions, especially in server-side code (I believe the reasoning is that older browsers are slower, so some value was changed).
- Compilation breaks when trying to compare a string against a number.
- Anything this would have done has been commented out, so it does nothing.
- Calling ToString on a string (which I think might even throw a null reference exception if the original string is null)... four times.
- Comparing strings without ignoring case.
- The commented out code (not shown) would have caused a compiler error too (attempt to divide a string by a number).
- Hungarian notation.
Can I cry yet?
|
|
|
|
|
And to top it all off, someone wrote it in VB!
|
|
|
|
|
AspDotNetDev wrote: If strBroswerVersion < 9 Then
Man i cant imagine anything which has to be done in order to see something working as it should be on IE
|
|
|
|
|
You should see some of the crap *wonderful* third-party VB code I've been asked to help with!
Here's a typical example:
Public Shared Function GetBitNr(ByVal TestInteger As Integer, ByVal Nr As Integer) As Integer
If TestInteger < 0 Then
If Nr = 32 Then
Return 1
End If
TestInteger = TestInteger + CInt(&H80000000)
End If
Dim i As Long = 30
Dim str As String = ""
Do While (i > -1)
If 2 ^ i <= TestInteger Then
str = str & "1"
TestInteger = CInt(Math.Round(TestInteger - 2 ^ i))
ElseIf Left(str, 1) = "1" Then
str = str & "0"
End If
i = i - 1
Loop
Dim result As Integer
If Len(str) >= Nr Then
result = CInt(Mid(str, Len(str) - Nr + 1, 1))
Else
result = 0
End If
Return CInt(result)
End Function
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Richard Deeming wrote: CInt(&H80000000)
Probably i should not ask but from pure curiosity: What is this ?
|
|
|
|
|
&H is VB prefix for Hex constant: so &H100 is 256, &H200 is 512, and so forth.
So it's converting a 32 bit hexadecimal integer constant value to a 32 bit integer value...
The universe is composed of electrons, neutrons, protons and......morons. (ThePhantomUpvoter)
|
|
|
|