Link to home
Start Free TrialLog in
Avatar of novice12
novice12

asked on

VBscript syntax check


Is it possile to do a syntax check on a VBscripts ".vbs". I want to be able to check for syntax errors before actaually executing the script.
I know that scripts don't get compiled, so how would you check for syntax problems?  I guess you need some sort of an interpreter?

I don't want to use the script debugger, becuase it will execute the script, right?.  Even though you have the option of stepping through and putting break points....etc, the script will execute.

Before intsalling the script (which does office automation), I want to make sure that it doesn't crash because there is an "If" that does not have and "end if" as an example.

Don't worry I am exeperimenting with an offline machine, so I can not potentially cause damage!!

Sounds simple, but I am a newbie to scripting.

Thanks

ASKER CERTIFIED SOLUTION
Avatar of willcode4coffee
willcode4coffee

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of novice12
novice12

ASKER


You are telling me that I have to run it, in order for it to do the error check in general.

Not very practical if I have a code consisting of hundreds of lines!. I just don't want to install it until I at least know there is no sytax errors.

I guess there is no way to do this!.

Thanks
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial

Oops!!
Sorry about that, I think I have asked a silly question!

When I said that the line count is high, I was trying to say that it would take some time to review the syntax manually. But you are right it's irrelevant.

I will just run the script in debug mode, after making sure that the machine is completely isolated from the network. I will get errors on network drives mapping (part of the script), but I can skip through using the debugger....


Thanks