Page 1 of 1 1
Topic Options
#71096 - 2002-10-24 11:49 AM Script error: Invalid method
zdarma Offline
Getting the hang of it

Registered: 2002-10-08
Posts: 83
I've written a script that verifies if certain applications or shortcuts exist on a user's machine. However, I keep getting the following error when I run my script.

Script error: invalid method/function call: missing ')'!

I don't see where it wants me to add another ')' I've even tried to add another set of () at both the start and end of the directory path, but I still get the same error.

I have other lines of code that are similar, but they verify if a folder exists and I get no problem. The only real diffrence between the lines checking for a folder and one checking for a shortcut is that the folder check points to \\$postes\c$\..... while the one for the shortcut as you can see below points to \\$postes\admin$\...

I've read in other postings that I may have to use the double $$, but I tried that and it still gives me the same error message.

Does anyone have any ideas?

This is what I see in my logfile :

code:
Script error: invalid method/function call: missing ')'!
IF EXIST ("\\$postes\admin$\profiles\all users\menu démarrer\programmes\dossier\appli.lnk") GOSUB APPLI ENDIF

Thanks in advance,
Ian

Top
#71097 - 2002-10-25 12:02 AM Re: Script error: Invalid method
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Sometimes the error trapping in Kixtart is not that reliable , I'd bet the House that you miss a quotation in the line before the one in question [Big Grin]
_________________________



Top
#71098 - 2002-10-25 12:18 AM Re: Script error: Invalid method
zdarma Offline
Getting the hang of it

Registered: 2002-10-08
Posts: 83
Holy Cow!!! You hit the nail right on the head. A little closer look at my script did show me that I was missing a " in a previous line. Thanks for that, but I have another problem that appears, now that I got by that one.

I have several GOSUBs depending on the existence of certain Folders or Links. However, one of them keeps telling me that the LABEL does not exist and returns a script error in my log file. I have checked, double checked and even triple checked to make sure the label exists. I even copied the name of the label to the gosub area and I still get the same error. I've renamed it and it keeps telling me it doesn't exist.

Any ideas?

Thx,
Ian

Top
#71099 - 2002-10-25 12:23 AM Re: Script error: Invalid method
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Well,

hmm ... can it be that your label contains spaces ?
_________________________



Top
#71100 - 2002-10-25 12:24 AM Re: Script error: Invalid method
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
If not .. let us see what you have [Wink]
_________________________



Top
#71101 - 2002-10-25 12:47 AM Re: Script error: Invalid method
zdarma Offline
Getting the hang of it

Registered: 2002-10-08
Posts: 83
I checked for additional spaces already and I couldn't find any.

There are actually 12 different GOSUB routines, but I've included the last two, because all the others I tested give me the same error. [Mad]

code:
IF EXIST ("\\$postes\c$\Reuters") GOSUB KOBRA ENDIF
IF EXIST ("\\$postes\c$\database\glw483") GOSUB GL ENDIF
GOTO LES_INFOTXT
;
;********************************* Les GOSUBs *********************************
;
:GL
? "GL existe sur le poste "+$postes
RETURN

:KOBRA
? "Reuters existe sur le poste "+$postes
RETURN
;
;******************** Diffusion des informations collectioné ******************
;
:LES_INFOTXT
? "$user,$postes,$sp,$processor,$espace,$internet"

Thx again in advance,
Ian

Top
#71102 - 2002-10-25 12:55 AM Re: Script error: Invalid method
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Most "Label not found" errors are a result of a missing quote before the missing label.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#71103 - 2002-10-24 01:06 PM Re: Script error: Invalid method
zdarma Offline
Getting the hang of it

Registered: 2002-10-08
Posts: 83
If by missing a quote before the label you mean the :

I already checked if they all had one and they do. Any other ideas?

Top
#71104 - 2002-10-24 01:19 PM Re: Script error: Invalid method
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
z,

the snippet you posted looks ok ... I concur to Howards statement about the missing quote,
you might want to run your code against MCA's syntax checker (kixstrip) available here : http://home.wanadoo.nl/scripting

Jochen

{edit}
No, Howard meant another ' or "
{/edit}

[ 24. October 2002, 13:28: Message edited by: jpols ]
_________________________



Top
#71105 - 2002-10-24 02:42 PM Re: Script error: Invalid method
Waltz Offline
Seasoned Scripter

Registered: 2002-08-01
Posts: 485
Loc: Waterloo, Ontario, Canada
Wild suggestion...
Try it with your gosub label in "" as in
GOSUB "KOBRA"
_________________________
We all live in a Yellow Subroutine...

Top
#71106 - 2002-10-24 03:13 PM Re: Script error: Invalid method
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Give kiXStrip a try, this utility parses KiXtart code and checks for all kinds of syntax problems. Get it here: http://home.wanadoo.nl/scripting/

BTW, this utility would have found the missing quote [Wink]

Oops: Jochen already posted the link, didn't read his post carefully enough.

[ 24. October 2002, 15:14: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#71107 - 2002-10-24 03:14 PM Re: Script error: Invalid method
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
have you tried putting the same " ... " as comment just before the erroring line to see what kix sees in it?
_________________________
!

download KiXnet

Top
#71108 - 2002-12-10 05:22 PM Re: Script error: Invalid method
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

To see which labels exist and who reference them see our tool kixref, which
you can find on our site.
For a quick view use the call kixref input.kix output.txt /warnings

With the kixstrip tool you can find indeed all kind of mistypings. Documenta-
tion is also available. The file kixstrip.pdf can be find on our site too.

For a fast way of cheking you code insert as first line
code:
 GOTO checking_our_script

and add as last lines
code:
 :checking_our_script
? "fast verification completed"

To see what is going wrong during execution you can use the kixstrip too.
With the call kixstrip input.kix output.kix /debug additional code will be inserted,
which will show during execution
- which lines were executed
- what was the error status
- how much time did it consume
etc.
greetings.

BTW: GOSUB and GOTO doesn't need quotations.

btw: symbol  - on our homepage has been linked to related http://kixtart.org topic.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (StuTheCoder) and 798 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.062 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org