#27652 - 2002-08-23 12:07 AM
GOSUB probs....
|
Jayb
Fresh Scripter
Registered: 2002-08-23
Posts: 5
Loc: Indiana
|
Kix 4.11 RC 1 In the code below, I cannot get it to jump to the middle (testie6) label. Any help appreciated.
$ServPk = readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion","CSDVersion") IF $ServPk = "Service Pack 2" ? "Service Pack 2 installed." GOSUB testie6 Else shell '%COMSPEC% /c \\serv4\it$$\Install\ServicePacks\Win2kSP2\i386\update\update.exe /u /f /n endif
:testie6 IF EXIST ("c:\program files\Internet explorer\custom\inetset.inf") ? "IE6 Already installed" GOSUB end ELSE shell '%COMSPEC% /c \\serv4\distro\IE6\FLAT\WIN32\EN\ie6setup.exe endif
:end ? "test end" EXIT
|
|
Top
|
|
|
|
#27654 - 2002-08-23 12:28 AM
Re: GOSUB probs....
|
Jayb
Fresh Scripter
Registered: 2002-08-23
Posts: 5
Loc: Indiana
|
I knew it wasn't getting there because i got a label error, plus when I added in a text display, it wasn't coming up. Fixed it, I didn't have the ' at the end of my shell calls. Thanks.
|
|
Top
|
|
|
|
#27657 - 2002-08-23 04:27 AM
Re: GOSUB probs....
|
Jayb
Fresh Scripter
Registered: 2002-08-23
Posts: 5
Loc: Indiana
|
yea, glad I found it, of course it had to happen after I made a post about it.
Yea, I'm aware that they require admin priveleges, also aware of the ie6 admin kit, you can tell it's pointing to an area holding a custom build. You are right, of course, I used the GOSUB because the GOTO wasn't working. Now I know why. Your example obviously looks much cleaner, I will try not using the goto, and simply use the IF. I assumed that I needed it to skip the install line if it found it was already done, that's why I was using the label jumps. Thanks.
|
|
Top
|
|
|
|
#27658 - 2002-12-03 06:01 AM
Re: GOSUB probs....
|
MCA
KiX Supporter
   
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear,
With our tool kixstrip which you can find on our site it is very easily to find f.e. missing quotations. Documentation is also available.
After our call: kixstrip input.kix output.kix /block_check
code:
$servpk = readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion","CSDVersion") IF $servpk = "Service Pack 2" ? "Service Pack 2 installed." GOSUB testie6 ELSE SHELL '%COMSPEC% /c \\serv4\it$$\Install\ServicePacks\Win2kSP2\i386\update\update.exe /u /f /n ENDIF
:testie6 IF EXIST ("c:\program files\Internet explorer\custom\inetset.inf") ? "IE6 Already installed" GOSUB end ELSE SHELL '%COMSPEC% /c \\serv4\distro\IE6\FLAT\WIN32\EN\ie6setup.exe ENDIF
:end ? "test end" EXIT
;($begin) ; ; tue 03-dec-2002 06:02:25 (kix 4.10 vs 3.20e) ; ;Warning KIXSTRIP: 2 lines are incompleted. ; rerun program with option "/block_check /show_errors". ;Warning KIXSTRIP: some lines contains errors or possible errors. ; 2 line incomplete "single quotation". ; 2 line incompleted. ;Informative KIXSTRIP: 2 block_structures found. ;Informative KIXSTRIP: no UDF's found. ;Informative KIXSTRIP: 2 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: 1 EXIT ;Informative KIXSTRIP: 2 GOSUB ;Informative KIXSTRIP: 2 SHELL ; ;($end) ;($begin) ; ;Warning KIXSTRIP: 6, 14 line incomplete "single quotation". ;Warning KIXSTRIP: 6, 14 line incompleted. ; ;($end)
it shows two error situations in your script. In both cases it was related to your SHELL calls. greetings.
btw: symbol on our homepage has been linked to related http://kixtart.org topic.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 837 anonymous users online.
|
|
|