GuidoApp check_db "CHECK DATABASE CONNECTED"
$check_db setParam "databasesession" "GeologyDatabase"
set result [$check_db invoke]
$check_db destroy
if {$result == "0"} {
GuidoForm form {
-default_buttons
-label "Specify code of interest"
-tip DB_COMPOSITE_CODE_TIP
-layout CentreLineLayout
GuidoField code {
-label "Code"
-display_length 12
-format string
-max_length 20
-null true
}
}
set databuf [ GuidoExecServer GetComposites {} ]
set status [GuidoGetParamBufferValue $databuf status]
if {$status >= 0} {
$code setCurrentValue [GuidoGetParamBufferValue $databuf "composite_code"]
}
set return_code [$form interact]
if {$return_code == "apply"} {
GuidoApp select "SELECT HOLE"
GuidoApp composite "CODE COMPOSITES"
set hole_id "-"
while {$hole_id > ""} {
$select setParam prompt "DB_SELECT_COMPOSITE"
$select setParam report "off"
$select setParam marker "off"
$select setParam single_click "true"
set result [$select invoke]
set buffer [ GuidoExecServer GetSelectedHoleId {} ]
set hole_id [ GuidoGetParamBufferValue $buffer hole_id ]
set depth [ GuidoGetParamBufferValue $buffer depth ]
if {$hole_id > ""} {
$composite setParam hole_id $hole_id
$composite setParam depth $depth
$composite setParam code [$code getCurrentValue]
$composite invoke
}
set hole_id "-"
}
$select destroy
$composite destroy
}
$form destroy
}
