Compiling error asking for ; already there? 
Author Message
 Compiling error asking for ; already there?

Hi, can any help

I have written a 2 line jscript based on an earlier posting by
Jason Fox 'automate rasphone' code below. When I try to run it
it says: Script Execution Error, Expected ';'

However I have played around with putting ';' in and it still doesn't work.

Quote:
> Set WshShell = Wscript.CreateObject("Wscript.Shell");
> Return = WshShell.Run("c:\zips\raswin.exe",1,TRUE);

cheers

Heather



Mon, 07 May 2001 03:00:00 GMT  
 Compiling error asking for ; already there?
This is VBScript syntax. (nice and simple to read, which is why I stick with
VBScript)
Regards,
Ian
WSH FAQ (VBScript only here) http://wsh.glazier.co.nz/frame.htm
Quote:

>Hi, can any help

>I have written a 2 line jscript based on an earlier posting by
>Jason Fox 'automate rasphone' code below. When I try to run it
>it says: Script Execution Error, Expected ';'

>However I have played around with putting ';' in and it still doesn't work.

>> Set WshShell = Wscript.CreateObject("Wscript.Shell");
>> Return = WshShell.Run("c:\zips\raswin.exe",1,TRUE);

>cheers

>Heather



Tue, 08 May 2001 03:00:00 GMT  
 Compiling error asking for ; already there?
<< I have written a 2 line jscript  >>

When you switch from VBScript to JScript, several things happen:

1. You signal your intent to learn portable coding that has a future, and
2. Certain syntax requirements change. For example:

Return = WshShell.Run("c:\zips\raswin.exe",1,TRUE);

must instead be:

Return = WshShell.Run("c:\\zips\\raswin.exe",1,TRUE);

(among other things)

This is calles "escaping" a character, in this case you want to use the
special escape character '\' itself as a literal character. You may say
"this is more complicated!" -- you will continue to believe this until you
discover how easy it is to put anything in a JScript string, and how
difficult you will find it to put up with VBScript afterward.

Also -- avoid using words like "Return" as variable names. This word has a
meaning to the language and the habit will eventually get you into trouble,
even though this particular example won't.

Paul Lutus

Quote:

>Hi, can any help

>I have written a 2 line jscript based on an earlier posting by
>Jason Fox 'automate rasphone' code below. When I try to run it
>it says: Script Execution Error, Expected ';'

>However I have played around with putting ';' in and it still doesn't work.

>> Set WshShell = Wscript.CreateObject("Wscript.Shell");
>> Return = WshShell.Run("c:\zips\raswin.exe",1,TRUE);

>cheers

>Heather



Wed, 09 May 2001 03:00:00 GMT  
 Compiling error asking for ; already there?
JScript seems to be a bit more picky, when it comes to case. Try modifying
the first line of your code to capitalize the S of WScript as follows:

Set WshShell = WScript.CreateObject("WScript.Shell");

NOTE: The case was changed in two places !

Cheers,

---
Harjit S. Batra

Quote:

>Hi, can any help

>I have written a 2 line jscript based on an earlier posting by
>Jason Fox 'automate rasphone' code below. When I try to run it
>it says: Script Execution Error, Expected ';'

>However I have played around with putting ';' in and it still doesn't work.

>> Set WshShell = Wscript.CreateObject("Wscript.Shell");
>> Return = WshShell.Run("c:\zips\raswin.exe",1,TRUE);

>cheers

>Heather



Wed, 09 May 2001 03:00:00 GMT  
 Compiling error asking for ; already there?
JScript doesn't have a "Set" command.  As a previous post suggested, Wscript
should be WScript.  I also changed TRUE to 1.

The following worked for me.

WshShell   = WScript.CreateObject("Wscript.Shell");
Return = WshShell.Run("c:\zips\raswin.exe", 1, 1);

Quote:

>Hi, can any help

>I have written a 2 line jscript based on an earlier posting by
>Jason Fox 'automate rasphone' code below. When I try to run it
>it says: Script Execution Error, Expected ';'

>However I have played around with putting ';' in and it still doesn't work.

>> Set WshShell = Wscript.CreateObject("Wscript.Shell");
>> Return = WshShell.Run("c:\zips\raswin.exe",1,TRUE);

>cheers

>Heather



Tue, 15 May 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Name already exists error on map drive.

2. Name already exists error trying to map drive.

3. Error using ADO, file already in use;

4. Ghostscript 5.10 compile error

5. Error Compiling GS8.00

6. Ghostscript compiling problem (STDDIRS error)

7. Ghostscript 7.03 compiling error

8. Please help-ghostscript compiling errors

9. compiling error

10. Need Help on Aladdin Ghostscript Compile Error

11. Memory Error Compiling GhostScript 5.66 under Watcom 10.0

12. error compiling AlladinGhostscript 5.10, Digital AXP DU4.0

 

 
Powered by phpBB® Forum Software