Cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with a method for creating a Location Matrix in to a Queue file

Pioneer
Pioneer

Hello

I have a peice of code that is to create a Location Matrix in a queue file it is made up of 4 elements these are

row, colum, depth and side

the Queue file will be a string format so i am no trying to create a piece of code that will build this file without me having to type all the combunations locations.

 

the code has 2 if statments and 4 loop statments to work thourgh each possible conbitantion,

then it convertes the Integers in to Strings then add them together to create one string for each location and then put each one in to a Queue File.

 

the error i am getting is in the first For Loop it say syntax error near <to>

 

i have placed the code below this statment.

I know the code is not fully complete there is still the second set of for loops after the else but that is the same just if the Side is one or two so it is a repeat of this code.

 

if you could offer some adivice on what i am doing wrong or what i could do differently.

 

Thanks

Gareth.Henry

 

 

	row : integer;
	Colum : integer;
	side : integer;
	side_total : integer;
	side_ref : string;
	Location_ref : string;
	row_ref : string;
	Colum_ref : string;
	row_total : integer;
	Colum_total : integer;
	Depth_ref : string;
	Depth_total : integer;
	Depth : integer;

 

Row_total := How_Many_Bays_X;
Colum_Total := How_Many_Bays_Y;
Depth_Total := How_Many_Bays_Z;
Row := 1;
Colum := 1;
Depth := 1;
Side := 1;

if Number_of_Lanes_Per_Track == 2 then
for  Side to 2 loop
if Side == 1 then
Side_Ref := L;
else 
Side_Ref := R;
end;
for Depth to Depth_Total loop
for Column to Colum_Total loop
for Row to Row_Total loop 
Row_ref := num_to_str(Row);
Colum_ref := num_to_str(Colum);
Depth_ref := num_to_str(Depth);

Location_ref := (Row_Ref+Colum_Ref+Depth_Ref+side_Ref)

Location_Matrix.insert(Location_ref);

next;
next;
next;
next;
else 





Side_ref := L;
for Depth to Depth_Total loop
for Column to Colum_Total loop
for Row to Row_Total loop 





next;
next;
next;



end;

 

 

3 REPLIES

Re: Problem with a method for creating a Location Matrix in to a Queue file

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

you need a variable for the for loop like this

 

for local i:=Depth to Depth_Total loop

 

 

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: Problem with a method for creating a Location Matrix in to a Queue file

Pioneer
Pioneer

Hello Steffen

Thats great thanks found that after i posted this problem, the next issue i have is inserting in to the Queue File using the

 

Location_Matrix.insert(Location_ref);

 

line

 

it is saying that the there is a syntax error near Location_Matrix.

 

could you give any adivice on this issue thats.

 

also is the creating of the Location_ref string correct?

 

Thanks

Gareth

Re: Problem with a method for creating a Location Matrix in to a Queue file

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

if you use the queueFile than you need to insert new entries with

queue.push(newEntry)

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net