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 what I'll use.
Thanks again.
Mark
--- In NADUG@yahoogroups.com, "thegonz14" <thegonz14@...> wrote:
>
> 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 programming practice. It would be better to use a metadata
> question or to add a property with a value to the IOM.Properties
> collection as part of OnInterviewStart to be accessible as
a "global"
> variable.
>
> Dim myProp
> Set myProp= IOM.Properties.CreateProperty()
> myProp.Name = "VariableName"
> myProp.Value = 0
> IOM.Properties.Add(myProp)
>
> Then, you can access the value of this property anywhere in your
> routing or subs/functions with this syntax:
>
> IOM.Properties["VariableName"]
>
> However if you do still want to do this you can declare this as the
> first line of your routing:
>
> Option GlobalVariables
>
> That will make routing dim variables accessible in subs/functions.
>
> Thanks.
>
> Tyler
>
> --- 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.
> >
>