The Blind Spot
-
I was trying to debug some horrible VBScript and just wanted to be done with it so I could get back to the world of compiled languages but for the life of me could not get past this:
Set Connection = CreateOpenConnection
if not Connection is nothing Then Exit Function
DoSomeWorkThe database connection was being created correctly, it was opening the connection, it could see the tables and read the data. But the call to
DoSomeWork
was never happening. And then I realised that when you copy code fromif not Connection is nothing Then
...Do some workthen you may, just may want to remove the
not
. There's 45 mins of my life I'll never get back :doh: I think the quality of my code is inversely proportional to my distaste of the language.cheers, Chris Maunder
CodeProject.com : C++ MVP
-
I was trying to debug some horrible VBScript and just wanted to be done with it so I could get back to the world of compiled languages but for the life of me could not get past this:
Set Connection = CreateOpenConnection
if not Connection is nothing Then Exit Function
DoSomeWorkThe database connection was being created correctly, it was opening the connection, it could see the tables and read the data. But the call to
DoSomeWork
was never happening. And then I realised that when you copy code fromif not Connection is nothing Then
...Do some workthen you may, just may want to remove the
not
. There's 45 mins of my life I'll never get back :doh: I think the quality of my code is inversely proportional to my distaste of the language.cheers, Chris Maunder
CodeProject.com : C++ MVP
Always best to try to explain problems like this to someone who has no idea what you are trying to achieve. That way you HAVE to explain what the code is doing and usually the light switches on :)
I still remember having to write your own code in FORTRAN rather than be a cut and paste merchant being pampered by colour coded Intellisense - ahh proper programming - those were the days :)
-
Always best to try to explain problems like this to someone who has no idea what you are trying to achieve. That way you HAVE to explain what the code is doing and usually the light switches on :)
I still remember having to write your own code in FORTRAN rather than be a cut and paste merchant being pampered by colour coded Intellisense - ahh proper programming - those were the days :)
Yep. I use my dogs for that at home. Of course, they're blinded by the possibility that they'll get a cookie after my speech, but vocalizing the problem to someone else almost always helps me solve the issue.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001 -
Yep. I use my dogs for that at home. Of course, they're blinded by the possibility that they'll get a cookie after my speech, but vocalizing the problem to someone else almost always helps me solve the issue.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001Dogs! What a brilliant idea! Really. :) I dunno how many times I have asked a work-mate a "stupid" question, and immediately seen the answer myself. Perhaps I should put a pot of flowers on my desk for that purpose, of course if I talk to much to my flowers my mates will start to regard me as potty. Arf Arf
_____________________________________ Action without thought is not action Action without emotion is not life
-
I was trying to debug some horrible VBScript and just wanted to be done with it so I could get back to the world of compiled languages but for the life of me could not get past this:
Set Connection = CreateOpenConnection
if not Connection is nothing Then Exit Function
DoSomeWorkThe database connection was being created correctly, it was opening the connection, it could see the tables and read the data. But the call to
DoSomeWork
was never happening. And then I realised that when you copy code fromif not Connection is nothing Then
...Do some workthen you may, just may want to remove the
not
. There's 45 mins of my life I'll never get back :doh: I think the quality of my code is inversely proportional to my distaste of the language.cheers, Chris Maunder
CodeProject.com : C++ MVP
Chris Maunder wrote:
Set Connection = CreateOpenConnection if not Connection is nothing Then Exit Function DoSomeWork
You should write like that. right?
Set Connection = CreateOpenConnection if Connection is nothing Then Exit Function DoSomeWork
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)
-
Chris Maunder wrote:
Set Connection = CreateOpenConnection if not Connection is nothing Then Exit Function DoSomeWork
You should write like that. right?
Set Connection = CreateOpenConnection if Connection is nothing Then Exit Function DoSomeWork
Thanks and Regards, Michael Sync ( Blog: http://michaelsync.net) If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you. :)
Actually it would be better to do:
Set Connection = CreateOpenConnection
if Not Connection is nothing Then
DoSomeWork
End IfActually it would be better to completely ditch all our legacy VBScript entirely. We're workin' on it ;)
cheers, Chris Maunder
CodeProject.com : C++ MVP
-
I was trying to debug some horrible VBScript and just wanted to be done with it so I could get back to the world of compiled languages but for the life of me could not get past this:
Set Connection = CreateOpenConnection
if not Connection is nothing Then Exit Function
DoSomeWorkThe database connection was being created correctly, it was opening the connection, it could see the tables and read the data. But the call to
DoSomeWork
was never happening. And then I realised that when you copy code fromif not Connection is nothing Then
...Do some workthen you may, just may want to remove the
not
. There's 45 mins of my life I'll never get back :doh: I think the quality of my code is inversely proportional to my distaste of the language.cheers, Chris Maunder
CodeProject.com : C++ MVP
Of course seeing Exit Function should have been the first clue :p When I haven't had a lot of sleep I do manage to write a lot more logic inversion errors.
File Not Found
-
I was trying to debug some horrible VBScript and just wanted to be done with it so I could get back to the world of compiled languages but for the life of me could not get past this:
Set Connection = CreateOpenConnection
if not Connection is nothing Then Exit Function
DoSomeWorkThe database connection was being created correctly, it was opening the connection, it could see the tables and read the data. But the call to
DoSomeWork
was never happening. And then I realised that when you copy code fromif not Connection is nothing Then
...Do some workthen you may, just may want to remove the
not
. There's 45 mins of my life I'll never get back :doh: I think the quality of my code is inversely proportional to my distaste of the language.cheers, Chris Maunder
CodeProject.com : C++ MVP
-
Actually it would be better to do:
Set Connection = CreateOpenConnection
if Not Connection is nothing Then
DoSomeWork
End IfActually it would be better to completely ditch all our legacy VBScript entirely. We're workin' on it ;)
cheers, Chris Maunder
CodeProject.com : C++ MVP
Chris Maunder wrote:
Actually it would be better to completely ditch all our legacy VBScript entirely.
One of the things I like in VB/VBScript is late-binding. Do you also like it or you use it but hate it? Just wondering.
-
Dogs! What a brilliant idea! Really. :) I dunno how many times I have asked a work-mate a "stupid" question, and immediately seen the answer myself. Perhaps I should put a pot of flowers on my desk for that purpose, of course if I talk to much to my flowers my mates will start to regard me as potty. Arf Arf
_____________________________________ Action without thought is not action Action without emotion is not life
megaadam wrote:
regard me as po
Or even gay, for having flowers on your desk in the first place:)
Roger Irrelevant "he's completely hatstand"
-
megaadam wrote:
regard me as po
Or even gay, for having flowers on your desk in the first place:)
Roger Irrelevant "he's completely hatstand"
Good point after all us tough, manly, emotionally positive programmers would not want others to think we are gay or have any appreciation for beauty!:laugh:
You always pass failure on the way to success.
-
megaadam wrote:
regard me as po
Or even gay, for having flowers on your desk in the first place:)
Roger Irrelevant "he's completely hatstand"
norm .net wrote:
r even gay, for having flowers on your desk in the first place:)
Na, make it a Venus Fly Trap. Call it Butch. No one will think you're gay. A little off maybe, but not gay...
-
norm .net wrote:
r even gay, for having flowers on your desk in the first place:)
Na, make it a Venus Fly Trap. Call it Butch. No one will think you're gay. A little off maybe, but not gay...