Scripting Example 59

; *****************************************************

; Example59.ftp

; =============

; This example shows the use of subroutines by means of new statements:

; GOSUB and RETURN:

; - GoSub : Jump to a labelled line and continues execution from there.

; - Return : Jumps back to the line after the calling "GoSub" statement.

;

; Another new statement "EndScript" is allos shown in the script.

; This statement will stop the execution of the script/application:

; - EndScript : Will stop further execution of the script/application.

;

;

; Syntax formats:

; GoSub <Label>

; Return

;

;

; -----------------------------------------------------

; NOTE: You are able to execute the script unchanged. ;o)

; ****************************************************

 

 

; The below "Gosub" statement will jump to the label "SubRoutine".

; When the subroutine issues a "Return" statement, the execution of

; the script will continue on the line after "GoSub".

Gosub SubRoutine

message "Back from Subroutine"

 

; This command "EndScript" will end the execution of the script/application.

EndScript

 

 

; -----------------------------------------------

:SubRoutine

message "I am now in SubRoutine !!"

Return