0

是否可以遍历表并从每一行中检索值

=================
Contracts.dbf
=================
P01
C04
CH45
T31


counter = 1
Do While 1 < 4
   SomethingSomethingSomething
counter = counter + 1
ENDDO

因此,当计数器 = 1 时,循环返回 P01,计数器 = 2 返回 C04,依此类推。

4

2 回答 2

2
SELECT Contracts

SCAN

    m.Counter = 1
    m.Something = ""

    DO WHILE m.Counter <= FCOUNT() 
        m.Something = EVAL(FIELD(m.Counter))
        m.Counter = m.Counter +1
    ENDDO

ENDSCAN
于 2012-12-14T13:39:55.767 回答
1

尝试这个:

SELECT contracts
SCAN
    x = contracts.fieldname1
    MESSAGEBOX("Value -> " + x)
ENDSCAN
于 2012-12-14T13:38:06.730 回答