Gambrinus said:I think using of POINTER and ANY is useful only with SFB and SFC. If you want to make some logic with data in DBs and want to address data indirectly, using DB numbers and offsets as separate parameters is much more easier. You don't need to create a S7 pointers before FC call and to divide it to separate fields in FC. For example, this:
L Var1_offset
sld 3
t pVar1
L Var2_offset
sld 3
t pVar2
L Var3_offset
sld 3
t pVar3
opn db[DBnum1]
l dbw[pVar1]
opn db[DBnum2]
l dbw[pVar2]
aw
opn db[DBnum3]
t dbw[pVar3]
Exactly. But BLKMOV or UBLKMOV with ANY is even more easier. It's a problem only first time when people use it.PeterW said:For simplicity I agree with you but sometimes its horses for courses.
If your moving data from one area to another in a loop, its easier to use the pointer. A loop with +AR1 P#2.0 is quicker than loading, adding to and saving an offset.
PeterW said:Loop start for 10 loops
L DBW[AR1, P#0.0]
T DBW[AR2, P#0.0]
+AR1 P#2.0 // Offset 1 Word (2 byters)
+AR2 P#40.0 // Offset 20 Words (40 bytes)
Loop end
Gambrinus said:Of course, Pete. It'l be better for all who want to use AR take as the rule to insert only 4 statements before and after indirect tricks. And save their health with help of it.
TAR2
T #SaveAR2
----------
----------
L #SaveAR2
LAR2