Cancel
Showing results for 
Search instead for 
Did you mean: 

Local Variable Reset in same Method

Solution Partner Pioneer Solution Partner Pioneer
Solution Partner Pioneer

Hi all,

 

In my init method I have a local varaible (Var_R).

 

I'm assigning differnt values to it multiple times. However when I assign a makeArray to it ,it says: the left side and the right side of the assigbnemnts are incompatible (Screen shots atteched below).

 

How can I reset my local variable ? (Var_R.reset ? >  it says a string cannot accept a method)

6 REPLIES

Re: Local Variable Reset in same Method

Phenom
Phenom

How about declaring Var_R as "any" before the loop ?

 

 

Re: Local Variable Reset in same Method

Solution Partner Pioneer Solution Partner Pioneer
Solution Partner Pioneer

Thank you for the reply,

 

It stil seems to be giving me the same error.

Re: Local Variable Reset in same Method

Solution Partner Pioneer Solution Partner Pioneer
Solution Partner Pioneer

It's not the most efficient (Especially if I am going to add new varaibles). but I did get it to work.

 

(Attached solution)

Re: Local Variable Reset in same Method

Phenom
Phenom

why don't you keep/declare Var_R as array e.g.

 

 

.
.
.

var var_R : any
.
.
case "ExitStrategy"

      var_R:=makeArray(tabR("value1",R))

case "ExitStrategyPercentageValues"
.
	var_R:=makeArray(value1,value2)
else

end

 

 

 

Through var_r.dim you can check - if necessary- the number of values (e.g. 1 or 2)

 

 

 

 

Re: Local Variable Reset in same Method

Solution Partner Pioneer Solution Partner Pioneer
Solution Partner Pioneer

The attribute ExitStrategy requires a string as input.

 

Alos, having something like: Var_R.reset won't work because it is not built into it as with other methods.

 

(Error: attached below)

Re: Local Variable Reset in same Method

Phenom
Phenom

var_R is now an array and no string !

 

therefore (re-) format robj.exitstrategy from "string" to a "table"

 

and copy data through var_R.copyToTable(r_Obj.exitstrategy, ...) - method.

 

Maybe it then would be easier to also use tables instead of arrays in the method.