AMC100 1
Материал из Фабиус wiki
AMC100_1 - это программа из справочника R266
Удаление FTL и FRO
AMC100_1()
Текст
local temp_path, files, i, data, r20_kod, sql, msg try WAITMSG( 'Удаление FTL и FRO', msg ) temp_path := NICE_PATH( EXPANDUNCFILENAME( TempPath ) ) files := DIRECTORY( temp_path + '*.*', "A" ) if !ISEMPTY( files ) files := PREPAREARR( files ) for i := 1 to LEN( files ) data := RIGHT( ATR( files[i] ), 14 ) data := LEFT( data, 10 ) data := STRTRAN( data, '-', "" ) data := STOD( data ) r20_kod := VAL( LEFT( ATR( files[i] ), 5 ) ) if !IS_FILE( 'DOCP', data ) OPENFDATA( 'DOCP' + RET_F_EXT( data ), 'DOCP', false, OpdataPath, 'DOCP' ) endif sql := [ Delete From DOCP] + RET_F_EXT( data ) + [ Where KINDDOC = 'FTL' and DATDOC = '] + SQLDATE( data ) + [' and ; DREFL1 = 'R20 ' and DANAL1 = ] + r20_kod + [ and 'SYSTEM.' = 'SYSTEM.' ] SIMPLESQL( sql, OpdataPath ) sql := [ Delete From DOCP] + RET_F_EXT( data ) + [ Where KINDDOC = 'FRO' and DATDOC = '] + SQLDATE( data ) + [' and ; KREFL1 = 'R20 ' and KANAL1 = ] + r20_kod + [ and 'SYSTEM.' = 'SYSTEM.' ] SIMPLESQL( sql, OpdataPath ) next endif finally HIDEMSG( msg ) end // во временной папке файлы содержат дату // FTL // FRO