RheinhardtP
Lifetime Supporting Member + Moderator
Hi Gents,
I am struggling with the following piece of code.
I have variable Strings i want to move to a general Data area as i go through different steps. I have a general offset of 26 bytes for each step. Within this structure i have my string which i want to rettrieve.
Here is my Code:
L #CurrentStepNo
L 1
-I
L 26
*I
SLW 3
LAR1 //Calculate offset in Source DB
OPN "SeqData"
LAR1 P##AnySrc
L W#16#1002 //type = byte
T W [AR1,P#0.0]
L DBB 16 //Length of string [16]
T W [AR1,P#2.0]
L 1 //From DB 1
T W [AR1,P#4.0]
L P#DBX 8.0 //Offset in DB 8.0
T D [AR1,P#6.0]
CALL "BLKMOV" //Copy chars in string
SRCBLK :=#AnySrc
RET_VAL:=MW110
DSTBLK :=#CurrentSeq.StepDescr
I want to be able to change my offset DBX8.0 dynamically using my calculation at the top for the offset. Should i do the same calculation before i load to T D [AR1,P#6.0]?? I have marked the line which i want to be able to calculate a different offset for in red.
Many Thanks
RP
I am struggling with the following piece of code.
I have variable Strings i want to move to a general Data area as i go through different steps. I have a general offset of 26 bytes for each step. Within this structure i have my string which i want to rettrieve.
Here is my Code:
L #CurrentStepNo
L 1
-I
L 26
*I
SLW 3
LAR1 //Calculate offset in Source DB
OPN "SeqData"
LAR1 P##AnySrc
L W#16#1002 //type = byte
T W [AR1,P#0.0]
L DBB 16 //Length of string [16]
T W [AR1,P#2.0]
L 1 //From DB 1
T W [AR1,P#4.0]
L P#DBX 8.0 //Offset in DB 8.0
T D [AR1,P#6.0]
CALL "BLKMOV" //Copy chars in string
SRCBLK :=#AnySrc
RET_VAL:=MW110
DSTBLK :=#CurrentSeq.StepDescr
I want to be able to change my offset DBX8.0 dynamically using my calculation at the top for the offset. Should i do the same calculation before i load to T D [AR1,P#6.0]?? I have marked the line which i want to be able to calculate a different offset for in red.
Many Thanks
RP