DIR

From MCS Wiki AVR
(Difference between revisions)
Jump to: navigation, search
(Created page with "= <span class="f_Header">Action</span> = Returns the filename that matches the specified file mask. <span style="font-family: Arial;"> </span> <span style="font-family...")
 
 
Line 54: Line 54:
 
= <span class="f_Header">See also</span> =
 
= <span class="f_Header">See also</span> =
  
[[INITFILESYSTEM]]&nbsp;,&nbsp;[[OPEN]]&nbsp;,&nbsp;[http://avrhelp.mcselec.com/close.htm CLOSE],&nbsp;[http://avrhelp.mcselec.com/flush.htm FLUSH]&nbsp;,&nbsp;[http://avrhelp.mcselec.com/print.htm PRINT],&nbsp;[http://avrhelp.mcselec.com/line_input.htm LINE INPUT],&nbsp;[http://avrhelp.mcselec.com/loc.htm LOC],&nbsp;[http://avrhelp.mcselec.com/lof.htm LOF]&nbsp;,&nbsp;[http://avrhelp.mcselec.com/eof.htm EOF]&nbsp;,&nbsp;[http://avrhelp.mcselec.com/freefile.htm FREEFILE]&nbsp;,&nbsp;[http://avrhelp.mcselec.com/fileattr.htm FILEATTR]&nbsp;,&nbsp;[http://avrhelp.mcselec.com/seek.htm SEEK]&nbsp;,&nbsp;[http://avrhelp.mcselec.com/bsave.htm BSAVE]&nbsp;,[http://avrhelp.mcselec.com/bload.htm BLOAD]&nbsp;,&nbsp;[http://avrhelp.mcselec.com/kill.htm KILL]&nbsp;,&nbsp;[http://avrhelp.mcselec.com/diskfree.htm DISKFREE]&nbsp;,&nbsp;[http://avrhelp.mcselec.com/disksize.htm DISKSIZE]&nbsp;,&nbsp;[http://avrhelp.mcselec.com/get.htm GET]&nbsp;,&nbsp;[http://avrhelp.mcselec.com/put.htm PUT],&nbsp;[http://avrhelp.mcselec.com/filelen.htm FILELEN]&nbsp;,&nbsp;[http://avrhelp.mcselec.com/filedate.htm FILEDATE]&nbsp;,&nbsp;[http://avrhelp.mcselec.com/filetime.htm FILETIME]&nbsp;,&nbsp;[http://avrhelp.mcselec.com/filedatetime.htm FILEDATETIME]&nbsp;,&nbsp;[http://avrhelp.mcselec.com/write.htm WRITE]&nbsp;,&nbsp;[http://avrhelp.mcselec.com/input.htm INPUT]&nbsp;,[http://avrhelp.mcselec.com/mkdir.htm MKDIR],&nbsp;[http://avrhelp.mcselec.com/rmdir.htm RMDIR]&nbsp;,&nbsp;[http://avrhelp.mcselec.com/chdir.htm CHDIR]
+
[[INITFILESYSTEM]] , [[OPEN]] , [[CLOSE]]&nbsp;, [[FLUSH]] , [[PRINT]]&nbsp;, [[LINE INPUT]]&nbsp;, [[LOC]]&nbsp;, [[LOF]] , [[EOF]] , [[FREEFILE]] , [[FILEATTR]] , [[SEEK]] , [[BSAVE]] ,&nbsp;[[BLOAD]] , [[KILL]] , [[DISKFREE]] , [[DISKSIZE]] , [[GET]] , [[PUT]]&nbsp;, [[FILELEN]] , [[FILEDATE]] , [[FILETIME]] , [[FILEDATETIME]] , [[WRITE]] , [[INPUT]] ,&nbsp;[[MKDIR]]&nbsp;, [[RMDIR]] , [[CHDIR]]
  
 
<span style="font-family: Arial;">&nbsp;</span>
 
<span style="font-family: Arial;">&nbsp;</span>

Latest revision as of 21:46, 8 February 2013

Contents

Action

Returns the filename that matches the specified file mask.

 

 

Syntax

sFile = DIR(mask)

sFile = DIR()

 

 

Remarks

SFile

A string variable that is assigned with the filename.

Mask

A file mask with a valid DOS file mask like *.TXT

 

Use *.* to select all files.

 

The first function call needs a file mask. All other calls do not need the file mask. In fact when you want to get the next filename from the directory, you must not provide a mask after the first call.

 

Dir() returns an empty string when there are no more files or when no file name is found that matches the mask.

 

 

See also

INITFILESYSTEM , OPEN , CLOSE , FLUSH , PRINT , LINE INPUT , LOC , LOF , EOF , FREEFILE , FILEATTR , SEEK , BSAVEBLOAD , KILL , DISKFREE , DISKSIZE , GET , PUT , FILELEN , FILEDATE , FILETIME , FILEDATETIME , WRITE , INPUTMKDIR , RMDIR , CHDIR

 

 

ASM

Calls

_Dir ; with file mask

_Dir0 ; without file mask

Input

X : points to the string with the mask

Z : points to the target variable

Output

 

 

 

 

 

Partial Example


'Lets have a look at the file we created
Print "Dir function demo"
S = Dir("*.*")
'The first call to the DIR() function must contain a file mask
' The * means everything.
'
While Len(s)> 0 ' if there was a file found
Print S ;" ";Filedate();" ";Filetime();" ";Filelen()
' print file , the date the fime was created/changed , the time and the size of the file
S = Dir()' get next
Wend

Languages   English Deutsch  
Personal tools
Namespaces
Variants
Actions
Navigation
In other languages
Language