Scripting Example 68

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

; Example68.ftp

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

; This is a simple example showing how to update a FORM

; while executing.

;

; Examples 64 through 69 demonstrate the use of the

; various capabilities of FORMS and their interacation

; with your scripts.

;

; ---

;

; This demo simply loops from 1 to 10 and displays the

; current status while looping - allowing you to cancel

; any time.

; Please view the source of the file called:

; pgProgress.html

; located in the HTMLS folder.

; You will see that the "Names" of the input fields in that

; source have the same name as the variables:

; varCounter

; TagStartCount

; TagEndCount

; in this scripts. This fact is the key to the interaction

; between your scripts and your HTML forms.

;

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

; Commands demonstrated:

;

; ShowForm

; UpdateForm

; Break

;

; Syntax:

; ShowForm "<HTML Filename>"

; UpdateForm

; Break <Loop-variable>

;

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

; NOTE: You are be able to execute this example unchanged.

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

 

ToggleWindowOff

 

NumVariable varCounter

NumVariable TagStartCount

NumVariable TagEndCount

 

Let Canceling=false

 

; -- Set the form properties like position and sizes

Let FormLeft=0

Let FormTop=0

Let FormWidth=300

Let FormHeight=340

Let FormCentered=True

 

; -- While hoevering over hyperlinks, display the link on the bottom

; of the window

Let FormDisplayLinks=True

 

; -- Now Show the Form

Let TagStartCount = 1

Let TagEndCount = 10

ShowForm "%%Ftpctrldir%%\Htmls\pgProgress.html"

 

for varCounter=%%TagStartCount%% to %%TagEndCount%%

UpdateForm

sleep 1000

if %%Canceling%%=true then

break varCounter

endif

next varCounter

 

CloseForm

 

EndScript

 

:ProcCancel

Let Canceling=true

Return