Live syntax checking doesn't highlight undeclared variables as you had said it would. Is this something that needs to be turned on?
It would also be useful if the bad syntax highlight could give you a clue as to what is wrong with a tool-tip or a note in the debug/ouptut window for example.
Live syntax checking
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- Alexander Riedel
- Posts: 8478
- Last visit: Tue Mar 26, 2024 8:52 am
- Been upvoted: 37 times
Live syntax checking
There is a tooltip if the VBScript engine tells us what's wrong, just hover over the line with the underline.
As for undeclared variables, do you use option explicit in your scripts?
Alex
As for undeclared variables, do you use option explicit in your scripts?
Alex
Alexander Riedel
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
- Russ Pitcher
- Posts: 107
- Last visit: Tue Jul 11, 2023 12:38 am
Live syntax checking
OK, I'll try it again and hover for longer.
I had option explicit enabled (it's in my vbscript template) but it's not the very first line in the script. I have some commented lines at the top to provide file info. does this make a difference?
Russ
I had option explicit enabled (it's in my vbscript template) but it's not the very first line in the script. I have some commented lines at the top to provide file info. does this make a difference?
Russ
- Alexander Riedel
- Posts: 8478
- Last visit: Tue Mar 26, 2024 8:52 am
- Been upvoted: 37 times
- Russ Pitcher
- Posts: 107
- Last visit: Tue Jul 11, 2023 12:38 am
Live syntax checking
You were right about the tool-tip. It comes up pretty quickly on my home PC
[I guess my work laptop's slower than I though ]
Here's a simple script that doesn't show the undeclared variable.
'===========================' NAME : Example script' DATE : 15/11/2006'==========================Option Explicit
For variable = 1 To 5 WScript.Echo variableNext
This returns the error
D:Scripts!LibrarySavvisUntitled3.vbs(11, 1) Microsoft VBScript runtime error: Variable is undefined: 'variable'Exit code: 0 , 0000h
[I guess my work laptop's slower than I though ]
Here's a simple script that doesn't show the undeclared variable.
'===========================' NAME : Example script' DATE : 15/11/2006'==========================Option Explicit
For variable = 1 To 5 WScript.Echo variableNext
This returns the error
D:Scripts!LibrarySavvisUntitled3.vbs(11, 1) Microsoft VBScript runtime error: Variable is undefined: 'variable'Exit code: 0 , 0000h