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.

if else ?

Help for those learning Tcl or writing their own scripts.
Post Reply
F
Freakazoid
Voice
Posts: 11
Joined: Sun Jul 31, 2005 12:38 pm

if else ?

Post by Freakazoid »

i got one quest! i wanna use a if script request for an sql output
with an else error if entry not found in the db.
how can i make it

in php is it easy if($nick='$ds[nick]) { echo'output info'; } else { echo'error no user found' }
but how works it with tcl ?

mfg freak :)
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

"if <conditional> [then] <what todo if true> else <what todo if false>"
Checking the manpage for "if" might also be a good idea...

Most common structures would be like this:

Code: Select all

if {sometest} {somecode} {someothercode}

if {sometest} {
 somecode
} {
 someothercode
}
NML_375
F
Freakazoid
Voice
Posts: 11
Joined: Sun Jul 31, 2005 12:38 pm

Post by Freakazoid »

nml375 wrote:"if <conditional> [then] <what todo if true> else <what todo if false>"
Checking the manpage for "if" might also be a good idea...

Most common structures would be like this:

Code: Select all

if {sometest} {somecode} {someothercode}

if {sometest} {
 somecode
} {
 someothercode
}
thx nml375 :)

one quest give it some good tutorials or links :) ?
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Freakazoid wrote:one quest give it some good tutorials or links :) ?
/man/tcl8.4/TclCmd/
How to write eggdrop scripts that won't choke on special characters
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
F
Freakazoid
Voice
Posts: 11
Joined: Sun Jul 31, 2005 12:38 pm

Post by Freakazoid »

thx :) Alchera
Post Reply