1 |
dpavlin |
237 |
#!/opt/openisis/tcl/bin/isish |
2 |
|
|
# |
3 |
|
|
# openisis - an open implementation of the ISIS database |
4 |
|
|
# Version 0.8.x (microversion see file Version) |
5 |
|
|
# Copyright (C) 2003 by Erik Grziwotz, erik@openisis.org |
6 |
|
|
# |
7 |
|
|
# This library is free software; you can redistribute it and/or |
8 |
|
|
# modify it under the terms of the GNU Lesser General Public |
9 |
|
|
# License as published by the Free Software Foundation; either |
10 |
|
|
# version 2.1 of the License, or (at your option) any later version. |
11 |
|
|
# |
12 |
|
|
# This library is distributed in the hope that it will be useful, |
13 |
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 |
|
|
# Lesser General Public License for more details. |
16 |
|
|
# |
17 |
|
|
# You should have received a copy of the GNU Lesser General Public |
18 |
|
|
# License along with this library; if not, write to the Free Software |
19 |
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 |
|
|
# |
21 |
|
|
# This software is dedicated to the memory of Eckart Dietrich. |
22 |
|
|
# |
23 |
|
|
# This software is inspired by (but contains no code of) the iAPI |
24 |
|
|
# Copyright (C) 2000 by Robert Janusz, rj@jezuici.krakow.pl. |
25 |
|
|
# See iAPI.txt for what it contains. |
26 |
|
|
# |
27 |
|
|
# $Id: test2.tcl,v 1.4 2003/04/19 12:25:24 mawag Exp $ |
28 |
|
|
# test script |
29 |
|
|
|
30 |
|
|
proc putt msg { |
31 |
|
|
global prnout |
32 |
|
|
if $prnout { |
33 |
|
|
puts "$msg" |
34 |
|
|
} |
35 |
|
|
} |
36 |
|
|
|
37 |
|
|
set nn 1 |
38 |
|
|
set nrecs 1 |
39 |
|
|
set nfields 200 |
40 |
|
|
set prnout 0 |
41 |
|
|
|
42 |
|
|
switch $argc { |
43 |
|
|
0 { } |
44 |
|
|
1 { set nn [lindex $argv 0] } |
45 |
|
|
2 { set nn [lindex $argv 0] |
46 |
|
|
set nrecs [lindex $argv 1] } |
47 |
|
|
3 { set nn [lindex $argv 0] |
48 |
|
|
set nrecs [lindex $argv 1] |
49 |
|
|
set nfields [lindex $argv 2] } |
50 |
|
|
default { |
51 |
|
|
set nn [lindex $argv 0] |
52 |
|
|
set nrecs [lindex $argv 1] |
53 |
|
|
set nfields [lindex $argv 2] |
54 |
|
|
set prnout [lindex $argv 3] |
55 |
|
|
} |
56 |
|
|
} |
57 |
|
|
|
58 |
|
|
for {set n $nn} {0 != $n} {incr n -1} { |
59 |
|
|
set lst "" |
60 |
|
|
for {set j $nrecs} {0 <= [incr j -1]} {} { |
61 |
|
|
set cmd [openIsisRec {} set 23232 aa 45454 bb 23232 cc] |
62 |
|
|
lappend lst $cmd |
63 |
|
|
set val jdkjgjkdsdsfdffgfdggggggfdfkglfdsjödafdafdsaö |
64 |
|
|
$cmd set 1 $val |
65 |
|
|
$cmd set 2 $val |
66 |
|
|
$cmd set 3 $val |
67 |
|
|
$cmd set 476 $val |
68 |
|
|
$cmd set 477 $val |
69 |
|
|
$cmd set 478 $val |
70 |
|
|
for {set f 1} {$nfields >= $f} {incr f} { |
71 |
|
|
$cmd set $f njjhrehjghtgthgrthtbrbrthbrtibtrbhjtiobhghbhbkgbt |
72 |
|
|
} |
73 |
|
|
$cmd delete 2 {23232[0]} 477 |
74 |
|
|
$cmd add 23232 dd |
75 |
|
|
putt [$cmd get] |
76 |
|
|
} |
77 |
|
|
foreach cmd "$lst" { |
78 |
|
|
$cmd done |
79 |
|
|
} |
80 |
|
|
if {! $prnout && ! [expr $n % 50]} { |
81 |
|
|
puts "$n ..." |
82 |
|
|
} |
83 |
|
|
} |
84 |
|
|
|
85 |
|
|
puts "ok." |
86 |
|
|
|