Return of an old friend
-
I know I posted an example of this a while ago, but here's another classic example, and I thought some of the other bits in this snippet may amuse you ...
For j = 1 To k char = UCase(Mid$(myField, j, 1)) If InStr(delims, char) <> 0 Then If i <> j Then buffer = Mid$(myField, i, j - i) GoSub addIndex ' Nooooooooooooooooooooooooooooooooooooooo End If i = j + 1 End If Next j If i <> j Then buffer = Mid$(myField, i, j - i) GoSub addIndex End If
a bit later in the same routine...
addIndex:
If IsNull(buffer) Then Return buffer = Left$(Trim$(buffer), 20) If Len(buffer) = 0 Then Return wordnum = libWordNo(Trim(utilRemoveCrap(buffer))) If wordnum = 0 Then Return If InStr(wordsNow, ";" & CStr(wordnum) & ";") = 0 Then wordsNow = wordsNow & CStr(wordnum) & ";" End If If InStr(wordsThen, ";" & CStr(wordnum) & ";") <> 0 Then Return retSet.AddNew retSet!\[AccountNumber\] = recSet!\[AccountNumber\] retSet!\[recordNumber\] = recNum retSet!\[wordNo\] = wordnum retSet.Update Return
I should also mention that there's a variable in the same routine called wordNo, and one called wordNum. Classy stuff. That dull thudding you can hear in the distance is my head banging against the desk.
-
I know I posted an example of this a while ago, but here's another classic example, and I thought some of the other bits in this snippet may amuse you ...
For j = 1 To k char = UCase(Mid$(myField, j, 1)) If InStr(delims, char) <> 0 Then If i <> j Then buffer = Mid$(myField, i, j - i) GoSub addIndex ' Nooooooooooooooooooooooooooooooooooooooo End If i = j + 1 End If Next j If i <> j Then buffer = Mid$(myField, i, j - i) GoSub addIndex End If
a bit later in the same routine...
addIndex:
If IsNull(buffer) Then Return buffer = Left$(Trim$(buffer), 20) If Len(buffer) = 0 Then Return wordnum = libWordNo(Trim(utilRemoveCrap(buffer))) If wordnum = 0 Then Return If InStr(wordsNow, ";" & CStr(wordnum) & ";") = 0 Then wordsNow = wordsNow & CStr(wordnum) & ";" End If If InStr(wordsThen, ";" & CStr(wordnum) & ";") <> 0 Then Return retSet.AddNew retSet!\[AccountNumber\] = recSet!\[AccountNumber\] retSet!\[recordNumber\] = recNum retSet!\[wordNo\] = wordnum retSet.Update Return
I should also mention that there's a variable in the same routine called wordNo, and one called wordNum. Classy stuff. That dull thudding you can hear in the distance is my head banging against the desk.
wordNo is probably a boolean. If the buffer contents are an actual word, then wordNo contains false. But if the buffer contetns are not a word, then wordNo contains true. wordNum is what happens to you after reading all this code. My brain is now num(b). :cool:
Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
-
I know I posted an example of this a while ago, but here's another classic example, and I thought some of the other bits in this snippet may amuse you ...
For j = 1 To k char = UCase(Mid$(myField, j, 1)) If InStr(delims, char) <> 0 Then If i <> j Then buffer = Mid$(myField, i, j - i) GoSub addIndex ' Nooooooooooooooooooooooooooooooooooooooo End If i = j + 1 End If Next j If i <> j Then buffer = Mid$(myField, i, j - i) GoSub addIndex End If
a bit later in the same routine...
addIndex:
If IsNull(buffer) Then Return buffer = Left$(Trim$(buffer), 20) If Len(buffer) = 0 Then Return wordnum = libWordNo(Trim(utilRemoveCrap(buffer))) If wordnum = 0 Then Return If InStr(wordsNow, ";" & CStr(wordnum) & ";") = 0 Then wordsNow = wordsNow & CStr(wordnum) & ";" End If If InStr(wordsThen, ";" & CStr(wordnum) & ";") <> 0 Then Return retSet.AddNew retSet!\[AccountNumber\] = recSet!\[AccountNumber\] retSet!\[recordNumber\] = recNum retSet!\[wordNo\] = wordnum retSet.Update Return
I should also mention that there's a variable in the same routine called wordNo, and one called wordNum. Classy stuff. That dull thudding you can hear in the distance is my head banging against the desk.
I've devised a new technique for dealing with this kind of code. When el-coder-loco is at lunch, you sneak over and change some tiny part of the code. A plus to a minus, a True to a False, something small. Then they spend the next six months trying to debug the tangled mess that they've created. Keeping them out of your way. -Rd
Hit any user to continue.
-
I've devised a new technique for dealing with this kind of code. When el-coder-loco is at lunch, you sneak over and change some tiny part of the code. A plus to a minus, a True to a False, something small. Then they spend the next six months trying to debug the tangled mess that they've created. Keeping them out of your way. -Rd
Hit any user to continue.
Wow! A fantastic tecnique! :thumbsup:
-
I've devised a new technique for dealing with this kind of code. When el-coder-loco is at lunch, you sneak over and change some tiny part of the code. A plus to a minus, a True to a False, something small. Then they spend the next six months trying to debug the tangled mess that they've created. Keeping them out of your way. -Rd
Hit any user to continue.
-
I've devised a new technique for dealing with this kind of code. When el-coder-loco is at lunch, you sneak over and change some tiny part of the code. A plus to a minus, a True to a False, something small. Then they spend the next six months trying to debug the tangled mess that they've created. Keeping them out of your way. -Rd
Hit any user to continue.
A great suggestion, but as he retired a while ago... At least I have the good sense to clear up after me
-
A great suggestion, but as he retired a while ago... At least I have the good sense to clear up after me
Rob Grainger wrote:
but as he retired a while ago...
Let that not be an obstacle. A banana in a tailpipe can give a guy many days of debugging fun. Childish? perhaps, but you'll feel better. -Rd
Hit any user to continue.