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.

anybody pls help me!

Old posts that have not been replied to for several years.
Locked
N
NetGAtEcrew

anybody pls help me!

Post by NetGAtEcrew »

Hi i'm a newbie :o want to ask about tcl scripting :

1. what different betwen return 0, return 1 and return ?
2. can give me some code with this algoritmh :
set a "Test"
if a != "Test" then halt or eror so tcl is not working from top proc to
bottom proc! i'm mean

Thx for any help for my short question. :P

(odon) I Like This Game!!!
User avatar
CrazyCat
Revered One
Posts: 1359
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Re: anybody pls help me!

Post by CrazyCat »

NetGAtEcrew wrote:1. what different betwen return 0, return 1 and return ?
it allows you to manage the way your procedures works.
If a procedure call another one, the second MUST return a code, as 0 or 1, to know the achievement state. So, you can treat, in first procedure, using:

Code: Select all

if { [proc2 $argument] == 1] {
   ... treatment 'cuz it works ...
} else {
   ... it didn't work...
}
by default, return is an exit of the current procedure.
NetGAtEcrew wrote:2. can give me some code with this algoritmh :
set a "Test"
if a != "Test" then halt or eror so tcl is not working from top proc to
bottom proc! i'm mean

Code: Select all

set a "Test"
if { $a != "Test"} {return 0}
... treatments if a == "Test"...
N
NetGAtEcrew

Post by NetGAtEcrew »

Thx's Crazy Cat for the explain :) now i'm understand about return function :roll:


odon (I Like This Game)
Locked