Alphakom
(Lurker)
2002-01-09 03:41 PM
Problems with SELECT CASE

Sometimes in our SELECT CASE Statement the Execution of the Script will Hangup for a few seconds.

We can not find any Failure on the Script.

Who can help us ??

LonkeroAdministrator
(KiX Master Guru)
2002-01-09 06:42 PM
Re: Problems with SELECT CASE

it would be helpfull to see the script...
or uttleast the part that is hanging.
possible 'cause can be a net use/view to drive that isn't available.
but it just a quess when script isn't available.

and, wellcome on board

cheers,

MCA
(KiX Supporter)
2002-01-09 11:46 PM
Re: Problems with SELECT CASE

Dear,

Welcome to the board.

You can modify your script to check at which statement your script stops. See following
information about "how to modify your code".

Question: is debugging possible without user intervention? YES

A way of checking your script is by using our tool kix400strip.exe on our site
http://home.wanadoo.nl/scripting
With the option /debug we add additional kixtart code, which shows

  • which line was executed.
  • what was the time of execution.
  • what was the error status of previous executed line.

So it is possible to catch the error status of kixtart statements during
a logon session.

An example.

For changing your script with debugging code use
f.e. kix400strip input.kix output.kix /debug
Change line.4 of this new script

code:

IF RedirectOutput("")
ENDIF


to f.e.
code:

IF RedirectOutput("c:\kixdebug.log")
ENDIF


and commented all lines with a RedirectOutput statement.
During the execution the information will be append to previous information.
So it is possible to check the differences.

A kixstrip output example of our script os.kix is:

code:

CLS
COLOR C+/N
AT (1,1) " "
IF RedirectOutput("")
ENDIF
? "-"+@date+" "+@time+"- Script "+@kix+" starting."
?"- 1-"+@time+"- @error @serror "? IF setconsole("hide")
?"- 2-"+@time+"- @error @serror "? ENDIF
?"- 3-"+@time+"- @error @serror "? ;
?"- 4-"+@time+"- @error @serror "? ; NT/95 calculates os - Kixtart 3.62, 3.63, 4.00
?"- 5-"+@time+"- @error @serror "? ;
?"- 6-"+@time+"- @error @serror "? ; (c) scripting@wanadoo.nl - 2000, 2001
?"- 7-"+@time+"- @error @serror "? ;
?"- 8-"+@time+"- @error @serror "? ; vs 2.04 - program (calculates OS version with service pack)
?"- 9-"+@time+"- @error @serror "? ;
?"- 10-"+@time+"- @error @serror "? ; 1.00 (20000715) original version
?"- 11-"+@time+"- @error @serror "? ; 2.00 (20010330) - add "windows ME"
?"- 12-"+@time+"- @error @serror "? ; - returns $os + $os_type values
?"- 13-"+@time+"- @error @serror "? ; 2.01 (20010401) - kixtart 2001 beta1 compliancy
?"- 14-"+@time+"- @error @serror "? ; 2.02 (20010405) - remove cutting $os value
?"- 15-"+@time+"- @error @serror "? ; 2.03 (20010701) - add "windows XP beta" + "windows 2000 terminal server"
?"- 16-"+@time+"- @error @serror "? ; (input by NTDOC)
?"- 17-"+@time+"- @error @serror "? ; 2.04 (20010725) - minor fix
?"- 18-"+@time+"- @error @serror "? ;
?"- 19-"+@time+"- @error @serror "? $prgm_version="2.04"
?"- 20-"+@time+"- @error @serror "?
?"- 21-"+@time+"- @error @serror "? IF (@inwin = 1)
?"- 22-"+@time+"- @error @serror "? $nt_mode="yes"
?"- 23-"+@time+"- @error @serror "? ELSE
?"- 24-"+@time+"- @error @serror "? $nt_mode="no"
?"- 25-"+@time+"- @error @serror "? ENDIF
?"- 26-"+@time+"- @error @serror "?
?"- 27-"+@time+"- @error @serror "? $os=""
?"- 28-"+@time+"- @error @serror "? $os_dos=@dos
?"- 29-"+@time+"- @error @serror "? $os_product=ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions","ProductType")
?"- 30-"+@time+"- @error @serror "? $os_productsuite=ReadValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ProductOptions","ProductSuite")
?"- 31-"+@time+"- @error @serror "? $os_service_pack=""
?"- 32-"+@time+"- @error @serror "? $os_subversion=ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion","SubVersionNumber")
?"- 33-"+@time+"- @error @serror "? SELECT
?"- 34-"+@time+"- @error @serror "? CASE
($nt_mode = "yes") AND ($os_product <> "WinNT") AND ($os_dos = "5.1") ; - Windows XP Server
?"- 35-"+@time+"- @error @serror "? $os="XP_Server"
?"- 36-"+@time+"- @error @serror "? CASE
($nt_mode = "yes") AND ($os_product = "WinNT") AND ($os_dos = "5.1") ; - Windows XP Professional
?"- 37-"+@time+"- @error @serror "? $os="XP_Professional"
?"- 38-"+@time+"- @error @serror "? CASE
($nt_mode = "yes") AND ($os_product <> "WinNT") AND ($os_dos = "5.0") ; - Windows 2000 -
?"- 39-"+@time+"- @error @serror "? $os="W2K_Server"
?"- 40-"+@time+"- @error @serror "? CASE
($nt_mode = "yes") AND ($os_product <> "WinNT") AND ($os_dos = "5.0") AND ($os_productsuite = "Enterprise|Terminal Server|") ; - Windows 2K Terminal Server
?"- 41-"+@time+"- @error @serror "? $os="W2K_Terminal_Server"
?"- 42-"+@time+"- @error @serror "? CASE
($nt_mode = "yes") AND ($os_product = "WinNT") AND ($os_dos = "5.0")
?"- 43-"+@time+"- @error @serror "? $os="W2K_Professional"
?"- 44-"+@time+"- @error @serror "? CASE
($nt_mode = "yes") AND ($os_product = "LANMANNT") ; - Windows NT -
?"- 45-"+@time+"- @error @serror "? $os="NT4_Domain_Controller"
?"- 46-"+@time+"- @error @serror "? CASE
($nt_mode = "yes") AND ($os_product = "ServerNT")
?"- 47-"+@time+"- @error @serror "? $os="NT4_Member_Server"
?"- 48-"+@time+"- @error @serror "? CASE
($nt_mode = "yes") AND ($os_product = "WinNT")
?"- 49-"+@time+"- @error @serror "? $os="NT4"
?"- 50-"+@time+"- @error @serror "? CASE
($nt_mode <> "yes") AND (@dos = "4.90")
?"- 51-"+@time+"- @error @serror "? $os="ME"
?"- 52-"+@time+"- @error @serror "? CASE
($nt_mode <> "yes") AND ($os_dos = "4.10") AND (INSTR(LCASE($os_subversion),"c") <> 0) ; - Windows 98 -
?"- 53-"+@time+"- @error @serror "? $os="W98c"
?"- 54-"+@time+"- @error @serror "? CASE
($nt_mode <> "yes") AND ($os_dos = "4.10") AND (INSTR(LCASE($os_subversion),"b") <> 0)
?"- 55-"+@time+"- @error @serror "? $os="W98b"
?"- 56-"+@time+"- @error @serror "? CASE
($nt_mode <> "yes") AND ($os_dos = "4.10") AND (INSTR(LCASE($os_subversion),"a") <> 0)
?"- 57-"+@time+"- @error @serror "? $os="W98a"
?"- 58-"+@time+"- @error @serror "? CASE
($nt_mode <> "yes") AND ($os_dos = "4.10")
?"- 59-"+@time+"- @error @serror "? $os="W98"
?"- 60-"+@time+"- @error @serror "? CASE
($nt_mode <> "yes") AND ($os_dos = "4.0") AND (INSTR(LCASE($os_subversion),"c") <> 0) ; - Windows 95 -
?"- 61-"+@time+"- @error @serror "? $os="W95c"
?"- 62-"+@time+"- @error @serror "? CASE
($nt_mode <> "yes") AND ($os_dos = "4.0") AND (INSTR(LCASE($os_subversion),"b") <> 0)
?"- 63-"+@time+"- @error @serror "? $os="W95b"
?"- 64-"+@time+"- @error @serror "? CASE
($nt_mode <> "yes") AND ($os_dos = "4.0") AND (INSTR(LCASE($os_subversion),"a") <> 0)
?"- 65-"+@time+"- @error @serror "? $os="W95a"
?"- 66-"+@time+"- @error @serror "? CASE
($nt_mode <> "yes") AND ($os_dos = "4.0")
?"- 67-"+@time+"- @error @serror "? $os="W95"
?"- 68-"+@time+"- @error @serror "? CASE
1
?"- 69-"+@time+"- @error @serror "? $os="???" ; - undetermined -
?"- 70-"+@time+"- @error @serror "? ENDSELECT
?"- 71-"+@time+"- @error @serror "? ;
?"- 72-"+@time+"- @error @serror "? $os_service_pack=""
?"- 73-"+@time+"- @error @serror "? SELECT
?"- 74-"+@time+"- @error @serror "? CASE
($nt_mode = "yes") AND ($os_dos = "5.1") ; - Windows XP
?"- 75-"+@time+"- @error @serror "? $os_service_pack=ReadValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion","BuildLab")
?"- 76-"+@time+"- @error @serror "? IF (len($os_service_pack) <> 0)
?"- 77-"+@time+"- @error @serror "? $os=substr($os,1,3)+"_"+LTRIM(RTRIM($os_service_pack))
?"- 78-"+@time+"- @error @serror "? $os_service_pack=LTRIM(RTRIM($os_service_pack))
?"- 79-"+@time+"- @error @serror "? ENDIF
?"- 80-"+@time+"- @error @serror "? CASE
($nt_mode = "yes") AND ($os_dos <> "5.1") ; Windows NT4 + W2K
?"- 81-"+@time+"- @error @serror "? $os_service_pack=ReadValue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion","CSDVersion")
?"- 82-"+@time+"- @error @serror "? IF (len($os_service_pack) <> 0)
?"- 83-"+@time+"- @error @serror "? $os=substr($os,1,3)+"_"+substr($os_service_pack,len($os_service_pack),1)
?"- 84-"+@time+"- @error @serror "? $os_service_pack=LTRIM(RTRIM($os_service_pack))
?"- 85-"+@time+"- @error @serror "? ENDIF
?"- 86-"+@time+"- @error @serror "? CASE
1
?"- 87-"+@time+"- @error @serror "? ; Windows 95, 98 + ME
?"- 88-"+@time+"- @error @serror "? ENDSELECT
?"- 89-"+@time+"- @error @serror "? ;
?"- 90-"+@time+"- @error @serror "? $os_type=""
?"- 91-"+@time+"- @error @serror "? $os_dos=@dos
?"- 92-"+@time+"- @error @serror "? SELECT
?"- 93-"+@time+"- @error @serror "? CASE
($nt_mode = "yes") AND ($os_dos = "5.1") ; - Windows XP beta
?"- 94-"+@time+"- @error @serror "? $os_type="XP"
?"- 95-"+@time+"- @error @serror "? CASE
($nt_mode = "yes") AND ($os_dos = "5.0") ; - Windows 2000 -
?"- 96-"+@time+"- @error @serror "? $os_type="W2K"
?"- 97-"+@time+"- @error @serror "? CASE
($nt_mode = "yes") ; - Windows NT -
?"- 98-"+@time+"- @error @serror "? $os_type="NT4"
?"- 99-"+@time+"- @error @serror "? CASE
($nt_mode <> "yes") AND ($os_dos = "4.90") ; - Windows ME -
?"- 100-"+@time+"- @error @serror "? $os_type="ME"
?"- 101-"+@time+"- @error @serror "? CASE
($nt_mode <> "yes") AND ($os_dos = "4.10") ; - Windows 98 -
?"- 102-"+@time+"- @error @serror "? $os_type="W98"
?"- 103-"+@time+"- @error @serror "? CASE
($nt_mode <> "yes") AND ($os_dos = "4.0") ; - Windows 95 -
?"- 104-"+@time+"- @error @serror "? $os_type="W95"
?"- 105-"+@time+"- @error @serror "? CASE
1
?"- 106-"+@time+"- @error @serror "? $os_type="???" ; - undetermined -
?"- 107-"+@time+"- @error @serror "? ENDSELECT
?"- 108-"+@time+"- @error @serror "? $os_type=LTRIM(RTRIM(substr($os_type+" ",1,3)))
?"- 109-"+@time+"- @error @serror "? ;
?"- 110-"+@time+"- @error @serror "? IF ($nt_mode = "yes")
?"- 111-"+@time+"- @error @serror "? ? "$$os "+$os ; <--- $os_type + service pack code
?"- 112-"+@time+"- @error @serror "? ? "$$os_type "+$os_type
?"- 113-"+@time+"- @error @serror "? ? "$$os_service_pack "+$os_service_pack
?"- 114-"+@time+"- @error @serror "? ELSE
?"- 115-"+@time+"- @error @serror "? ? "$$os "+$os ; <--- $os_type + service pack code
?"- 116-"+@time+"- @error @serror "? ? "$$os_type "+$os_type
?"- 117-"+@time+"- @error @serror "? ENDIF

;($begin)
;
; fri 12-oct-2001 15:36:34 (kix 4.00 vs 2.29e)
;
;Informative KIXSTRIP: no errors found (input=117 output=117 skip=0).
;
;Informative KIXSTRIP: 8 block_structures found.
;Informative KIXSTRIP: no UDF's found.
;Informative KIXSTRIP: no 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
;
;($end)



An output example of kix32 run:
code:

-2001/10/12 15:38:03- Script 3.63 starting.
- 1-15:38:03- 0 The operation completed successfully.

- 3-15:38:04- 0 The operation completed successfully.

- 4-15:38:04- 0 The operation completed successfully.

- 5-15:38:04- 0 The operation completed successfully.

- 6-15:38:04- 0 The operation completed successfully.

- 7-15:38:04- 0 The operation completed successfully.

- 8-15:38:04- 0 The operation completed successfully.

- 9-15:38:04- 0 The operation completed successfully.

- 10-15:38:04- 0 The operation completed successfully.

- 11-15:38:04- 0 The operation completed successfully.

- 12-15:38:04- 0 The operation completed successfully.

- 13-15:38:04- 0 The operation completed successfully.

- 14-15:38:04- 0 The operation completed successfully.

- 15-15:38:04- 0 The operation completed successfully.

- 16-15:38:04- 0 The operation completed successfully.

- 17-15:38:04- 0 The operation completed successfully.

- 18-15:38:04- 0 The operation completed successfully.

- 19-15:38:04- 0 The operation completed successfully.

- 20-15:38:04- 0 The operation completed successfully.

- 21-15:38:04- 0 The operation completed successfully.

- 24-15:38:04- 0 The operation completed successfully.

- 25-15:38:04- 0 The operation completed successfully.

- 26-15:38:04- 0 The operation completed successfully.

- 27-15:38:04- 0 The operation completed successfully.

- 28-15:38:04- 0 The operation completed successfully.

- 29-15:38:04- 0 The operation completed successfully.

- 30-15:38:04- 2 The system cannot find the file specified.

- 31-15:38:04- 2 The system cannot find the file specified.

- 32-15:38:04- 2 The system cannot find the file specified.

- 33-15:38:04- 0 The operation completed successfully.

- 63-15:38:04- 0 The operation completed successfully.

- 64-15:38:04- 0 The operation completed successfully.

- 71-15:38:04- 0 The operation completed successfully.

- 72-15:38:04- 0 The operation completed successfully.

- 73-15:38:04- 0 The operation completed successfully.

- 87-15:38:04- 0 The operation completed successfully.

- 88-15:38:04- 0 The operation completed successfully.

- 89-15:38:04- 0 The operation completed successfully.

- 90-15:38:04- 0 The operation completed successfully.

- 91-15:38:04- 0 The operation completed successfully.

- 92-15:38:04- 0 The operation completed successfully.

- 104-15:38:04- 0 The operation completed successfully.

- 105-15:38:04- 0 The operation completed successfully.

- 108-15:38:04- 0 The operation completed successfully.

- 109-15:38:04- 0 The operation completed successfully.

- 110-15:38:04- 0 The operation completed successfully.

- 115-15:38:04- 0 The operation completed successfully.

$os W95b
- 116-15:38:04- 0 The operation completed successfully.

$os_type W95
- 117-15:38:04- 0 The operation completed successfully.



When you still have problems please put some code on the board
and the output of your modified script with our tool kixstrip.
Greetings.


btw: it is only some additional information about how you can debug your script.

btw: with kix400strip ? you get a summary of possible options.
The result will be something like this:

code:

Kixstrip 4.00 (vs 2.29e) (c) MCA - scripting@wanadoo.nl - 2000, 2001
------------------------------------------------------------------------------
kixstrip [input] [output]
/Block_Check or /BC /Combine /Debug
/Headers /License /License=[var]
/Performance /Print /Progress
/Show_Errors or /SE /Show_Structure or /SS /Translate
/TAB=[num] (def: 6)
default: /Combine /Headers /License (other options are negative)
other: - options with prefix "/No" will be ignored. f.e. /NoDebug /NoTab
- /Block_Check /Tab=2 (auto set: /NoCombine /NoLicense /Print )
/Debug (auto set: /NoLicense /Print /Show_Errors )
- /Block_Check (reformat kixtart code inc. block structure )
/Combine (combine lines to one line )
/Headers (insert summary report as footer )
/Debug (insert "line numbers" for each printed line )
/Performance (insert "indicator" for each executed line)
/Print (do not remove print statements )
/Progress (insert "indicator" for each printed line )
/Show_Errors (insert error messages in output file )
/Show_Structure (insert block structures in output file )
/Translate (convert keywords to upper/lower-case )
examples - kixstrip test.kix test.out /Block_Check /Debug
- kixstrip test.kix test.out /Performance /Show_Structure


btw: Symbol on our homepage has been linked to related http://kixtart.org topic.