### VersChk.tcl 1.0.0 mQARWRMG
#REQUIREMENTS
# PBinSrc.tcl fMrtKqyq
#LICENSE
# Copyright © 2013 Alberto Dietze "DoctorD90"
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Full GPLv3 Text: http://www.gnu.org/licenses/gpl.txt
#PATERNITY
#Coder: DoctorD90
#Network: irc.OnlineGamesNet.net
#Chan: #eHito
#Mail: [email protected]
#PURPOSE
#Compare 2 versions number made up of 3 numbers, and know if 2nd is newer than 1st.
#USAGE
#Split versions numbers in lists of
#elements (ex. 1.0.0 -> [split "1.0.0" "."]).
#If it returns 1, 2nd is newer than 1st,
#else it is not.
### DON'T EDIT ANYTHING BELOW ###
proc vers_chker {v1 v2} {
#base vers
set v11 [lindex $v1 0]
set v12 [lindex $v1 1]
set v13 [lindex $v1 2]
#chk vers
set v21 [lindex $v2 0]
set v22 [lindex $v2 1]
set v23 [lindex $v2 2]
if {$v21 > $v11} { return 1 }
if {$v22 > $v12} { return 1 }
if {$v23 > $v13} { return 1 }
return 0
}
###
putlog "VersChk.tcl LOADED"
Comments
0 B
|👍
/👎
0 B
|👍
/👎
0 B
|👍
/👎