Page 1 of 1 1
Topic Options
#34523 - 2002-12-18 10:58 PM Label not found! ????
NuclearKitten Offline
Fresh Scripter

Registered: 2002-11-14
Posts: 47
Why am I getting "Script error: Label [SophMissing] not found!" when the label is just a couple lines down? Any ideas?
code:
 
:win9x
$IcMon = READVALUE("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run", "InterCheckMonitor")
if @error
goto "SophMissing"
if $IcMon = ""C:\\PROGRAM FILES\\SOPHOS SWEEP\\ICMON.EXE\" -minimised""
goto "Chk9xFiles"
endif
endif
:Chk9xFiles
IF EXIST ("C:\Program Files\Sophos SWEEP\ICMON.exe")
GOTO "Sophos_IS_INSTALLED"
else GOTO "chkd"
endif
:chkd
IF EXIST ("D:\Program Files\Sophos SWEEP\ICMON.exe")
GOTO "Sophos_IS_INSTALLED"
else GOTO "chke"
endif
:chke
IF EXIST ("E:\Program Files\Sophos SWEEP\ICMON.exe")
GOTO "Sophos_IS_INSTALLED"
endif

:SophMissing

TIA!

Top
#34524 - 2002-12-18 11:03 PM Re: Label not found! ????
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Please rewrite your code so that you do not use GOTO. GOTO is bad! And in case you wonder why, there's been a thread discussing the disadvantages of GOTO, use the BBS Search to retrieve that thread.

Your code can be easily rewritten in such a way that it does not require GOTOs.
_________________________
There are two types of vessels, submarines and targets.

Top
#34525 - 2002-12-18 11:12 PM Re: Label not found! ????
ElegantSol Offline
Fresh Scripter

Registered: 2002-11-28
Posts: 34
Loc: Cranbury, NJ, USA
Look at the line:

""C:\\PROGRAM FILES\\SOPHOS SWEEP\\ICMON.EXE\" -minimised""

"C:\\PROGRAM FILES\\SOPHOS SWEEP\\ICMON.EXE\ -minimised"

I believe is what you want.

Double \ and " are not required in strings or if they are " xxx 'yyyy' xxx" is appropriate.
_________________________
Stephen If the solution to the problem be concise and artfully or ingeniously contrived yet simple and handsome in effect, then the solution merits the adjective elegant. -- K.G. Wilson

Top
#34526 - 2002-12-18 11:20 PM Re: Label not found! ????
NuclearKitten Offline
Fresh Scripter

Registered: 2002-11-14
Posts: 47
The value in the registry has quotation marks. That portion of the script is working.

SL - I have searched for that thread and can't seem to find it.

Top
#34527 - 2002-12-18 11:24 PM Re: Label not found! ????
ElegantSol Offline
Fresh Scripter

Registered: 2002-11-28
Posts: 34
Loc: Cranbury, NJ, USA
If the value in the registry has "" use ' ' to surround the string. I changed the quotes and the error went away.

Steve
_________________________
Stephen If the solution to the problem be concise and artfully or ingeniously contrived yet simple and handsome in effect, then the solution merits the adjective elegant. -- K.G. Wilson

Top
#34528 - 2002-12-18 11:25 PM Re: Label not found! ????
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
See the FAQ Forum under Proper use of quotes for tips using single/double quotes.
_________________________
There are two types of vessels, submarines and targets.

Top
#34529 - 2002-12-18 11:27 PM Re: Label not found! ????
NuclearKitten Offline
Fresh Scripter

Registered: 2002-11-14
Posts: 47
danke - SL, I found the thread. Thanks.
Top
#34530 - 2002-12-19 09:54 PM Re: Label not found! ????
MCA Offline
KiX Supporter
*****

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

With our tool kixstrip which you can find on our site
you can verify your kixtart code.
After the call kixstrip input.kix output.kix /block_check
which returns
code:
:win9x
$icmon = READVALUE("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run", "InterCheckMonitor")
IF @error
GOTO "SophMissing"
IF $icmon = ""C:\\PROGRAM FILES\\SOPHOS SWEEP\\ICMON.EXE\" -minimised""
GOTO "Chk9xFiles"
ENDIF
ENDIF
:chk9xfiles
IF EXIST ("C:\Program Files\Sophos SWEEP\ICMON.exe")
GOTO "Sophos_IS_INSTALLED"
ELSE
GOTO "chkd"
ENDIF
:chkd
IF EXIST ("D:\Program Files\Sophos SWEEP\ICMON.exe")
GOTO "Sophos_IS_INSTALLED"
ELSE
GOTO "chke"
ENDIF
:chke
IF EXIST ("E:\Program Files\Sophos SWEEP\ICMON.exe")
GOTO "Sophos_IS_INSTALLED"
ENDIF

:sophmissing


;($begin)
;
; thu 19-dec-2002 09:32:07 (kix 4.10 vs 3.20e)
;
;Summary KIXSTRIP: block structures
; - do:until [0:0]
; - for|each:in|to:step|next [0|0:0|0:0|0]
; - function:endfunction [0:0]
; - if:else:endif [5:2:5]
; - select:case:endselect [0:0:0]
; - while:loop [0:0]
;Warning KIXSTRIP: 1 line is incompleted.
; rerun program with option "/block_check /show_errors".
;Warning KIXSTRIP: some lines contains errors or possible errors.
; 1 line incomplete "double quotation".
; 1 line incompleted.
;Informative KIXSTRIP: 5 block_structures found.
;Informative KIXSTRIP: no UDF's found.
;Informative KIXSTRIP: 5 labels found.
;Summary KIXSTRIP: BREAK CALL DEBUG DISPLAY ENDFUNCTION EXECUTE EXIT FUNCTION GET GETS GOSUB GOTO OLExxx PLAY QUIT RETURN RUN SHELL SLEEP THEN USE
;Informative KIXSTRIP: 7 GOTO
;
;($end)
;($begin)
;
;Warning KIXSTRIP: 5 line incomplete "double quotation".
;Warning KIXSTRIP: 5 line incompleted.
;
;($end)

Your 5th line should be something like
code:
       IF $icmon = '"C:\\PROGRAM FILES\\SOPHOS SWEEP\\ICMON.EXE\" -minimised'

A reduction of your code can result in following script
code:
 $sophos_installed="yes"
$icmon = READVALUE("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run", "InterCheckMonitor")
IF (Len($icmon) <> 0)
IF (Instr($icmon,"ICMON.EXE") <> 0) AND (Instr($icmon,"-minimised") <> 0)
IF (Exist("C:\Program Files\Sophos SWEEP\icmon.exe") = 0) AND
(Exist("D:\Program Files\Sophos SWEEP\icmon.exe") = 0) AND
(Exist("E:\Program Files\Sophos SWEEP\icmon.exe") = 0)
$sophos_installed="no"
ENDIF
ELSE
$sophos_installed="no"
ENDIF
ELSE
$sophos_installed="no"
ENDIF
IF ($sophos_installed = "no")
? "Informative SOPHOS: not installed"
ELSE
? "Warning SOPHOS: not installed"
ENDIF

greetings.

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:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 837 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.133 seconds in which 0.012 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