Author Topic: SCL-problem  (Read 17536 times)

Repi3

  • Guest
SCL-problem
« on: May 25, 2005, 12:35:06 AM »
Hello,

I must copie a DB-row with index(0) to a free index space.
So i started to write a SCL-routine, but i'm stuck ???
I must define my index to 1, but the program restart alway's with this line, so everytime he is setting my index:=1 , i have tried to initial the index in the declaration, but that won't work.
So can some help me out ?

Code: [Select]
FUNCTION FC4: VOID

// Block Parameters
VAR_INPUT
// Input Parameters
order : ARRAY[0..5] OF STRUCT
soort : INT ;
bron : STRUCT
x : INT;
y : INT;
END_STRUCT;
bestemming : STRUCT
x : INT;
y : INT;
z : INT;
END_STRUCT;
END_STRUCT;

END_VAR

VAR_IN_OUT
// I/O Parameters
nieuwe_opdracht : BOOL;
END_VAR

VAR_OUTPUT
// Output Parameters
uitgang : INT;
END_VAR

VAR_TEMP
// Temporary Variables
index : INT ;
END_VAR

index := 1;                       <<<<------here is the problem
index := uitgang;
// Instruction Section
WHILE (nieuwe_opdracht = true) DO
// Statement Section
index := index + 1;
db10.order[index] := db10.order[0];
nieuwe_opdracht := false;
;
END_WHILE;

END_FUNCTION