PDA

View Full Version : Loop Wizard Behavior Clarification



NewsArchive
05-18-2005, 04:29 AM
Friedrich,

Can you explain why in a script with no explicit Break Loop or Cycle Loop a
Message Box statement placed as the last script item before the Loop Wizard
End will not display until the last dialog (Ready to Install) is accepted?

That specific behavior is a trivial, and in itself unimportant, example of
the seemingly mysterious behavior of the Loop Wizard. I realize I'm new to SB
and could certainly be seriously lacking a clue, but my expectation of a loop
construct and SB's documentation both lead me to believe that absent an
explicit control statement code will execute from loop entry (after Handle
Wizard Events) through to the loop's End. The trivial example seems to
indicate otherwise.

A more meaningful issue for me is a case where a block of code executes based
on the state of % SB DIALOGID% and a variable set in an include. For no
reason other the way I think, I positioned that block near the end of the
loop after the included code was executed. That worked fine until I made a
change (I have no idea now what that change was) that caused the required
condition of the combination of % SB DIALOGID% and the variable to always
fail. Repositioning that code block to just After Handle Wizard Events
changed that behavior.

So moving a block of code fixed the unexpected behaviors, leaving me happy
and with absolutely understanding of why. The behavior I am seeing leads me
to conclude that there are conditions that create an implicit Cycle. If that
can happen, we really need to know about it. Perhaps I don't understand the
behavior of % SB DIALOGID%, although it seems simple enough. Maybe I'm
overlooking something else I don't understand.

My biggest issue is I am reluctant to release this beast into the wild when I
have such a superficial comprehension of its behaviors. Have any spare clues?

--
Best regards,

Mark

-------------------------------------------------------------------
Why waste time learning when ignorance is instantaneous?
We do email right!
Rock solid hosting services at http://www.lanbytes.net

NewsArchive
05-18-2005, 04:29 AM
Mark,

Could you please send me a short script example? Do you have anything else
in the Wizard Loop structure?

Thanks,
Friedrich

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

NewsArchive
05-18-2005, 04:29 AM
>Could you please send me a short script example? Do you have anything else
>in the Wizard Loop structure?

Friedrich,

I can't force the behavior in a trivial script. I have a feeling this is not
something that is going to be reproducible outside my own work.

There is a fairly large amount of code within the Wizard Loop. The loop
itself is close to 300 lines (including white space), and there are seven
include instances in there that execute conditionally. So it's something of a
beast.

As I said before, there's likely something there that I do not understand.
IOW, I fully expect that I am doing something that causes in the behavior,
thus my desire to better understand the workings of the Wizard Loop. Again, I
am expecting a top to bottom execution of code, but I am seeing cases where
that is definitely not its behavior.

So absent Break Loop or Cycle Loop how can I create a condition that caused
the Message Box to behave as I described? If that can't, or shouldn't,
happen, then I'll go back and try to create an example for you. I just have
the sneaking suspicion that I'm doing something dumb.

--
Best regards,

Mark

-------------------------------------------------------------------
Why waste time learning when ignorance is instantaneous?
We do email right!
Rock solid hosting services at http://www.lanbytes.net

NewsArchive
05-18-2005, 04:29 AM
Mark,

Would it be possible to send me the script(s)?

In our latest internal source codes, I have removed the "Handle Wizard
Event" macro (the Loop Wizard function handles this now). But in the
current version, the "Handle Wizard Event" macro leaves the Wizard Loop
structure if %_SBDIALOGID% > %_SB_DIALOGMAX.

For example, the following code:

! Wizard dialog definition(s)
Define Wizard Dialog "#1" (Welcome)
Define Wizard Dialog "#2" (Select Install Folder)
Define Wizard Dialog "#3" (Ready to Install)

! The Wizard Loop displays the dialog screens that the user sees in the
installation
Loop Wizard
Handle Wizard Events()
Message Box "test" -- "test"
End

1. Loop Wizard display the Welcome (#1) dialog
2. Click Next and Handle Wizard Events() checks if %_SBDIALOGID% >
%_SB_DIALOGMAX
3. Display test mesage box
4. %_SBDIALOGID% increased by 1
5. Loop Wizard display the Select Install Folder (#2) dialog
6. Click Next and Handle Wizard Events() checks if %_SBDIALOGID% >
%_SB_DIALOGMAX
7. Display test mesage box
8. %_SBDIALOGID% increased by 1
9. Loop Wizard display the Ready to Install (#3) dialog
10. Click Next and Handle Wizard Events() checks if %_SBDIALOGID% >
%_SB_DIALOGMAX
11. Break Loop Wizard (no message box displayed)

Friedrich

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

NewsArchive
05-18-2005, 04:29 AM
>Would it be possible to send me the script(s)?

Sure, but I feel a bit guilty about dumping that mess on you.

>In our latest internal source codes, I have removed the "Handle Wizard
>Event" macro (the Loop Wizard function handles this now). But in the
>current version, the "Handle Wizard Event" macro leaves the Wizard Loop
>structure if % SBDIALOGID% > % SB DIALOGMAX.

I'm not seeing a premature exit from the Wizard Loop. I do have six of 14
dialogs that are set to hide before entering the loop, then conditionally set
to show/hide. Maybe something there is at play.

>For example, the following code:

Thanks for that explanation.

I'll email the scripts to you.

--
Best regards,

Mark

-------------------------------------------------------------------
Why waste time learning when ignorance is instantaneous?
We do email right!
Rock solid hosting services at http://www.lanbytes.net

NewsArchive
05-18-2005, 04:30 AM
Mark,

What a monster script <bg>.

I'll try to run it through the debugger and get back to you.

Thanks,
Friedrich

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

NewsArchive
05-18-2005, 04:30 AM
>What a monster script <bg>.

Yeah, it's a PITA. I sometimes feel I work to hard to make life simple for
all those folks with years old product releases. The upside is you get to
throw a big bowl of spaghetti at SB. :}

--
Best regards,

Mark

-------------------------------------------------------------------
Why waste time learning when ignorance is instantaneous?
We do email right!
Rock solid hosting services at http://www.lanbytes.net

NewsArchive
05-18-2005, 04:30 AM
Mark,

:)

First of all, let me tell you I am impressed!! This is a very fine piece of
SB5 script. You made my day.

The problem is caused by rsc_OFPro.GetDBPath.v8.AndPrior.sbi. The End
statement at line #101 should result in a "Too many end blocks" error
message - but the compiler generates an internal overflow and so this error
is not detected :-( It is fixed now, thank you.

Please remove line 101 in rsc_OFPro.GetDBPath.v8.AndPrior.sbi and it should
work fine.

BTW, I found another potential problem (I am working on this now).

Thanks,
Friedrich

Friedrich Linder
CEO, Lindersoft
www.lindersoft.com
1.954.252.3910

NewsArchive
05-18-2005, 04:30 AM
Mark,

Please ignore my note with regards to another potential problem. I saw in
the debugger that the code in rsc_CheckForActiveProgram.sbi was executed
three times. I did not notice the calls from line 194, 198 and 207 (I was
afraid "Loop 3 Times" was broken). I need to pay more attention or get
better coffee. <bg>

Friedrich

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

NewsArchive
05-18-2005, 04:31 AM
Mark,

We are talking about this line, right?

Message Box "DATABASE_PATH_MOVE_FROM = %DATABASE_PATH_MOVE_FROM..." --
"debug"

Thanks,
Friedrich

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

NewsArchive
05-18-2005, 04:31 AM
>We are talking about this line, right?
>
>Message Box "DATABASE PATH MOVE FROM = %DATABASE PATH MOVE FROM..." --
>"debug"

Yep, that's the one. In that position it never executes here when it should
actually be seen in each iteration of the loop.

--
Best regards,

Mark

-------------------------------------------------------------------
Why waste time learning when ignorance is instantaneous?
We do email right!
Rock solid hosting services at http://www.lanbytes.net

NewsArchive
05-18-2005, 04:31 AM
Mark,

I have tried everything but cannot reporduce this here :-( I have the
following code:

! Wizard dialog definition(s)
Define Wizard Dialog "#1" (Welcome)
Define Wizard Dialog "#2" (Select Install Folder)
Define Wizard Dialog "#3" (Ready to Install)

! The Wizard Loop displays the dialog screens that the user sees in the
installation
Loop Wizard
Handle Wizard Events()
Message Box "test" -- "test"
End

Message Box is always executed when I click the Next button.

Thanks,
Friedrich

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

NewsArchive
05-18-2005, 08:21 AM
>First of all, let me tell you I am impressed!! This is a very fine piece of
>SB5 script. You made my day.

Thanks so much, Friedrich. I was concerned you'd see that mess and yell at me
for abusing your product. :}

>The problem is caused by rsc OFPro.GetDBPath.v8.AndPrior.sbi. The End
>statement at line #101 should result in a "Too many end blocks" error
>message - but the compiler generates an internal overflow and so this error
>is not detected :-( It is fixed now, thank you.

Well, I'll be... No way I would have found that.

>Please remove line 101 in rsc OFPro.GetDBPath.v8.AndPrior.sbi and it should
>work fine.

Zapped. Thanks again for the help!

--
Best regards,

Mark

-------------------------------------------------------------------
Why waste time learning when ignorance is instantaneous?
We do email right!
Rock solid hosting services at http://www.lanbytes.net