Hi all,
I have a question concerning metakit in tcl:
Is it possible to use properties with identical names but different property types in two different views?
When I tried to do this with the following script, I got an error. While adding data to the second view, metakit checked the data for the type of the property with the same name in the first view.
The test run on Win2000 with the ActiveState tcl distribution 8.4.1
-------------
puts [info patchlevel]
puts [package require Mk4tcl]
proc test {} {
mk::file open datafile
# create view view1 with two float properties
mk::view layout datafile.view1 {property1:F property2:F}
# append to 1st view
mk::row append datafile.view1 property1 2.3 property2 6.5
# create view view2 with two string properties
mk::view layout datafile.view2 {property1:S property2:S}
# 1st try
if {[catch {mk::row append datafile.view2 property1 moin}]} {
puts $::errorInfo
}
# 2nd try
set cur2 [mk::row append datafile.view2]
if {[catch {mk::set $cur2 property1 moin}]} {
puts $::errorInfo
}
}
test
-------------
The output:
8.4.1
2.4.7
expected floating-point number but got "moin"
while executing
"mk::row append datafile.view2 property1 moin"
expected floating-point number but got "moin"
while executing
"mk::set $cur2 property1 moin"
Thanks
--rg
