Thread: ioTRANSCRED
View Single Post
Old 09-10-2004, 09:13 AM  
Mouton
Posse Member
 
Join Date: Dec 2002
Posts: 1,956
Default

A better way to do that without having to duplicate the info would be:

Code:
set FtpNames "Server1Name Server2Name Server3Name ..."

...
set Ftp1 [GetFTPName $Ftp1]
set Ftp2 [GetFTPName $Ftp2]
...

proc GetFTPName {$Ftp} {
  global FtpNames
  set i 1
  foreach name $FtpNames {
    if {$Ftp == $name} {
      if {$i>9} { return $i } else { return "0$i" }
    }
    incr i
  }
  return $Ftp
}
Mouton is offline   Reply With Quote