ВУЗ: Не указан

Категория: Не указан

Дисциплина: Не указана

Добавлен: 12.06.2025

Просмотров: 8167

Скачиваний: 1

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.

© MCS Electronics, 1995-2007

'prints 3.00416602394638

End

FILEATTR

Action

Returns the file open mode.

Syntax

bFileAttribut = FILEATTR(bFileNumber)

Remarks

bFileAttribut

(Byte) File open mode, See table

bFileNumber

(Byte) Number of the opened file

This functions returns information about the File open mode

Return value Open mode

1INPUT

2OUTPUT

8 APPEND

32 BINARY

See also

INITFILESYSTEM , OPEN , CLOSE, FLUSH , PRINT, LINE INPUT, LOC, LOF , EOF , FREEFILE , SEEK , BSAVE , BLOAD , KILL , DISKFREE , DISKSIZE , GET , PUT, FILEDATE , FILETIME , FILEDATETIME , DIR , FILELEN, WRITE , INPUT

ASM

Calls

_FileAttr

Input

r24: Filenumber

Output

24: File open mode

r25: Errorcode

C-Flag: Set on Error

Partial Example

'open the file in BINARY mode Open "test.biN" For Binary As #2

Print Fileattr(#2); " file mode"' should be 32 for binary Put #2 , Sn ' write a single

Put #2 , Stxt ' write a string Close #2

page -485-


© MCS Electronics, 1995-2007

FILEDATE

Action

Returns the date of a file

Syntax

sDate = FILEDATE ()

sDate = FILEDATE (file)

Remarks

Sdate

A string variable that is assigned with the date.

File

The name of the file to get the date of.

This function works on any file when you specify the filename. When you do not specify the filename, it works on the current selected file of the DIR() function.

See also

INITFILESYSTEM , OPEN , CLOSE, FLUSH , PRINT, LINE INPUT, LOC, LOF , EOF , FREEFILE , FILEATTR , SEEK , BSAVE , BLOAD , KILL , DISKFREE , DISKSIZE, GET , PUT, FILELEN , FILETIME , FILEDATETIME , DIR , WRITE , INPUT

ASM

Calls

_FileDateS ; with filename

_FileDateS0 ; for current file from DIR()

Input

X : points to the string with the

Z : points to the target variable

mask

Output

Partial Example

Print "File demo"

Print Filelen("josef.img");" length" ' length of file

Print Filetime("josef.img");" time" ' time file was changed

Print Filedate("josef.img");" date" ' file date

FILEDATETIME

Action

Returns the file date and time of a file

Syntax

Var = FILEDATETIME ()

Var = FILEDATETIME (file)

page -486-


© MCS Electronics, 1995-2007

Remarks

Var

A string variable or byte array that is assigned with the file datge and time

of the specified file

File

The name of the file to get the date time of.

When the target variable is a string, it must be dimensioned with a length of at least 17 bytes.

When the target variable is a byte array, the array size must be at least 6 bytes.

When you use a numeric variable, the internal file date and time format will be used.

See also

INITFILESYSTEM , OPEN , CLOSE, FLUSH , PRINT, LINE INPUT, LOC, LOF , EOF , FREEFILE , FILEATTR , SEEK , BSAVE , BLOAD , KILL , DISKFREE , GET , PUT , FILELEN , FILEDATE , FILETIME , DIR , WRITE , INPUT

ASM

Calls

_FileDateTimeS

_FileDateTimeS0

Input

Output

Calls

_FileDateTimeB

_FileDateTimeB0

Input

Output

Example

See fs_subfunc_decl_lib.bas in the samples dir.

FILELEN

Action

Returns the size of a file

Syntax

lSize = FILELEN ()

lSize = FILELEN (file)

Remarks

lSize

A Long Variable, which is assigned with the filesize in bytes of the file.

File

A string or string constant to get the file length of.

This function works on any file when you specify the filename. When you do not specify the filename, it works on the current selected file of the DIR() function.

page -487-


© MCS Electronics, 1995-2007

See also

INITFILESYSTEM , OPEN , CLOSE, FLUSH , PRINT, LINE INPUT, LOC, LOF , EOF , FREEFILE , FILEATTR , SEEK , BSAVE , BLOAD , KILL , DISKFREE , GET , PUT , FILEDATE , FILETIME , FILEDATETIME , DIR , WRITE , INPUT

ASM

Calls

_FileLen

Input

Output

Partial Example

Print "File demo"

Print Filelen("josef.img");" length" ' length of file

Print Filetime("josef.img");" time" ' time file was changed

Print Filedate("josef.img");" date" ' file date

FILETIME

Action

Returns the time of a file

Syntax

sTime = FILETIME ()

sTime = FILETIME (file)

Remarks

Stime

A string variable that is assigned with the file time.

File

The name of the file to get the time of.

This function works on any file when you specify the filename. When you do not specify the filename, it works on the current selected file of the DIR() function.

See also

INITFILESYSTEM , OPEN , CLOSE, FLUSH , PRINT, LINE INPUT, LOC, LOF , EOF , FREEFILE , FILEATTR , SEEK , BSAVE , BLOAD , KILL , DISKFREE , GET , PUT , FILELEN , FILEDATE , FILEDATETIME , DIR , WRITE , INPUT

ASM

Calls

_FileTimeS ; with file param

_FileTimeS0 ; current file

Input

X : points to the string with

Z : points to the target variable

the mask

Output

Example

page -488-