I read the Wiki and found <quote>Sub without defined parameters
Sub MySub
/if (${Defined[Param0]}) /goto oThis
.
execute this code when /call MySub is executed. Parameters are not necessary.
.
/return [value|${varname}]</quote>
to describe how to return a value from a sub routine, but it says that the calling code will begin execution on the following line.
How do I USE the returned value.
I've tried the following......
/declare ALLOWED bool Inner /call CheckRights(${SenderName})
....
/declare ALLOWED bool Inner False
/varset ALLOWED /call CheckRights(${SenderName})
....
/if (CheckRights(${SenderName}).NotEquals[TRUE]) {
/return
} else {
/ do what I want my macro to do
}
/return
Sub CheckRights(string Sender)
/If (${Sender.Equal[PASSWORD]}) {
/return TRUE
} else {
/beep
/return False
}
Basically, this routine checks to see if the person sending the tell to the macro is the right person, just in case someone accidentally triggers one of my events. So when this is running and I'm out of the room, it'll beep to alert me, and NOT respond with the event code.
No matter what, when I echo the ALLOWED variable it gives me NULL or errors out on the if statement.
Any and all help from the people that know more than I do, would be greatly appreciated.
Sub MySub
/if (${Defined[Param0]}) /goto oThis
.
execute this code when /call MySub is executed. Parameters are not necessary.
.
/return [value|${varname}]</quote>
to describe how to return a value from a sub routine, but it says that the calling code will begin execution on the following line.
How do I USE the returned value.
I've tried the following......
/declare ALLOWED bool Inner /call CheckRights(${SenderName})
....
/declare ALLOWED bool Inner False
/varset ALLOWED /call CheckRights(${SenderName})
....
/if (CheckRights(${SenderName}).NotEquals[TRUE]) {
/return
} else {
/ do what I want my macro to do
}
/return
Sub CheckRights(string Sender)
/If (${Sender.Equal[PASSWORD]}) {
/return TRUE
} else {
/beep
/return False
}
Basically, this routine checks to see if the person sending the tell to the macro is the right person, just in case someone accidentally triggers one of my events. So when this is running and I'm out of the room, it'll beep to alert me, and NOT respond with the event code.
No matter what, when I echo the ALLOWED variable it gives me NULL or errors out on the if statement.
Any and all help from the people that know more than I do, would be greatly appreciated.