SHOW:
|
|
- or go back to the newest paste.
| 1 | - | ### EmptyVar.tcl 1.2.3 MfFd8Fqd |
| 1 | + | ### EmptyVar.tcl 1.0.0 MfFd8Fqd |
| 2 | ||
| 3 | - | #REQUIREMENTS |
| 3 | + | |
| 4 | - | # PBinScr.tcl link |
| 4 | + | |
| 5 | # | |
| 6 | # This program is free software: you can redistribute it and/or modify | |
| 7 | # it under the terms of the GNU General Public License as published by | |
| 8 | # the Free Software Foundation, either version 3 of the License, or | |
| 9 | # (at your option) any later version. | |
| 10 | # | |
| 11 | # This program is distributed in the hope that it will be useful, | |
| 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 | # GNU General Public License for more details. | |
| 15 | # | |
| 16 | # You should have received a copy of the GNU General Public License | |
| 17 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
| 18 | # | |
| 19 | # Full GPLv3 Text: http://www.gnu.org/licenses/gpl.txt | |
| 20 | ||
| 21 | proc nullstring {var} {
| |
| 22 | if {![string length [string trim $var]]} {
| |
| 23 | } else {
| |
| 24 | - | #PATERNITY |
| 24 | + | |
| 25 | - | #Coder: DoctorD90 |
| 25 | + | |
| 26 | - | #Network: irc.OnlineGamesNet.net |
| 26 | + | |
| 27 | - | #Chan: #eHito |
| 27 | + | |
| 28 | - | #Mail: [email protected] |
| 28 | + | |
| 29 | proc nulllist {var} {
| |
| 30 | - | #PURPOSE |
| 30 | + | |
| 31 | - | #Check if variable is empty |
| 31 | + | |
| 32 | } else {
| |
| 33 | - | #USAGE |
| 33 | + | |
| 34 | - | #Put in your proc: |
| 34 | + | |
| 35 | - | #-If var is string: |
| 35 | + | |
| 36 | - | # if {[nullstring $var]} { your proc }
|
| 36 | + | |
| 37 | - | #-If var is list |
| 37 | + | |
| 38 | - | # if {[nulllist $var]} { your proc }
|
| 38 | + |