📄 global.tcl
字号:
# SYNOPSIS:
# destDirDispGet
#
# PARAMETERS: N/A
#
# RETURNS: the destination directory with slashes converted to Unix format.
#
# ERRORS: N/A
#
proc destDirDispGet {} {
set destDir [destDirGet]
if {$destDir != ""} {
set destDir [dosToUnix $destDir]
}
return $destDir
}
##############################################################################
#
# destDirGet - returns the destination directory.
#
# This routine returns the destination directory location to install
# the files for the product(s). If the destination directory has not
# been set, an empty string is returned.
#
# SYNOPSIS:
# destDirGet
#
# PARAMETERS: N/A
#
# RETURNS: the destination directory if it exists, else an empty string.
#
# ERRORS: N/A
#
proc destDirGet {} {
global setupVals
if {[info exists setupVals(destDir)]} {
return $setupVals(destDir)
} else {
return ""
}
}
##############################################################################
#
# destDirSet - sets the destination directory.
#
# Sets the global variable setupVals(destDir) to the destination directory.
#
# SYNOPSIS:
# destDirSet val
#
# PARAMETERS:
# <val>
# Contains the destination directory.
#
# RETURNS: N/A
#
# ERRORS: N/A
#
proc destDirSet {val} {
global setupVals
set setupVals(destDir) $val
}
##############################################################################
#
# sysDirGet - returns the Windows system directory.
#
# This routine returns the Windows system directory. If the system directory
# has not been set, an empty string is returned.
#
# SYNOPSIS:
# sysDirGet
#
# PARAMETERS: N/A
#
# RETURNS: the system directory if it exists, else an empty string.
#
# ERRORS: N/A
#
proc sysDirGet {} {
global setupVals
if {[info exists setupVals(sysDir)]} {
return $setupVals(sysDir)
} else {
return ""
}
}
##############################################################################
#
# sysDirSet - sets the system directory.
#
# Sets the global variable setupVals(sysDir) to the Windows system directory.
#
# SYNOPSIS:
# sysDirSet val
#
# PARAMETERS:
# <val>
# Contains the system directory.
#
# RETURNS: N/A
#
# ERRORS: N/A
#
proc sysDirSet {val} {
global setupVals
set setupVals(sysDir) $val
}
##############################################################################
#
# cdromBinDirGet - returns the host-specific CD-ROM executable files.
#
# This routine returns the CD-ROM directory containing the host-specific
# binary and executable files, for example env(CD_ROOT)/SUN4/SOLARIS2 or
# env(CD_ROOT)\X86\WIN32. If the bin directory has not been set,
# an empty string is returned.
#
# SYNOPSIS:
# cdromBinDirGet
#
# PARAMETERS: N/A
#
# RETURNS: the bin directory if it exists, else an empty string.
#
# ERRORS: N/A
#
proc cdromBinDirGet {} {
global env
if {[info exists env(CD_BIN)]} {
return $env(CD_BIN)
} else {
return ""
}
}
##############################################################################
#
# windHostTypeGet - returns the WIND_HOST_TYPE.
#
# This routine returns the WIND_HOST_TYPE set by the global variable
# setupVals(windHostType). If the WIND_HOST_TYPE has not been set,
# an empty string is returned.
#
# SYNOPSIS:
# windHostTypeGet
#
# PARAMETERS: N/A
#
# RETURNS: the WIND_HOST_TYPE if it exists, else an empty string.
#
# ERRORS: N/A
#
proc windHostTypeGet {} {
global setupVals
if {[info exists setupVals(windHostType)]} {
return $setupVals(windHostType)
} else {
return ""
}
}
##############################################################################
#
# windHostTypeSet - sets the WIND_HOST_TYPE.
#
# Sets the global variable setupVals(windHostType) to the WIND_HOST_TYPE.
#
# SYNOPSIS:
# windHostTypeSet val
#
# PARAMETERS:
# <val>
# Contains the WIND_HOST_TYPE [x86-win32 | sun4-solaris2 | parisc-hpux10].
#
# RETURNS: N/A
#
# ERRORS: N/A
#
proc windHostTypeSet {val} {
global setupVals
set setupVals(windHostType) $val
}
##############################################################################
#
# lastErrorGet - returns the last setup error.
#
# This routine returns the last setup error set by the global variable
# setupVals(lastError). If the last error has not been set, an empty string
# is returned.
#
# SYNOPSIS:
# lastErrorGet
#
# PARAMETERS: N/A
#
# RETURNS: the last error if it exists, else an empty string.
#
# ERRORS: N/A
#
proc lastErrorGet {} {
global setupVals
if {[info exists setupVals(lastError)]} {
return $setupVals(lastError)
} else {
return ""
}
}
##############################################################################
#
# lastErrorSet - sets the last setup error and increments the error count.
#
# Sets the global variable setupVals(lastError) to the last setup error
# and increments the value of setupVals(errorCount).
#
# SYNOPSIS:
# lastErrorSet val
#
# PARAMETERS:
# <val>
# Contains the last setup error.
#
# RETURNS: N/A
#
# ERRORS: N/A
#
proc lastErrorSet {val} {
global setupVals
set setupVals(lastError) $val
incr setupVals(errorCount)
}
##############################################################################
#
# lastErrorMsgSet - sets the last setup error.
#
# Sets the global variable setupVals(lastError) to the last setup error.
# Note that unlike lastErrorSet the errorCount is not incremented.
#
# SYNOPSIS:
# lastErrorMsgSet val
#
# PARAMETERS:
# <val>
# Contains the last setup error.
# RETURNS: N/A
#
# ERRORS: N/A
#
proc lastErrorMsgSet {val} {
global setupVals
set setupVals(lastError) $val
}
##############################################################################
#
# errorCountGet - returns the error count.
#
# This routine returns the error count recorded by the global variable
# setupVals(errorCount).
#
# SYNOPSIS:
# errorCountGet
#
# PARAMETERS: N/A
#
# RETURNS: the error count.
#
# ERRORS: N/A
#
proc errorCountGet {} {
global setupVals
if {[info exists setupVals(errorCount)]} {
return $setupVals(errorCount)
} else {
return 0
}
}
##############################################################################
#
# cdromDescGet - returns the CD-ROM description.
#
# This routine returns the CD-ROM description string set by the global
# variable setupVals(cdDesc). If the description has not been set, an empty
# string is returned.
#
# SYNOPSIS:
# cdromDescGet
#
# PARAMETERS: N/A
#
# RETURNS: the CD-ROM description string, else 0 if it does not exist.
#
# ERRORS: N/A
#
proc cdromDescGet {} {
global setupVals
if {[info exists setupVals(cdDesc)]} {
return $setupVals(cdDesc)
} else {
return 0
}
}
##############################################################################
#
# cdromDescSet - sets the CD-ROM description.
#
# Sets the global variable setupVals(cdDesc) to the CD-ROM description.
#
# SYNOPSIS:
# cdromDescSet val
#
# PARAMETERS:
# <val>
# Contains the CD-ROM description.
#
# RETURNS: N/A
#
# ERRORS: N/A
#
proc cdromDescSet {val} {
global setupVals
set setupVals(cdDesc) $val
}
##############################################################################
#
# arFlagsSet - sets the arflags for the current product index.
#
# Sets the global variable arFlags([currentIndexGet]) for the current
# product index.
#
# SYNOPSIS:
# arFlagsSet val
#
# PARAMETERS:
# <flags>
# Contains the arflags for the current product index.
#
# RETURNS: N/A
#
# ERRORS: N/A
#
proc arFlagsSet {flags} {
global arFlags
set arFlags([currentIndexGet]) $flags
}
##############################################################################
#
# arFlagsGet - returns the arFlags given the product index number.
#
# This routine returns the arFlags for the specified index based on the
# value of the global array arFlags($index). If no value has been set
# the default flags "-cru" are returned.
#
#
# SYNOPSIS:
# cdromDescGet
#
# PARAMETERS:
# <index>
# The product index number.
#
# RETURNS: the arflags for the specified product index, otherwise
# the default "-cru" if no arflags have been specified.
#
# ERRORS: N/A
#
proc arFlagsGet {index} {
global arFlags
if ![info exists arFlags($index)] {
set arFlags($index) "-cru"
}
return $arFlags($index)
}
##############################################################################
#
# currentIndexSet - sets the current product index.
#
# Sets the global variable currentIndex to the specified product
# index.
#
# SYNOPSIS:
# currentIndexSet index
#
# PARAMETERS:
# <index>
# The current product index.
#
# RETURNS: N/A
#
# ERRORS: N/A
#
proc currentIndexSet {index} {
global currentIndex
set currentIndex $index
}
##############################################################################
#
# currentIndexGet - returns the current product index.
#
# This routine returns the current product index set by the global
# variable currentIndex. If no value has been set an empty string is
# returned.
#
# SYNOPSIS:
# currentIndexGet
#
# PARAMETERS: N/A
#
# RETURNS: the current product index if it exists, else an empty string.
#
# ERRORS: N/A
#
proc currentIndexGet {} {
global currentIndex
if {[info exists currentIndex]} {
return $currentIndex
} else {
return ""
}
}
##############################################################################
#
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -