Looking for some help with an array of strings in SCL.
I have an array of 99 string[98]
I also have an array of 99 INT
My first 4 chars of the strings are a character representation of an INT value e.g. 0001
I want to convert these to INTs.
My issues is when I try to compile I get an 'Illegal parameter assignment' when I try using the 'LEFT' function.
I am calling it as described in my Hans Berger book but it just isn't happy.
Any ideas?
I have an array of 99 string[98]
I also have an array of 99 INT
My first 4 chars of the strings are a character representation of an INT value e.g. 0001
I want to convert these to INTs.
My issues is when I try to compile I get an 'Illegal parameter assignment' when I try using the 'LEFT' function.
I am calling it as described in my Hans Berger book but it just isn't happy.
Any ideas?
Code:
(*##############################################################################
Inputs
##############################################################################*)
VAR_INPUT
Count:INT;
END_VAR
(*##############################################################################
Outputs
##############################################################################*)
VAR_OUTPUT
TaskId:ARRAY[0..99] OF INT;
END_VAR
(*##############################################################################
Inouts
##############################################################################*)
VAR_IN_OUT
TaskList:ARRAY[0..99] OF STRING[98];
END_VAR
(*##############################################################################
Variables
##############################################################################*)
VAR
i : INT ; // iterator
tmpStr : STRING;
END_VAR
BEGIN
FOR i := 0 TO Count DO
tmpStr := LEFT (IN:=TaskList[i],L:=4); // HERE IS THE PROBLEM
TaskId[i]:= STRNG_I(S := tmpStr);
END_FOR;
strLeftToINT:=0;
END_FUNCTION