Hi Mark,
I can think of a couple of ways to go:-
1) If you want to store the value in the case data you could do the
following:-
Metadata(en-US, Question, label)
Q1 "Q1" categorical [1] {Yes,No};
Q2 "Q2" categorical [1] {Yes,No};
SectionNumber "Section Number" long;
End Metadata
Routing(Web)
SectionNumber=1
Q1.Ask()
SectionNumber=2
Q2.Ask()
Sub OnBeforeQuestionAsk(Question,IOM)
If (IOM.Questions["SectionNumber"].Response=1) Then _
Debug.MsgBox("Only appears before Q1")
End Sub
End Routing
2) Of if you wanted to use a temporary variable on the fly, you could
do something like this:-
Metadata(en-US, Question, label)
Q1 "Q1" categorical [1] {Yes,No};
Q2 "Q2" categorical [1] {Yes,No};
End Metadata
Routing(Web)
IOM.Info.User9=1
Q1.Ask()
IOM.Info.User9=2
Q2.Ask()
Sub OnBeforeQuestionAsk(Question,IOM)
If (IOM.Info.User9=1) Then _
Debug.MsgBox("Only appears before Q1")
End Sub
End Routing
Obviously this assumes you're not using I.User9 on the URL for this
survey.
I think the better option 1) would probably be more applicable as you
have the value stored in the case data.
Let me know if this helps
Kind regards
Rich (Wilson)
--- In NADUG@yahoogroups.com, "mlamias" <mlamias@...> wrote:
>
> I am trying to find out how to set a global variable in my
Dimensions
> Script in the routing section using mrStudio. I have declared a
> variable, SectionNumber, using:
>
> Dim SectionNumber
>
> But I want to make this a global variable so that I can use it
> throughout the script. I've looked in the DDL documentation and
found
> little about declaring global variables outside of dms scripts.
>
> What I'm trying to do is refer to a global variable in the
> OnBeforeQuestionAsk Event -- not a question defined in the metadata
> section.
>
> Does anyone have any suggestions?
>
> Thanks.
>