lmarcinelli

Subroutine

Discussion created by lmarcinelli on May 11, 2016
Latest reply on May 11, 2016 by Mike_Mitchell

In a script, can I call a subroutine that is also in that same script?

 

For example:

 

If [ $WhichOne = 1]

if [not checkdate()]

halt script

end if

 

Set field

 

Else if [$WhichOne = 2]

if [not checkdate()]

halt script

end if

 

set field

 

End if

End if

_____________________

 

# subroutine

checkDate ()

return 1

if date= "" then

show custom dialog [" Error "; "Need Date"]

if [ Get ( LastmessageChoice ) = 2 ] then

return 0

end if

end CheckDate

 

 

Thanks in advance!

Outcomes