I have a script that worked on one PC and not another. (It was compiled) So I moved the script to the PC where it failed and installed MS and addressed the issue (or so I thought).
Now it works when I step through it but not when it is just run. There is no need for the wait command in it. I have placed message boxes in it to pause the script where I had breakpoints and it made no difference.
Does anyone have any ideas I have been looking at it for hours and gettting no where. The script itself has run for a couple of years before a small change (I changed a path).
So, does anyone know of any differences of running a script and stepping through it.
Problem debugging
Moderators: JRL, Dorian (MJT support)
One difference.................Timing.So, does anyone know of any differences of running a script and stepping through it.
I understand your situation and you may not want to post your code.
How about some more clues. What fails? What is the path for? Is a file being created/moved/deleted near the point of script failure?
Since you only made a small change. Make a copy of your correctly working backup copy of this script (prior to the small change), Make sure it really works on this second PC, then make the small change again. I know I sometimes manage to perform alterations in places where I didn't intend to make them.
stepping through while debugging
Thanks for the reply, I thought timing was the only issue as well. However, now I am not so sure. The code is over 600 lines and it is just to create an ini file. (that's why I didn't post it - to much and to many dependicies). One part of it updates drop down lists based on an ini file. The user selects an ini file, it reads and parses a text file and updates the list boxes. Anyway, the issue appears to be one of case sensitivity.
One of the paths contained edocfile and there was a string replacement of eDocfile. I fixed this and still had issues and then I noticed there was a line in it that matched two strings. When stepping though manually it worked with the strings not matching (the "d" was not correct as there was a capital "D"). When run it failed, easy enough to fix - used Upper function to make both strings upper case.
One of the paths contained edocfile and there was a string replacement of eDocfile. I fixed this and still had issues and then I noticed there was a line in it that matched two strings. When stepping though manually it worked with the strings not matching (the "d" was not correct as there was a capital "D"). When run it failed, easy enough to fix - used Upper function to make both strings upper case.
- Bob Hansen
- Automation Wizard
- Posts: 2475
- Joined: Tue Sep 24, 2002 3:47 am
- Location: Salem, New Hampshire, US
- Contact:
It will probably be best to include those portions of the script that seem to be causing the problem. Visual aides are very helpful here. Duplicating actual script on systems is best for us to help.
To help troubleshoot, can you use Block Comments to eliminate big sections of code to help isolate the lines with problems? Block out 90% of the code, then progressively make the commented blocks smaller until you find the bad section.
To help troubleshoot, can you use Block Comments to eliminate big sections of code to help isolate the lines with problems? Block out 90% of the code, then progressively make the commented blocks smaller until you find the bad section.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!
Bob
A humble man and PROUD of it!