Interface Subroutine<R>

  • All Known Implementing Classes:
    Engine.Sub

    public interface Subroutine<R>
    Interface to manage a BASIC subroutine. An instance of this interface can be acquired calling the method ScriptBasic.subroutine(String). It is also possible to get all the subroutines calling the method ScriptBasic.subroutines().
    Author:
    Peter Verhas
    • Method Detail

      • numberOfArguments

        int numberOfArguments()
        Returns:
        the number of arguments the subroutine expects when invoked
      • name

        java.lang.String name()
        Get the name of the subroutine. Even though the instance of the interface is usually acquired knowing the name of the subroutine this method can be used to access this information.
        Returns:
        the name of the subroutine
      • call

        R call​(java.lang.Object... args)
        throws ScriptBasicException
        Call the subroutine.
        Parameters:
        args - the arguments passed to the subroutine
        Returns:
        the return value of the subroutine
        Throws:
        ScriptBasicException - when an BASIC error happens during the execution of the subroutine