Return value on a sub?

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

a_large_rat01
orc pawn
orc pawn
Posts: 10
Joined: Thu Jan 02, 2003 3:43 am

Return value on a sub?

Post by a_large_rat01 » Thu Jan 02, 2003 5:50 am

I just new to MQ but I would like to know how to check the return value from a sub.

Code: Select all

/return CAST_SUCCESS 
How do I call the sub to check the value on it? Like this? :?:

Code: Select all

/if /call cast "$v43" > 0 {
  /echo Darn!
}
Thanks,

a_large_rat01 :wink:

a_large_rat01
orc pawn
orc pawn
Posts: 10
Joined: Thu Jan 02, 2003 3:43 am

Post by a_large_rat01 » Thu Jan 02, 2003 7:40 am

Well I guess I have found the answer myself :lol:

Code: Select all

/call cast "$v43"
/if $return > 0 {
  /echo Darn!
}
Thanks anyway,

a_large_rat01 :wink:

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Thu Jan 02, 2003 12:02 pm

Salutations,
um... thats wrong, no spaces...

Code: Select all

/call cast "$v43"
/if $return>0 {
  /echo Darn!
}
and why are you using {}'s? I mean if you're only doing one line...

Code: Select all

/call cast "$v43"
/if $return>0 /echo Darn!
and its a numeral so...

Code: Select all

/call cast "$v43"
/if n $return>0 {
  /echo Darn!
}
just use the late one, I'm rambling...

a_large_rat01
orc pawn
orc pawn
Posts: 10
Joined: Thu Jan 02, 2003 3:43 am

Post by a_large_rat01 » Fri Jan 03, 2003 2:11 am

Thanks L124RD :D

a_large_rat01 :wink:

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Fri Jan 03, 2003 2:07 pm

Salutations,
you're welcome