PDA

View Full Version : cycle loop ??



NewsArchive
07-10-2006, 04:50 AM
I need to backtrack if a user enters something invalid.
So I looked at the handy dandy "Validate Serial Number" project in the
examples, and found that cycle loop does exactly what I want.

But I wouldn't have guessed that from the documentation, Friedrich.

You say that "The Cycle Loop statement passes control immediately back to
the top of the Loop." I would have assumed that meant the top of the "Loop
Wizard" statement... but evidently it's the top of a sub-loop that exists
for each dialogue page?

If by some chance I did want to cycle back to the top of the Loop Wizard,
how would I do so?

Thanks.

Jane

NewsArchive
07-10-2006, 04:50 AM
Jane,

Do you have a LOOP inside the WIZARD LOOP?

WIZARD LOOP
LOOP
END
END

So in this case, you need the CYCLE LOOP outside the inner loop to cycle
back to the top of the Wizard Loop.

WIZARD LOOP
LOOP
END
! Here
CYCLE
END

Does this work?

Friedrich

--
Friedrich Linder
CEO, Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 5

NewsArchive
07-12-2006, 01:40 AM
Friedrich,

No. just the Wizard Loop. As I say, I pretty much copied verbatum from the
Validate Serial Number example. The cycle loop returns me to the accept for
dialog 3 (which is what I want). As I said, I just wondered how I'd return
to the top of the wizard loop if I wanted to.

Jane:

! The Wizard Loop displays the dialog screens that the user sees in the
installation
Loop Wizard
If %_SB_DIALOGID% Equals "3" Then
Set Variable %TERMINATEDVALUE% to "%_SB_INSTALLDIR%"
Set Variable %TERMINATEDVALUE% to "\"
If %_SB_INSTALLDIR% Equals (Ignore Case) "%JEXISTINGDIR%" Or
%TERMINATEDVALUE% Equals (Ignore Case) "%JEXISTINGDIR%" Then
Display Message Box "You really don't want to overwrite your good
softw..." -- "BAD Idea!"
Cycle Loop
End
End
Wizard Auto Break
End

NewsArchive
07-12-2006, 01:40 AM
Jane,

The following dummy test code works fine here (using build #1501)

! The Wizard Loop displays the dialog screens that the user sees in the
installation
Loop Wizard
Display Message Box "Top" -- ""
Wizard Auto Break
If %_SB_DIALOGID% Equals "2" Then
Display Message Box "Bad idea. CYCLE" -- ""
Cycle Loop
End
End

Cycle Loop brings me back to the top of the Wizard Loop (executed if the
Next button is pressed).

I would suggest to move your Wizard Auto Break to the top of the Wizard
Loop.

--
Friedrich Linder
CEO, Lindersoft
www.lindersoft.com
+1.954.252.3910

"point. click. ship" - that's SetupBuilder 5

NewsArchive
07-12-2006, 01:40 AM
OK. I see. Thanks

I was visualizing the stack of dialog screens within the
Loop Wizard ... End
as the loop... and thinking that the top of the loop would be the top
(first) screen being processed in the Loop Wizard.

BTW... searching the documentation (5.4.1501) for "auto break" only shows
auto break in a few example script snippets - no description of what it does
or where it should be placed in a wizard loop. "Show Wizard" and "Hide
Wizard" yield no hits in the help file... although they're intuitive enough
once I stumbled upon them...

So if, for some hypothetical reason, I did want to go back to a previous
wizard screen, is there some kind of "select dialog #" function?

Jane