This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Old posts that have not been replied to for several years.
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Mon Feb 23, 2004 2:11 pm
CyberGhosT wrote: cant some1 make a tcl script like this 1 without the package require ftp ?
Sure...replace "package require ftp" with "source /path/to/ftp.tcl"
Have you ever read "The Manual"?
CyberGhosT
Voice
Posts: 13 Joined: Thu Nov 20, 2003 5:19 pm
Post
by CyberGhosT » Mon Feb 23, 2004 7:36 pm
i cant seam to find out how to use package require ftp
can some one give me some hints
CyberGhosT
stdragon
Owner
Posts: 959 Joined: Sun Sep 23, 2001 8:00 pm
Contact:
Post
by stdragon » Tue Feb 24, 2004 12:38 am
Hint 1: Go to tcllib.sf.net to download and install tcllib.
Ofloo
Owner
Posts: 953 Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:
Post
by Ofloo » Wed Feb 25, 2004 2:48 pm
Sir_Fz wrote:
if {$ftp<0} {
lappend out "$name is down"
} {
lappend out "$name is up"
}
Just curious not saying its wrong but doesn't there need to be else or something in between could be wrong never seen it used like this tho ..
XplaiN but think of me as stupid
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Wed Feb 25, 2004 3:57 pm
Ofloo wrote: Just curious not saying its wrong but doesn't there need to be else or something in between could be wrong never seen it used like this tho ..
http://tcl.tk/man/tcl8.4/TclCmd/if.htm
Have you ever read "The Manual"?
Ofloo
Owner
Posts: 953 Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:
Post
by Ofloo » Thu Feb 26, 2004 8:26 am
no still no clue i do understand the concept of if
Code: Select all
if {... condition ...} {
... body ...
} elseif {... condition ...} {
... body ...
} else {
... body ...
}
that is what i understand from the manual
but i have never seen this is it the same as else ..
Code: Select all
if {... condition ...}{
... body ...
}{
... body ...
}
XplaiN but think of me as stupid
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Thu Feb 26, 2004 8:39 am
Ofloo wrote: i have never seen this is it the same as else ..
Code: Select all
if {... condition ...}{
... body ...
}{
... body ...
}
Probably because "}{" would make the parser return an error
it's "} {"
If you'd read the whole manual page for 'if' you'd see.
The then and else arguments are optional ``noise words'' to make the command easier to read.
If you like being verbose i recommend using "then" too!
Have you ever read "The Manual"?
Ofloo
Owner
Posts: 953 Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:
Post
by Ofloo » Thu Feb 26, 2004 9:04 am
ic ic hmm
so in a way i could do
Code: Select all
if { ... condition ... } then {
... body ...
} else {
... body ...
}
hmm ive used some php before and they had something simular ..
if {}
then string ..
does this apply on tcl as well ?? if there is no {} then only the first string after the condition is included to the if condition ..
XplaiN but think of me as stupid