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.

Example

Old posts that have not been replied to for several years.
Locked
D
Drago
Voice
Posts: 9
Joined: Sun Apr 10, 2005 10:25 am

Example

Post by Drago »

Hay i whant to learn tcl scripting and i'm reading the suninet faq but i don't understand one thing http://www.suninet.nl/tclguide/index.php?chap=7&pg=1 plz give me some example for this... :)
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

suppose this

Code: Select all

set suppose "bla"
if you want to check if suppose matches bla then use this

Code: Select all

if {$suppose == "bla"} { <body> }
if you want to check if it doesn't match then use

Code: Select all

if {$suppose != "bla"} { <body> }
ofcourse, this is case sensitive. For example if $suppose is Bla it will not match bla. so you can use

Code: Select all

if {[string equal -nocase "bla" $suppose]} { <body> }
or add '!' if you want to check if it doesn't match.

using the first method, you can also check if a value is greater, less or equal.. like suppose

Code: Select all

set value 10
you can do checks like

Code: Select all

if {$value > 8} { <body> }
this is true since 10 is greater than 8
you can also use >= which means greater or equal.. from here you can get the concept.

Edit: Fixed typo, thanx ^DooM^
Last edited by Sir_Fz on Sat May 07, 2005 6:57 pm, edited 2 times in total.
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

Oops typo Alert..!!
Sir_Fz wrote:

Code: Select all

of {$value > 8} { <body> }
should be

Code: Select all

if {$value > 8} { <body> }
There is no operater called 'of' just to make things a little clearer. Usually I would not of said anything but as you are learning I thought it best to mention it

Cheers
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
Locked