| 网站首页 | 业界新闻 | 小组 | 交易 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛

CLOSE DATABASES

USE gsb1 ALIAS b1 IN 0
USE gsb2
REPLACE ALL gsb2.n1 WITH b1 ABS(z43+z44+z45) IN gsb2  &将表gsb1中的z43,z44,z45相加，并将结果放到表gsb2的n1里。

*REPLACE ALL n1 WITH ABS(z43+z44+z45)
*REPLACE ALL n2 WITH ABS(z43+z44+z46)
*REPLACE ALL n3 WITH ABS(z43+z44+z47)
*REPLACE ALL n4 WITH ABS(z43+z44+z48)
*REPLACE ALL n5 WITH ABS(z43+z44+z49)
*REPLACE ALL n6 WITH ABS(z43+z44+z50)
*REPLACE ALL n7 WITH ABS(z43+z44+z51)
*REPLACE ALL n8 WITH ABS(z43+z44+z52)
*REPLACE ALL n9 WITH ABS(z43+z44+z53)
*REPLACE ALL n10 WITH ABS(z43+z44+z54)

*REPLACE ALL n11 WITH ABS(z43+z45+z46)
*REPLACE ALL n12 WITH ABS(z43+z45+z47)
*REPLACE ALL n13 WITH ABS(z43+z45+z48)
*REPLACE ALL n14 WITH ABS(z43+z45+z49)
*REPLACE ALL n15 WITH ABS(z43+z45+z50)
*REPLACE ALL n16 WITH ABS(z43+z45+z51)
*REPLACE ALL n17 WITH ABS(z43+z45+z52)
*REPLACE ALL n18 WITH ABS(z43+z45+z53)
*REPLACE ALL n19 WITH ABS(z43+z45+z54)

*REPLACE ALL n20 WITH ABS(z43+z46+z47)
*REPLACE ALL n21 WITH ABS(z43+z46+z48)
*REPLACE ALL n22 WITH ABS(z43+z46+z49)
*REPLACE ALL n23 WITH ABS(z43+z46+z50)
*REPLACE ALL n24 WITH ABS(z43+z46+z51)
*REPLACE ALL n25 WITH ABS(z43+z46+z52)
*REPLACE ALL n26 WITH ABS(z43+z46+z53)
*REPLACE ALL n27 WITH ABS(z43+z46+z54)

*REPLACE ALL n28 WITH ABS(z43+z47+z48)
*REPLACE ALL n29 WITH ABS(z43+z47+z49)
*REPLACE ALL n30 WITH ABS(z43+z47+z50)
*REPLACE ALL n31 WITH ABS(z43+z47+z51)
*REPLACE ALL n32 WITH ABS(z43+z47+z52)
*REPLACE ALL n33 WITH ABS(z43+z47+z53)
*REPLACE ALL n34 WITH ABS(z43+z47+z54)

*REPLACE ALL n35 WITH ABS(z43+z48+z49)
*REPLACE ALL n36 WITH ABS(z43+z48+z50)
*REPLACE ALL n37 WITH ABS(z43+z48+z51)
*REPLACE ALL n38 WITH ABS(z43+z48+z52)
*REPLACE ALL n39 WITH ABS(z43+z48+z53)
*REPLACE ALL n40 WITH ABS(z43+z48+z54)

USE gsb1 ALIAS b1 IN 0
USE gsb2 ALIAS b2 IN 0
SELECT b2
REPLACE ALL b2.n1 WITH ABS(b1.z43+b1.z44+b1.z45) IN b2  &&将表gsb1中的z43,z44,z45相加，并将结果放到表gsb2的n1里。

```CLOSE DATABASES
T1 = SECONDS()
USE gsb2 IN 0
FOR lnj = 5 TO 44
BLANK FIELDS (FIELD(lnj)) ALL
ENDFOR
INDEX ON qihao TAG qihao
USE gsb1 IN 0
SELECT gsb1
SET RELATION TO qihao INTO gsb2
SCAN
ln1 = 0
FOR lnJ = 44 TO 48
FOR lnK = lnJ + 1 TO 54
ln1 = ln1 + 1
REPLACE ("N" + TRANSFORM(ln1)) WITH ABS(gsb1.z43 + EVALUATE("gsb1.z" + TRANSFORM(lnJ)) + EVALUATE("gsb1.z" + TRANSFORM(lnK))) IN gsb2
ENDFOR
ENDFOR
ENDSCAN
SET RELATION TO
SELECT gsb2
SET ORDER TO
MESSAGEBOX("共 " + TRANSFORM(SECONDS() - T1) + " 秒")
BROWSE
```

REPLACE ALL gsb2.n1 WITH b1 ABS(z43+z44+z45) IN gsb2

3楼的算法应该符合要求

USE gsb1 ALIAS b1 IN 0
USE gsb2 ALIAS b2 IN 0
SELECT b2
REPLACE ALL b2.n1 WITH ABS(b1.z43+b1.z44+b1.z45) IN b2
REPLACE ALL b2.n1 WITH ABS(b1.z44+b1.z45+b1.z46) IN b2
REPLACE ALL b2.n1 WITH ABS(b1.z45+b1.z46+b1.z47) IN b2
REPLACE ALL b2.n1 WITH ABS(b1.z43+b1.z44+b1.z45) IN b2
......
REPLACE ALL b2.n1 WITH ABS(b1.z55+b1.z67+b1.z70) IN b2
REPLACE ALL b2.n1 WITH ABS(b1.z23+b1.z37+b1.z42) IN b2
........
REPLACE ALL b2.n1 WITH ABS(b1.z19-b1.z31-b1.z36) IN b2
.......

```CLOSE DATABASES
T1 = SECONDS()
USE gsb2 IN 0
FOR lnj = 5 TO 44
BLANK FIELDS (FIELD(lnj)) ALL
ENDFOR
INDEX ON qihao TAG qihao
USE gsb1 IN 0
SELECT gsb1
SET RELATION TO qihao INTO gsb2
SCAN
REPLACE n1 WITH ABS(gsb1.z43 + gsb1.z44 + gsb1.z45) IN gsb2
REPLACE n2 WITH ABS(gsb1.z43 + gsb1.z44 + gsb1.z46) IN gsb2
REPLACE n3 WITH ABS(gsb1.z43 + gsb1.z44 + gsb1.z47) IN gsb2
REPLACE n4 WITH ABS(gsb1.z43 + gsb1.z44 + gsb1.z48) IN gsb2
REPLACE n5 WITH ABS(gsb1.z43 + gsb1.z44 + gsb1.z49) IN gsb2
REPLACE n6 WITH ABS(gsb1.z43 + gsb1.z44 + gsb1.z50) IN gsb2
REPLACE n7 WITH ABS(gsb1.z43 + gsb1.z44 + gsb1.z51) IN gsb2
REPLACE n8 WITH ABS(gsb1.z43 + gsb1.z44 + gsb1.z52) IN gsb2
REPLACE n9 WITH ABS(gsb1.z43 + gsb1.z44 + gsb1.z53) IN gsb2
REPLACE n10 WITH ABS(gsb1.z43 + gsb1.z44 + gsb1.z54) IN gsb2
ENDSCAN
SET RELATION TO
SELECT gsb2
SET ORDER TO
MESSAGEBOX("共运行 " + TRANSFORM(SECONDS() - T1) + " 秒")
BROWSE
```

• 11
• 1/2页
• 1
• 2