#!/opt/tcl/bin/sywish
#------------------------ Global Variables ---------------------------
#
# Feb 9th generalized setOrder and the loop in changeElem
#
# PUBLIC VARIANT
#
#---------------------------------------------------------------------------
# REV LEVEL:  $Revision: 1.4 $
#---------------------------------------------------------------------------
#
set config 0
set tclroot /opt/share/tcl
# set tclroot /opt0/share/tcl
set ucodb $tclroot/lib/ucodb
set whichapp "fosql"
#
set cvs(Id) {$Id: forms,v 1.4 1997/06/10 23:58:04 de Exp $}
set cvs(Revision) {$Revision: 1.4 $}
scan $cvs(Revision) "%*s %s" Version
puts stderr "Version $Version"
#---------------------------------------------------------------------------
# SHARED CODE  PUBLIC/PRIVATE
#---------------------------------------------------------------------------
#
if {[file exists $ucodb/.ucodb.cf]} {
	source $ucodb/.ucodb.cf
	incr config
} else {
	puts stderr "WARNING!  WARNING!  no global config file!"
	puts stderr "$ucodb/.ucodb.cf not found!"
}
if {[file exists ~[id user]/.ucodb.cf]} {
	source ~[id user]/.ucodb.cf
	incr config
}
#
if {!$config} {
	puts stderr "No .ucodb.cf found in $ucodb or in login dir."
	puts stderr "Unable to configure until you remedy this problem."
	puts stderr "Try installing the sample.ucodb.cf from the distrib"
	puts stderr "    as $ucodb/.ucodb.cf"
	exit 1
}
#
set myname [file tail $argv0]
#
loadlibindex $ucodb/ucodb.tlib
loadlibindex $ucodb/ucosql.tlib
if {$myname != "forms"} {
loadlibindex ./fosql.tlib
} else {
loadlibindex $ucodb/fosql.tlib
}
#
############################### Global vars start here ########################
#
# if you don't do this then expr results get weirdly rounded
#
############################### Code starts here ############################

foreach arg $argv {
        if {[crange $arg 0 0] == "-"} {
                case [crange $arg 1 end] in {
                {x} {
                        set mode 1
                }
                }
        } else {
                set uname $arg
                if {$uname == "sa"} {set mode 1}
        }
}

#	If in expert mode, disable areyousure on delete.

if {$mode} {
	set ayscheck 0
}

wm title    . "Fosql:  X11 Forms GUI for Sybase $Version"
wm iconname . "Fosql"

# use the tkmail bindings, with whatever hacks we add locally
# if the enhanced bindxtnd.tcl is not the default, source it
        if {[info proc tkBindDefVar]==""} {
          foreach key [bind Text] { bind Text $key {} }
          foreach key [bind Entry] { bind Entry $key {} }
          source $ucodb/tkbind/bindxtnd.tcl
          source $ucodb/tkbind/text.tcl
          source $ucodb/tkbind/entry.tcl
          # source additional packages here
        }

#	launch  -- here we go...  banzai!  banzai!  banzai!

	${DB}getSignOn
