Hi sebb,
Vars.remove();
That's what I struggle for days to try to find out. I really appreciate your
help. Thank you so much. 
I'm wondering where I can look up these kind of information by myself?
Sometimes, Jmeter user manual just gives very brief instructions.

Thanks,
yiping



-----Original Message-----
From: sebb [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 07, 2006 12:29 PM
To: JMeter Users List
Subject: Re: initialize Variables

It's important to use different "reference names" to each variable
set, otherwise there will be problems with nested For Loops.

If you are using vars.put(name, value) to create the variables, you
can use vars.remove(name) to remove a variable.

In the case of the ForEach Controller, it stops processing as soon as
it encounters a null variable, so you just need to make sure that you
remove "Var_3" (in your example).


On 07/03/06, Yiping Yang <[EMAIL PROTECTED]> wrote:
> Hi sebb,
>
> It's version 2.1.1.
> Actually, I use BeanShell to assign value to Var_1, Var_2, Var_3.....;

> Then I want to use For each sampler, I can easily get all variables in Var
> by specify this in for each sampler: "Input variable prefix: Var"
>
> In my script, there is another loop out of the for each loop.
> The schema is like
>
> For Each Controller(outer)
> User Defined Variable (define var)
> BeanShell(assign var_1, Var_2, Var_3)
>
>   For Each Controller(inner)
>    Get Var_1, Var_2.....
>
> Can I do something to clean up the Var before I assign values to them.
> As I mentioned, if in the first outer loop there are three variables,
var_1,
> var_2, var_3. while, in the second outer loop, only two variables, var_1,
> var_2 will be assigned the new value.  But Var_3 is still accessible by
the
> inner For each.
>
>
> -----Original Message-----
> From: sebb [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 07, 2006 11:16 AM
> To: JMeter Users List
> Subject: Re: initialize Variables
>
> On 07/03/06, Yiping Yang <[EMAIL PROTECTED]> wrote:
> > As we know in Regular Expression, if the match number is set to a
negative
> > number, then all the possible matches in the sampler data are processed.
> The
> > variables are set as:
> >
> >
> >
> > Var_1="23"
> >
> > Var_2 ="cd"
> >
> > Var_3="db"
> >
> > ......
> >
> >
> >
> > After I got these variables, I need to use BeanShell Sample to
manipulate
> > these variables.
> >
> >
> >
> > I got this values in a loop, the different iteration, the number of the
> > variable may different. Say in the first loop, I got three variables,
> > Var_1, Var_2, Var_3
> >
> >
> >
> > In the next iteration, I got only to Var_1, Var_2. values of Var_1 and
> Var_2
> > are replace by new values.  But the problem is the Var_3 is still there.
> >
>
> Which version of JMeter is this?
>
> >
> > How can I delete the Var_3. Or initialize these variables before each
> loop?
> >
>
> Why not just use Var_matchNr - this gives you the number of variables
> that are valid.
>
> >
> > I found some thing in Jmeter doc.
> >
> >
> >
> > *       refName_matchNr - the number of matches found; could be 0
> > *       refName_n, where n = 1,2,3 etc - the strings as generated by the
> > template
> > *       refName_n_gm, where m=0,1,2 - the groups for match n
> > *       refName - always set to the default value
> > *       refName_gn - not set
> >
> > I tried but I can't figure out how to use them.
> >
> >
> >
> > Any help will be greatly appreciated.
> >
> >
> >
> >
> >
> > Thanks,
> >
> > yiping
> >
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to