Compile/Check script allowing errors

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 16 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
fubarinsfo
Posts: 5
Last visit: Thu Jan 31, 2008 8:51 am

Compile/Check script allowing errors

Post by fubarinsfo »

Hi:

I'm a bit unclear on why PS is passing scripts through Compile/Check script only to have them fail on execution.

For instance, I can specify Option Explicit, then use an undimensioned variable in an expression as here:

x = "hello"

and PS will pass it without error. On execution, Windows Script Host Version 5.6 will kick it out with the error "Microsoft VBScript runtime error: Variable is undefined: 'x'"

Is this considered normal?

Thanks in advance for your help.

Using PrimalScript v4.0.481, Windows XP SP2.
User avatar
fubarinsfo
Posts: 5
Last visit: Thu Jan 31, 2008 8:51 am

Compile/Check script allowing errors

Post by fubarinsfo »

?? Why would I do that? I want Option Explicit.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Compile/Check script allowing errors

Post by jvierra »

Then you must explicitly define all variables before using them.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Compile/Check script allowing errors

Post by jvierra »

iF ps is not working you should post in teh PS support forum. My copy of PS doesn't seem to work that way (4.1).
User avatar
Alexander Riedel
Posts: 8488
Last visit: Tue Apr 16, 2024 8:42 am
Answers: 20
Been upvoted: 37 times

Compile/Check script allowing errors

Post by Alexander Riedel »

The option for Ctrl+F7 can be set for any language under Tools - Options - Languages and by setting a command line tool for the appropriate language.
Some languages have compilers, others have syntax checkers.
If this option is enabled for you and VBScript, something is configured at this location.

If you post over in the PrimalScript support forum I am sure we can figure out what happened.

Alex
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 16 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked