Hello all,
I apologize for the lack of code here. This is more of a basic idea I would like to try. This is my first time dealing with SCL and just looking for a good starting point.
I could do this with STL but I hear that Array's and Indirect Addressing are much easier in SCL.
So basicly I want to create a function that I send a pointer to a DB containing an Array of 100 udt's.
And specify a Src and Dst element and copy the Src to the Dst.
The idea seems so simple yet I come up with nothing for SCL.
Do I have to create an Any pointer or can I just open a DB and access the elements directly???
Thanks for any advice,
-Joel
I apologize for the lack of code here. This is more of a basic idea I would like to try. This is my first time dealing with SCL and just looking for a good starting point.
I could do this with STL but I hear that Array's and Indirect Addressing are much easier in SCL.
So basicly I want to create a function that I send a pointer to a DB containing an Array of 100 udt's.
And specify a Src and Dst element and copy the Src to the Dst.
The idea seems so simple yet I come up with nothing for SCL.
Do I have to create an Any pointer or can I just open a DB and access the elements directly???
Thanks for any advice,
-Joel
Code:
FUNCTION ElementCopy : VOID
TITLE = 'Copying a array element'
//This block will copy a Src element of an Array to the Dst elemtn
VAR_INPUT
ArrayDB : BLOCK_DB;
Src : Int;
Dst : Int;
END_VAR
BEGIN
OpenDb ArrayDB
ArrayElement[Dst] = ArrayElement[Src]
END_FUNCTION