Dear,

A new version of kixref has been created.


  • add: upgrade to kixtart 4.00 beta 1. downwards compatible.
  • add: detection of UDF (= user defined function) & ENV
    (environment variable) names.
  • add: introduction of option /show /translate.
  • add: enhancement of error information by block structures.
  • add: prevention of misinterpretation of names (f.e. day, @day, $day, :day
    and %day% are not the same).

Programs situated at site http://home.wanadoo.nl/scripting

The output of kixref:

code:

Kixref 4.00 (vs 2.06e) (c) MCA - scripting@wanadoo.nl - 2000, 2001
------------------------------------------------------------------------------
Kixref [input] [output] [options]
?
show [/translate]

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

/Translate /NoTranslate
/NoMSG

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


The output of kixref /show /translate. It shows what the results will
be after translation:

code:

Kixref 4.00 (c) 2000, 2001 - MCA 2.06e
------------------------------------------------------------------------------
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 CreateObject @csd
@curdir @date @day
DecToHex DEL DelKey
DelPrinterConnection DelProgramGroup DelProgramItem
DelTree DelValue DIM
Dir DISPLAY DO
@domain @dos EACH
ELSE ENDIF ENDFUNCTION
ENDSELECT EnumGroup EnumIPInfo
EnumKey EnumLocalGroup EnumValue
@error Execute Exist
ExistKey EXIT ExpandEnvironmentVars
FLUSHKB FOR @fullname
FUNCTION GET GetDiskSpace
GetFileAttr GetFileSize GetFileTime
GetFileVersion GetObject GETS
GLOBAL GO GOSUB
GOTO @homedir @homedrive
@homeshr @hostname IF
IN Ingroup Instr
@inwin @ipaddress0 @ipaddress1
@ipaddress2 @ipaddress3 KeyExist
@kix @lanroot Lcase
@ldomain @ldrive Len
@lm LoadHive LoadKey
LogEvent Logoff @longhomedir
LOOP @lserver Ltrim
@maxpwage MD @mdayno
MessageBox @month @monthno
NEXT OleCallFunc OleCallProc
OleCreateObject OleEnumObject OleGetObject
OleGetProperty OleGetSubObject OlePutProperty
OleReleaseObject Open OR
PASSWORD PLAY @primarygroup
@priv @productsuite @producttype
@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 SetSystemState SETTIME
SetTitle SetWallPaper SHELL
ShowProgramGroup Shutdown @sid
SidToName @site SLEEP
SMALL Split Srnd
@startdir STEP Substr
@syslang @time TO
UBound Ucase UnloadHive
UNTIL USE @userid
@userlang Val VarType
VarTypeName @wdayno WHILE
@wksta WriteLine WriteProfileString
WriteValue @wuserid @ydayno
@year


Example 1:

code:

IF (1=1)
? "if true"
ELSE
? "if false"
ENDIF

WHILE (1=1)
? "while ok"
LOOP

DO
? "do ok"
UNTIL (1=1)

SELECT
CASE (1=1)
ENDSELECT

FUNCTION x
? "function"
ENDFUNCTION

FOR EACH $x IN $xx
? $xx[$x]
NEXT

FOR $x=1 TO 100 STEP 2
? "for to"
NEXT

$result=get_kix_version()
? "show kix version "+$result
exit

function get_kix_version($dummy)
$get_kix_version=@kix
endfunction


Output of example 1:

code:

Kixref EXAMPLE1.KIX 10-apr-2001 02:22:42 page 1

1 1 IF (1=1)
2 ? "if true"
3 1 ELSE
4 ? "if false"
5 1 ENDIF
6
7 1 WHILE (1=1)
8 ? "while ok"
9 1 LOOP
10
11 1 DO
12 ? "do ok"
13 1 UNTIL (1=1)
14
15 1 SELECT
16 1 CASE (1=1)
17 1 ENDSELECT
18
19 1 FUNCTION x
20 ? "function"
21 1 ENDFUNCTION
22
23 1 FOR EACH $x IN $xx
24 ? $xx[$x]
25 1 NEXT
26
27 1 FOR $x=1 TO 100 STEP 2
28 ? "for to"
29 1 NEXT
30
31 $result=get_kix_version()
32 ? "show kix version "+$result
33 exit
34
35 1 function get_kix_version($dummy)
36 $get_kix_version=@kix
37 1 endfunction

Kixref EXAMPLE1.KIX 10-apr-2001 02:22:42 page 2

CASE c 16
DO c 11
$dummy v 35
EACH c 23
ELSE c 3
ENDFUNCTION c 21 37
ENDIF c 5
ENDSELECT c 17
EXIT c 33
FOR c 23 27
FUNCTION c 19 35
get_kix_version ? 31
$get_kix_version v 36
get_kix_version udf 35
IF c 1
IN c 23
@kix m 36
LOOP c 9
NEXT c 25 29
$result v 31 32
SELECT c 15
STEP c 27
TO c 27
UNTIL c 13
WHILE c 7
$x v 23 24 27
x udf 19
$xx v 23 24

Kixref EXAMPLE1.KIX 10-apr-2001 02:22:42 page 3

Summary

boldsymbols 0
commands 19
functions 0
labels 0
macros 1
variables 5

env 0
udf 2
? 1

28

Block Structure

do:until [1:1]
for|each:in|to:step|next [2|1:1|1:1|2]
function:endfunction [2:2]
if:else:endif [1:1:1]
select:case:endselect [1:1:1]
while:loop [1:1]

Kixref EXAMPLE1.KIX 10-apr-2001 02:22:42 page 4

case 1 c
do 1 c
$dummy 1 v
each 1 c
else 1 c
endfunction 2 c
endif 1 c
endselect 1 c
exit 1 c
for 2 c
function 2 c
get_kix_version 1
$get_kix_version 1 v
get_kix_version 1 udf
if 1 c
in 1 c
@kix 1 m
loop 1 c
next 2 c
$result 2 v
select 1 c
step 1 c
to 1 c
until 1 c
while 1 c
$x 3 v
x 1 udf
$xx 2 v


Screen output of example 1:

code:

Kixref 4.00 (vs 2.06e) (c) MCA - scripting@wanadoo.nl - 2000, 2001

kixref (vs 2.06e) example1.kix -> example1.out
(pl=55 pw=150 (default))
0.00 (sec) (37 BOLD=[28:36] SOURCE=37)

(counters 28:36)
(keywords b=0 c=19 f=0 l=0 m=1 v=5 ?=1 env=0 udf=2)
(blocks do:until [1:1]
for|each:in|to:step|next [2|1:1|1:1|2]
function:endfunction [2:2]
if:else:endif [1:1:1]
select:case:endselect [1:1:1]
while:loop [1:1]
)


Example 2. An example of differences between names:

code:

address
@address
$address
:address
%address%
%address @address
function address()
endfunction

city
@city
$city
:city
%city%
%city @city
function city()
endfunction



Output of example 2:
code:

Kixref EXAMPLE2.KIX 10-apr-2001 02:23:42 page 1

1 address
2 @address
3 $address
4 :address
5 %address%
6 %address @address
7 1 function address()
8 1 endfunction
9
10 city
11 @city
12 $city
13 :city
14 %city%
15 %city @city
16 1 function city()
17 1 endfunction
18

Kixref EXAMPLE2.KIX 10-apr-2001 02:23:42 page 2

address ? 1 6
$address v 3
%address env 5
:address l 4
@address m 2 6
address udf 7
city ? 10 15
$city v 12
%city env 14
:city l 13
@city m 11 15
city udf 16
ENDFUNCTION c 8 17
FUNCTION c 7 16

Kixref EXAMPLE2.KIX 10-apr-2001 02:23:42 page 3

Summary

boldsymbols 0
commands 2
functions 0
labels 2
macros 2
variables 2

env 2
udf 2
? 2

14

Block Structure

do:until [0:0]
for|each:in|to:step|next [0|0:0|0:0|0]
function:endfunction [2:2]
if:else:endif [0:0:0]
select:case:endselect [0:0:0]
while:loop [0:0]

Kixref EXAMPLE2.KIX 10-apr-2001 02:23:42 page 4

address 2 ?
$address 1 v
%address 1 env
:address 1 l
@address 2 m
address 1 udf
city 2
$city 1 v
%city 1 env
:city 1 l
@city 2
city 1 udf
endfunction 2 c
function 2 c



Screen output of example 2:
code:

Kixref 4.00 (vs 2.06e) (c) MCA - scripting@wanadoo.nl - 2000, 2001

kixref (vs 2.06e) example2.kix -> example2.out
(pl=55 pw=150 (default))
0.00 (sec) (18 BOLD=[14:20] SOURCE=18)

(counters 14:20)
(keywords b=0 c=2 f=0 l=2 m=2 v=2 ?=2 env=2 udf=2)
(blocks do:until [0:0]
for|each:in|to:step|next [0|0:0|0:0|0]
function:endfunction [2:2]
if:else:endif [0:0:0]
select:case:endselect [0:0:0]
while:loop [0:0]
)


Example 3. An example of script created by Shawn:

code:

break on

; sort some strings...

$array = Peach,Pumpkin,Orange,Grape,Lime,Apple,Rasberry,Cherry,Lemon
$array = bubbleup($array)
for each $element in $array
? $element
next

; sort some integers...

$array = 109,75,200,25,38,19,150,11,20
$array = bubbleup($array)
for each $element in $array
? $element
next

exit

;============================================
; Bubble sort argv(0)...argv(n) increasing...
;============================================

function bubbleup($argv)
;
if ubound($argv)
$i=0
while $i < ubound($argv)
$m = $argv[$i]
$j = $i + 1
while $j < ubound($argv)+1
if $argv[$j] < $m
$m = $argv[$j]
$argv[$j] = $argv[$i]
$argv[$i] = $m
endif
$j=$j+1
loop
$i=$i+1
loop
endif
$bubbleup = $argv
;
endfunction



Output of example 3:
code:

Kixref EXAMPLE3.KIX 10-apr-2001 02:23:38 page 1

1 break on
2
3 ; sort some strings...
4
5 $array = Peach,Pumpkin,Orange,Grape,Lime,Apple,Rasberry,Cherry,Lemon
6 $array = bubbleup($array)
7 1 for each $element in $array
8 ? $element
9 1 next
10
11 ; sort some integers...
12
13 $array = 109,75,200,25,38,19,150,11,20
14 $array = bubbleup($array)
15 1 for each $element in $array
16 ? $element
17 1 next
18
19 exit
20
21 ;============================================
22 ; Bubble sort argv(0)...argv(n) increasing...
23 ;============================================
24
25 1 function bubbleup($argv)
26 ;
27 2 if ubound($argv)
28 $i=0
29 3 while $i < ubound($argv)
30 $m = $argv[$i]
31 $j = $i + 1
32 4 while $j < ubound($argv)+1
33 5 if $argv[$j] < $m
34 $m = $argv[$j]
35 $argv[$j] = $argv[$i]
36 $argv[$i] = $m
37 5 endif
38 $j=$j+1
39 4 loop
40 $i=$i+1
41 3 loop
42 2 endif
43 $bubbleup = $argv
44 ;
45 1 endfunction

Kixref EXAMPLE3.KIX 10-apr-2001 02:23:38 page 2

apple ? 5
$argv v 25 27 29 30 32 33 34 35 35 36 43
$array v 5 6 6 7 13 14 14 15
BREAK c 1
bubbleup ? 6 14
$bubbleup v 43
bubbleup udf 25
cherry ? 5
EACH c 7 15
$element v 7 8 15 16
ENDFUNCTION c 45
ENDIF c 37 42
EXIT c 19
FOR c 7 15
FUNCTION c 25
grape ? 5
$i v 28 29 30 31 35 36 40 40
IF c 27 33
IN c 7 15
$j v 31 32 33 34 35 38 38
lemon ? 5
lime ? 5
LOOP c 39 41
$m v 30 33 34 36
NEXT c 9 17
on ? 1
orange ? 5
peach ? 5
pumpkin ? 5
rasberry ? 5
UBOUND f 27 29 32
WHILE c 29 32

Kixref EXAMPLE3.KIX 10-apr-2001 02:23:38 page 3

Summary

boldsymbols 0
commands 12
functions 1
labels 0
macros 0
variables 7

env 0
udf 1
? 11

32

Block Structure

do:until [0:0]
for|each:in|to:step|next [2|2:2|0:0|2]
function:endfunction [1:1]
if:else:endif [2:0:2]
select:case:endselect [0:0:0]
while:loop [2:2]

Kixref EXAMPLE3.KIX 10-apr-2001 02:23:38 page 4

apple 1
$argv 11 v
$array 8 v
break 1 c
bubbleup 2
$bubbleup 1 v
bubbleup 1 udf
cherry 1
each 2 c
$element 4 v
endfunction 1 c
endif 2 c
exit 1 c
for 2 c
function 1 c
grape 1
$i 8 v
if 2 c
in 2 c
$j 7 v
lemon 1
lime 1
loop 2 c
$m 4 v
next 2 c
on 1
orange 1
peach 1
pumpkin 1
rasberry 1
ubound 3 f
while 2 c



Screen output of example 3:
code:

Kixref 4.00 (vs 2.06e) (c) MCA - scripting@wanadoo.nl - 2000, 2001

kixref (vs 2.06e) example3.kix -> example3.out
(pl=55 pw=150 (default))
0.00 (sec) (45 BOLD=[32:79] SOURCE=45)

(counters 32:79)
(keywords b=0 c=12 f=1 l=0 m=0 v=7 ?=11 env=0 udf=1)
(blocks do:until [0:0]
for|each:in|to:step|next [2|2:2|0:0|2]
function:endfunction [1:1]
if:else:endif [2:0:2]
select:case:endselect [0:0:0]
while:loop [2:2]
)



Output of example 3 with option /translate:
code:

BREAK on

; sort some strings...

$array = peach,pumpkin,orange,grape,lime,apple,rasberry,cherry,lemon
$array = bubbleup($array)
FOR EACH $element IN $array
? $element
NEXT

; sort some integers...

$array = 109,75,200,25,38,19,150,11,20
$array = bubbleup($array)
FOR EACH $element IN $array
? $element
NEXT

EXIT

;============================================
; Bubble sort argv(0)...argv(n) increasing...
;============================================

FUNCTION bubbleup($argv)
;
IF UBound($argv)
$i=0
WHILE $i < UBound($argv)
$m = $argv[$i]
$j = $i + 1
WHILE $j < UBound($argv)+1
IF $argv[$j] < $m
$m = $argv[$j]
$argv[$j] = $argv[$i]
$argv[$i] = $m
ENDIF
$j=$j+1
LOOP
$i=$i+1
LOOP
ENDIF
$bubbleup = $argv
;
ENDFUNCTION


The screen output of a great example:

code:

Kixref 4.00 (vs 2.06e) (c) MCA - scripting@wanadoo.nl - 2000

kixref (vs 2.06e) example9.kix -> example9.out
(pl=55 pw=150 (default))
4.89 (sec) (24057 BOLD=[700:40110] SOURCE=24078)

(counters 700:40110)
(keywords b=2 c=53 f=90 l=8 m=41 v=440 ?=62 env=2 udf=2)
(blocks do:until [135:135]
-ERROR- for|each:in|to:step|next [3|2:2|2:2|3]
function:endfunction [3:3]
if:else:endif [4615:1341:4615]
select:case:endselect [26:159:26]
while:loop [37:37]
)

(Warning KIXREF: missing blocks)


Any idea, comment, remark or question is welcome.
We appreciate it to do it to this board.
Greetings.

btw:
- checking of block structure is less intelligent as the version
implementated by program kixstrip.exe
- related topics


_________________________
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