5 ms·
This is probably the cleanest VB 6 I've seen. Do notice Option Explicit. That is like disabling 90% of the magic that causes unmaintainable code.
by WirelessGigabit 3y ago
This is probably the cleanest VB 6 I've seen.
Do notice Option Explicit. That is like disabling 90% of the magic that causes unmaintainable code.
- starik36 3y agoThe IDE has a setting to always turn it on for new projects. That was a setting I always enabled on new installs. Along with a switch to use SDI instead of MDI.
- fps_doug 3y ago> Along with a switch to use SDI instead of MDI. You monster!
- dark-star 3y agoWait till you find the assembly code hidden in a list of hex numbers that gets copied to a function and then called as a thunk ;-)
- rbanffy 3y agoI remember the feeling when you see a module and it has an "On Error Resume Next" at the start.
- layer8 3y agoThat’s basically how shell scripts behave by default. At least in VB it’s not the default.
- rbanffy 3y agoYes, but shell scripts are written on that assumption. VB code usually wasn’t.
- Symbiote 3y agoIn my first job, I was given a VB6 project to maintain which had a mixture of "Option Base 1" and "Option Base 0" (or unspecified, this being the default), with occasional "On Error Resume Next". This specifies the index value for the first item in an array, i.e. you could choose the default European building floors (ground floor is 0) or American floors (ground floor is 1) -- per module! I had to convert everything to "Option Base 0" before I could start fixing the reported bugs, it was far too confusing following the arrays passed between modules being indexed starting at 0, then 1, then 0 etc.
- stormdennis 3y agoWould not the UBound and LBound functions not solved those issues?
- Symbiote 3y agoYes, though I didn't know they existed. The existing code was written with 0 or 1 as required (except where there were bugs), and frankly I think it's was better anyway to use 0 everywhere rather than LBound(x).
- 29athrowaway 3y agoI wish I had known this back in the day.