有没有办法让我按文件日期限制我的数组?我想要驱动器中的所有文件,但前提是文件上的日期>最后存储的导入日期时间。当我在“asterisk.asterisk”上构建数组时,它需要太长时间。有什么想法吗?
fsLAST = ''
USE CMEMAILS IN 0
SELECT CMEMAILS
SET ORDER TO DTSTAMP && DTSTAMP
GO BOTTOM
fsLAST = CMEMAILS.DTSTAMP
local array MyFiles[1,5]
nFilesFound = ADIR( MyFiles, ALLTRIM(cmcontrol.cpath) + '*.*')
for i = 1 to nFilesFound
SELECT cmemails
DO CASE
CASE DATETIME(YEAR(MyFiles[ i, 3]), MONTH(MyFiles[ i, 3]), DAY(MyFiles[ i, 3]), VAL(LEFT(MyFiles[ i, 4], 2)), VAL(SUBS(MyFiles[ i, 4], 4, 2)), VAL(SUBS(MyFiles[ i, 4],7,2))) > fsLAST
insert into cmemails (cprimary, csubject, ddate, dtime, cattribs, dtstamp) values ;
(generateGuid(26), MyFiles[ i, 1], MyFiles[ i, 3], MyFiles[ i, 4], MyFiles[ i, 5],DATETIME(YEAR(MyFiles[ i, 3]), MONTH(MyFiles[ i, 3]), DAY(MyFiles[ i, 3]), VAL(LEFT(MyFiles[ i, 4], 2)), VAL(SUBS(MyFiles[ i, 4], 4, 2)), VAL(SUBS(MyFiles[ i, 4],7,2))) )
ENDCASE
endfor