Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

How to perturbate through data array?

Experimenter
Experimenter

Hi,

I have a fundamental question. I want to make a for loop, through data arrays but I cannot reffer to individual elements of the array. Moreover, I want to make a loop for removing objects from a HBW but I cannot figure it out how to do it? Thank you.

 

 

var currStock : table
currStock.create
var RemoveOrderNo : integer

var product :string[2] :=makeArray("AA", "BB")
var quantity : integer[2] :=makeArray(100, 200)

RemoveOrderNo += 1

var i:integer
for i:=1 to 2 loop

root.WMS.removeProducts(to_str(RemoveOrderNo), Product, Quantity)    --I want this action to be executed for first elements seperately, for second, etc. Just printing their elements would be good start.

next;

2 REPLIES 2

Re: How to perturbate through data array?

Phenom
Phenom

try this piece of code:

 

var currStock : table
currStock.create
var RemoveOrderNo : integer

var product :string[2] :=makeArray("AA", "BB")
var quantity : integer[2] :=makeArray(100, 200)

RemoveOrderNo += 1

for var i:=1 to 2 

	--root.WMS.removeProducts(to_str(RemoveOrderNo), Product, Quantity) 
	print i," ",to_str(RemoveOrderNo)," ",product[i]," ",quantity[i]
	
	next

 

Re: How to perturbate through data array?

Experimenter
Experimenter
Great, thank you for helping.