egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem with <,<=

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
romain
Voice


Joined: 16 Oct 2005
Posts: 12

PostPosted: Sat Dec 10, 2005 11:47 am    Post subject: Problem with <,<= Reply with quote

Hello ,

I've this script

Code:
for {set i 0} {$i < [lindex $a 0]} {incr i} {
     if {0 < [lindex $a 0] <=5} {
      ##blabla
        if {$i == [lindex $a 0]} {
           ##blabla
        }
    } elseif {5 < [lindex $a 0] <= 10} {
         ##blabla
        if {$i == 5} {
         ##blabla
        } elseif {$i == [lindex $a 0]} {
          ##blabla
        }
   }   
 }


But don't works Question
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Dec 10, 2005 12:09 pm    Post subject: Reply with quote

Quote:
} elseif {5 < [lindex $a 0] <= 10} {

You mean
Code:
} elseif {5 < [lindex $a 0] && [lindex $a 0] <= 10} {

And is [lindex $a 0] a number?
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
romain
Voice


Joined: 16 Oct 2005
Posts: 12

PostPosted: Sun Dec 11, 2005 2:19 am    Post subject: Reply with quote

Thx Sir_Fz.

Yes it's a number. How verifier who a list is well a list of number?
Code:
regexp {\d} [split $list]


Question
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Sun Dec 11, 2005 3:41 am    Post subject: Reply with quote

romain wrote:
Thx Sir_Fz.

Yes it's a number. How verifier who a list is well a list of number?
Code:
regexp {\d} [split $list]


Question


now if you get this, you deserve to work for the NSA Razz
_________________
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use [code] tag when posting logs, code
Back to top
View user's profile Send private message Visit poster's website
romain
Voice


Joined: 16 Oct 2005
Posts: 12

PostPosted: Sun Dec 11, 2005 5:58 am    Post subject: Reply with quote

Lol demond,

i write now for work for the NSA Razz

Just, i have this code
Code:
foreach d [split $list] {
  if [regexp {\d} $d] {
   putlog "$d is a number"
  } else {
   putlog"$d is not a number"
  }
 }


It's good?
If yes, it's not possible to make more simple and fast for verify if a list is just a number list Question
Back to top
View user's profile Send private message
BarkerJr
Op


Joined: 30 Mar 2003
Posts: 104

PostPosted: Sun Dec 11, 2005 10:24 am    Post subject: Reply with quote

I think you want \d+, right?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Dec 11, 2005 12:29 pm    Post subject: Reply with quote

You can check using the string command.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber