Search the web
Sign In
New User? Sign Up
NADUG · North American Dimensions User Group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
IOM Global Variable   Message List  
Reply | Forward Message #135 of 164 |
Re: IOM Global Variable

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.
>





Sun Jul 20, 2008 7:35 pm

spssrich
Offline Offline
Send Email Send Email

Forward
Message #135 of 164 |
Expand Messages Author Sort by Date

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,...
mlamias
Offline Send Email
Jul 20, 2008
3:36 am

Hi, Doing this is not advisable as it can be confusing especially if you try to reuse variable names. In general, global variables are seen as a poor...
thegonz14
Offline Send Email
Jul 20, 2008
7:19 pm

Hi, Tyler, Thanks for the suggestion. This is actually what I ended up doing before your suggestion. I think adding a property works quite well and this is...
mlamias
Offline Send Email
Jul 20, 2008
8:33 pm

Just so I understand this, Option GlobalVariables makes ALL variables declared global and not just selected variables? I can see why this would be problematic....
mlamias
Offline Send Email
Jul 20, 2008
8:39 pm

I actually just tried Option GlobalVariables in the routing and it doesn't seem to work in 4.0 (perhaps would in a later version).  Looks like it is meant for...
Tyler Ball
thegonz14
Offline Send Email
Jul 20, 2008
8:57 pm

All, Thanks to Rich and Tyler for their helpful posts. I have implemented the following code, but it seems to not work. I'm wondering if this is a bug. I'm...
mlamias
Offline Send Email
Jul 20, 2008
9:06 pm

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,...
spssrich
Offline Send Email
Jul 20, 2008
7:35 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help