ASSIGNFILE — различия между версиями
Материал из Фабиус wiki
Hisava (обсуждение | вклад) м (→Примеры) |
Hisava (обсуждение | вклад) м (→Примеры) |
||
| Строка 17: | Строка 17: | ||
return | return | ||
endif | endif | ||
| − | TextReset( log_file ) | + | [[TextReset]]( log_file ) |
while !TextEof( log_file ) | while !TextEof( log_file ) | ||
Aadd( aa, ReadLn( log_file ) ) | Aadd( aa, ReadLn( log_file ) ) | ||
Версия 11:40, 8 сентября 2016
AssignFile - это функция, описанная в файле QrAddFn.pas
AssignFile( <filename> )
По имени файла возвращает файловую переменную
Примеры
_file := AssignFile( path + name )
parameters path, name, str_line
local aa, log_file
aa := {}
try
log_file := AssignFile( path + name )
if Empty( log_file )
return
endif
TextReset( log_file )
while !TextEof( log_file )
Aadd( aa, ReadLn( log_file ) )
end
finally
if !Empty( log_file )
CloseFile( log_file )
endif
end
Aadd( aa, Date() + ' ' + Time() + ' ' + str_line )
WriteTxtFile( aa, name, path, true )