Dear,

The problems we have were


  • how can we found typing errors.
  • which variables, functions, commands and other keys I am using.
  • what were the linenumbers of above names.
  • which variables look like different, but internally it are the
    same variable. only the first 12 characters of a variable are
    significant.
  • which block structures are incomplete.
  • how is the block structures.
  • what are the specified labels.

Solution: create a cross reference map of your kixtart source code
Program: Kixref.exe
Located at: http://home.wanadoo.nl/scripting

Help information:

  • kixref
    code:

    Kixref 3.62 (vs 1.29e) MCA - scripting@wanadoo.nl - 2000
    ------------------------------------------------------------------------------
    Kixref [input] [output] [options]
    ?
    show

    options: /Block_Check or /BC /Bold
    /Ref /Source
    /NoBlock_Check or /NoBC /NoBold
    /NoRef /NoSource

    /DATE_TIME or /DT /DATE_TIME=$date
    /DATE_TIME=none /DATE_TIME=[var]
    /Header /Number
    /NoHeader /NoNumber
    /Landscape /Portrait
    /PL=[number] /PW=[number]
    /Sub_Title or /ST /Title or /T

    /NoMSG

    default: /Block_Check /Bold /NoMsg /Ref /Source


  • kixref ?
    code:

    Kixref 3.62 (vs 1.29e) MCA - scripting@wanadoo.nl - 2000
    ------------------------------------------------------------------------------
    Kixref [input] [output] [options]
    ?
    show

    options: /BLOCK_CHECK or /BC
    /BOLD <-> /NOBOLD
    /NOBLOCK_CHECK <-> /BLOCK_CHECK
    /NOBOLD <-> /BOLD
    /NOREF <-> /REF
    /NOSOURCE <-> /SOURCE
    /REF <-> /NOREF
    /SOURCE <-> /NOSOURCE

    /DATE_TIME or /DT /DATE_TIME=$date
    /DATE_TIME=none /DATE_TIME=[var]
    /HEADER <-> /NOHEADER
    /LANDSCAPE
    /NOHEADER <-> /HEADER
    /NOMSG <-> /MSG
    /NONUMBER or /SUP <-> /NUMBER
    /NUMBER <-> /NONUMBER or /SUP
    /PORTRAIT
    /PL=[number] /PW=[number]
    /SUB_TITLE or /ST or /SUB_TITLE=[var]
    /TITLE or /T or /TITLE=[var]

    /MSG <-> /NOMSG
    /SHOW


    explanation of parameters:

  • /BLOCK_CHECK or /BC (default)
    it not only check for the block-structures:
    do/until,
    if/else/endif,
    select/case/endselect and
    while/loop,
    but it also shows it in the output file.
  • /BOLD (default)
    bold-symbols also added to the cross reference list.
  • /NOBLOCK_CHECK
    no check of block structure.
  • /NOBOLD
    no bold-symbols are added to the cross reference list.
  • /NOREF
    no cross-reference map are added to the output file.
  • /NOSOURCE
    no source listing are added to the output file.
  • /REF (default)
    add cross-reference map to the output file.
  • /SOURCE (default)
    add source listing to the output file.

  • /DATE_TIME or /DT (default)
    change date/time title part.
  • /DATE_TIME=$date
    $date will only display current date in title part.
  • /DATE_TIME=none
    none will not display current date in title part.
  • /DATE_TIME=[var]
    [var] will read the contents of the specified environment variable.
  • /HEADER (default)
    display a title.
  • /LANDSCAPE (default)
    output file will be landscape. automatic reformatting of the parameters
    /pl, /pw and title structure.
  • /NOHEADER
    don't display a title.
  • /NOMSG (default)
    show summary information to the user.
  • /NONUMBER or /SUP
    don't display linenumbers in source listing of output file.
  • /NUMBER (default)
    display linenumbers in source listing of output file.
  • /PORTRAIT
    output file will be portrait. automatic reformatting of the parameters
    /pl, /pw and title structure.
  • /PL=[number]
    page length.
  • /PW=[number]
    page width.
  • /SUB_TITLE or /ST or /SUB_TITLE=[var]
    subtitle. default: kixref.
  • /TITLE or /T or /TITLE=[var]
    subtitle. default: [filename].
  • /MSG
    show detail information to the user.
  • /SHOW
    show defined commands, functions and macros in kixtart 3.62


  • kixref show
    code:

    Kixref 3.62 (c) 2000 - MCA 1.29e
    ------------------------------------------------------------------------------
    addkey addprinterconnection addprogramgroup
    addprogramitem @address and
    asc at backupeventlog
    beep big box
    break call case
    cd chr cleareventlog
    close cls color
    @comment comparefiletimes cookie1
    copy @curdir @date
    @day dectohex del
    delkey delprinterconnection delprogramgroup
    delprogramitem deltree delvalue
    dim dir display
    do @domain @dos
    else endif endselect
    enumgroup enumkey enumlocalgroup
    enumvalue @error execute
    exist existkey exit
    expandenvironmentvars flushkb @fullname
    get getdiskspace getfileattr
    getfilesize getfiletime getfileversion
    gets global go
    gosub goto @homedir
    @homedrive @homeshr @hostname
    if ingroup instr
    @inwin @ipaddress0 @ipaddress1
    @ipaddress2 @ipaddress3 @kix
    @lanroot lcase @ldomain
    @ldrive len @lm
    loadhive loadkey logevent
    logoff @longhomedir loop
    @lserver ltrim @maxpwage
    md @mdayno messagebox
    @month @monthno olecallfunc
    olecallproc olecreateobject oleenumobject
    olegetobject olegetproperty olegetsubobject
    oleputproperty olereleaseobject open
    or password play
    @primarygroup @priv @pwage
    quit @ras rd
    readline readprofilestring readtype
    readvalue redirectoutput return
    rnd @rserver rtrim
    run savekey @scriptdir
    select sendkeys sendmessage
    @serror set setascii
    setconsole setdefaultprinter setfileattr
    setfocus setl setm
    settime setwallpaper shell
    showprogramgroup shutdown @sid
    @site sleep small
    srnd @startdir substr
    @syslang @time ucase
    unloadhive until use
    @userid @userlang val
    @wdayno while @wksta
    writeline writeprofilestring writevalue
    @wuserid @ydayno @year


An example of kixtart source code:

code:

IF setconsole("hide")
ENDIF
;
; NT/95 logging - Kixtart 3.62
;
; (c) scripting@wanadoo.nl - 2000
;
; vs 1.00 - program (easily use notepad to open unknown file)
;
; 1.00 (20000715) original version
;
$prgm_version="1.00"

IF (ExistKey("HKEY_CLASSES_ROOT\unknown") = 0)
$result=AddKey("HKEY_CLASSES_ROOT\unknown\Shell")
$result=AddKey("HKEY_CLASSES_ROOT\unknown\Shell\open")
$result=AddKey("HKEY_CLASSES_ROOT\unknown\Shell\open\command")
ENDIF
;
$ikey="HKEY_CLASSES_ROOT\unknown\Shell\open"
$ikey_ex=ENUMVALUE($ikey, 0)
$default_notepad="Quickview with Notepad"
IF (ExistKey($ikey+"\"+$ikey_ex) = 0)
$result_data_type=ReadType($ikey, $ikey_ex)
ELSE
$result_data_type="REG_SZ"
ENDIF
IF (writevalue($ikey, $ikey_ex, $default_notepad, $result_data_type) = 0)
IF (writevalue($ikey, $ikey_ex, $default_notepad, "REG_SZ") = 0)
ENDIF
ENDIF
;
$ikey="HKEY_CLASSES_ROOT\unknown\Shell\open\command"
$ikey_ex=ENUMVALUE($ikey, 0)
$default_notepad_exe="notepad.exe %1"
IF (ExistKey($ikey+"\"+$ikey_ex) = 0)
$result_data_type=ReadType($ikey, $ikey_ex)
ELSE
$result_data_type="REG_SZ"
ENDIF
IF (writevalue($ikey, $ikey_ex, $default_notepad_exe, $result_data_type) = 0)
IF (writevalue($ikey, $ikey_ex, $default_notepad_exe, "REG_SZ") = 0)
ENDIF
ENDIF
break on
flushkb
:end


Output of kixref notepad.kix notepad.txt run with default options:

code:

Kixref NOTEPAD.KIX 22-jul-2000 01:06:12 page 1

1 1 IF setconsole("hide")
2 1 ENDIF
3 ;
4 ; NT/95 logging - Kixtart 3.62
5 ;
6 ; (c) scripting@wanadoo.nl - 2000
7 ;
8 ; vs 1.00 - program (easily use notepad to open unknown file)
9 ;
10 ; 1.00 (20000715) original version
11 ;
12 $prgm_version="1.00"
13
14 1 IF (ExistKey("HKEY_CLASSES_ROOT\unknown") = 0)
15 $result=AddKey("HKEY_CLASSES_ROOT\unknown\Shell")
16 $result=AddKey("HKEY_CLASSES_ROOT\unknown\Shell\open")
17 $result=AddKey("HKEY_CLASSES_ROOT\unknown\Shell\open\command")
18 1 ENDIF
19 ;
20 $ikey="HKEY_CLASSES_ROOT\unknown\Shell\open"
21 $ikey_ex=ENUMVALUE($ikey, 0)
22 $default_notepad="Quickview with Notepad"
23 1 IF (ExistKey($ikey+"\"+$ikey_ex) = 0)
24 $result_data_type=ReadType($ikey, $ikey_ex)
25 1 ELSE
26 $result_data_type="REG_SZ"
27 1 ENDIF
28 1 IF (writevalue($ikey, $ikey_ex, $default_notepad, $result_data_type) = 0)
29 2 IF (writevalue($ikey, $ikey_ex, $default_notepad, "REG_SZ") = 0)
30 2 ENDIF
31 1 ENDIF
32 ;
33 $ikey="HKEY_CLASSES_ROOT\unknown\Shell\open\command"
34 $ikey_ex=ENUMVALUE($ikey, 0)
35 $default_notepad_exe="notepad.exe %1"
36 1 IF (ExistKey($ikey+"\"+$ikey_ex) = 0)
37 $result_data_type=ReadType($ikey, $ikey_ex)
38 1 ELSE
39 $result_data_type="REG_SZ"
40 1 ENDIF
41 1 IF (writevalue($ikey, $ikey_ex, $default_notepad_exe, $result_data_type) = 0)
42 2 IF (writevalue($ikey, $ikey_ex, $default_notepad_exe, "REG_SZ") = 0)
43 2 ENDIF
44 1 ENDIF
45 break on
46 flushkb
47 :end

Kixref NOTEPAD.KIX 22-jul-2000 01:06:12 page 2

ADDKEY f 15 16 17
BREAK c 45
$default_notepad v 22 28 29
$default_notepad_exe v 35 41 42
ELSE c 25 38
:end l 47
ENDIF c 2 18 27 30 31 40 43 44
ENUMVALUE f 21 34
EXISTKEY f 14 23 36
FLUSHKB c 46
IF c 1 14 23 28 29 36 41 42
$ikey v 20 21 23 24 28 29 33 34 36 37 41 42
$ikey_ex v 21 23 24 28 29 34 36 37 41 42
on 45
$prgm_version v 12
READTYPE f 24 37
$result v 15 16 17
$result_data_type v 24 26 28 37 39 41
SETCONSOLE f 1
WRITEVALUE f 28 29 41 42

Kixref NOTEPAD.KIX 22-jul-2000 01:06:12 page 3

Summary

boldsymbols 0
commands 5
functions 6
labels 1
macros 0
variables 7
? 1

20


Block Structure

do/until [0:0]
if/else/endif [8:2:8]
select/case/endselect [0:0:0]
while/loop [0:0]

Kixref NOTEPAD.KIX 22-jul-2000 01:06:12 page 4

addkey 3
break 1
$default_notepad 3
$default_notepad_exe 3
else 2
:end 1
endif 8
enumvalue 2
existkey 3
flushkb 1
if 8
$ikey 12
$ikey_ex 10
on 1
$prgm_version 1
readtype 2
$result 3
$result_data_type 6
setconsole 1
writevalue 4


Output of kixref screen output with /NoMsg:

code:

kixref (vs 1.29e) notepad.kix -> notepad.txt
(pl=55 pw=150 (default))
0.01 (sec) (47 BOLD=[20:75] SOURCE=46)

(count 20 b=0 c=5 f=6 l=1 m=0 v=7 ?=1)
(blocks do=[0:0] if=[8:2:8] select=[0:0:0] while=[0:0])


Output of kixref screen output with /Msg:

code:

kixref (c) 2000 - MCA lines read 47
(vs 1.29e) lines print 46
(sec) 0.01 number of pages 4
PageLength 55 (default)
PageWidth 150 (default)
BoldSymbol yes=[20:75]
Source yes
SUP numbers
From: notepad.kix
To: notepad.txt

Date.Time 22-jul-2000 01:06:12
Sub_Title Kixref
Title NOTEPAD.KIX
counters 20:75 b=0 c=5 f=6 l=1 m=0 v=7 ?=1
blocks do/until=[0:0]
if/else/endif=[8:2:8]
select/case/endselect=[0:0:0]
while/loop=[0:0]

Explanation of some output lines:


  • BoldSymbol yes=[20:75]
    20 = number of different bold-symbol you are using.
    75 = number of bold-symbol specified.
  • counters 20:75 b=0 c=5 f=6 l=1 m=0 v=7 ?=1
    b=0 number of kixtart boldsymbols.
    c=5 number of kixtart commands.
    f=6 number of kixtart functions.
    l=1 number of kixtart labels.
    m=0 number of kixtart macros.
    v=7 number of specified variables.
    ?=1 number of unknown variables/keywords.
  • blocks do/until=[0:0]
  • blocks if/else/endif=[8:2:8]
  • blocks select/case/endselect=[0:0:0]
  • blocks while/loop=[0:0]

Output of kixref screen output with /Msg for benchmarking:

code:

kixref (c) 2000 - MCA lines read 8726
(vs 1.29e) lines print 8730
(sec) 1.53 number of pages 186
PageLength 55 (default)
PageWidth 150 (default)
BoldSymbol yes=[228:14991]
Source yes
SUP numbers
From: kix-vb.kix
To: kix-vb.txt

Date.Time 22-jul-2000 02:23:26
Sub_Title Kixref
Title KIX-VB.KIX
counters 228:14991 b=2 c=22 f=25 l=1 m=35 v=136 ?=7
blocks do/until=[113:113]
if/else/endif=[1745:371:1745]
select/case/endselect=[10:66:10]
while/loop=[5:5]


Same run with default options:
code:

kixref (vs 1.29e) kix-vb.kix -> kix-vb.txt
(pl=55 pw=150 (default))
1.54 (sec) (8726 BOLD=[228:14991] SOURCE=8730)

(count 228 b=2 c=22 f=25 l=1 m=35 v=136 ?=7)
(blocks do=[113:113] if=[1745:371:1745] select=[10:66:10] while=[5:5])


So you see there are hardly no limits and it looks like to be fast.

Additional information are added at this moment.
Your email address can be added to a list, so we can inform you about
a new release.
Use Feedback at [url]http://home.wanadoo.nl/scripting[/b] for
your email address and other questions, suggestionsm ideas and requests.

important remarks:


  • use only filenames of 8.3 format.
  • variables/keywords in string are not analyzed. use f.e. "time "+@time instead of "time @time".

Greetings.

[This message has been edited by MCA (edited 22 July 2000).]

_________________________
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