Difference between revisions of "ObjectType:filelist"
Jump to navigation
Jump to search
m (Lax moved page DataType:filelist to ObjectType:filelist) |
|||
Line 1: | Line 1: | ||
== Description == | == Description == | ||
+ | {{ObjectType-Vitals|file|[[LavishScript]]|none|NULL|filelist|no|void *}} | ||
+ | |||
This data type allows finding files and directories. | This data type allows finding files and directories. | ||
== Members == | == Members == | ||
− | *[[ | + | *[[ObjectType:int|int]] '''Files''': Total file count |
− | *[[ | + | *[[ObjectType:filelistentry|filelistentry]] '''File['''#''']''': The filelistentry of file <#> |
== Methods == | == Methods == | ||
*'''GetFiles['''*''']''': Gets all files from the given directory. (Defaults to current directory and * for files.) | *'''GetFiles['''*''']''': Gets all files from the given directory. (Defaults to current directory and * for files.) | ||
Line 9: | Line 11: | ||
*'''Reset''': Clears the filelist. | *'''Reset''': Clears the filelist. | ||
:'''Note''' GetFiles and GetDirectories does NOT clear the filelist. | :'''Note''' GetFiles and GetDirectories does NOT clear the filelist. | ||
− | + | ||
− | |||
== Examples == | == Examples == | ||
declare Count int 0 | declare Count int 0 | ||
Line 24: | Line 25: | ||
echo File #${Count} = ${TestFileList.File[${Count}].Filename} | echo File #${Count} = ${TestFileList.File[${Count}].Filename} | ||
} | } | ||
− | |||
− | |||
− | |||
− | |||
− | |||
== See Also == | == See Also == | ||
− | * [[ | + | * [[ObjectType:filelistentry|filelistentry]] |
− | + | {{LavishScript:ObjectType}} | |
− | |||
− | |||
− |
Latest revision as of 16:38, 8 July 2018
Contents
Description
file | |
Defined By | LavishScript |
Inherits | none |
Reduces To | NULL |
Variable Object Type | filelist |
Uses Sub-Types | no |
C/C++ Type | void * |
This data type allows finding files and directories.
Members
- int Files: Total file count
- filelistentry File[#]: The filelistentry of file <#>
Methods
- GetFiles[*]: Gets all files from the given directory. (Defaults to current directory and * for files.)
- GetDirectories[*]: Gets all directories from the given directory. (Defaults to current directory)
- Reset: Clears the filelist.
- Note GetFiles and GetDirectories does NOT clear the filelist.
Examples
declare Count int 0 declare TestFileList filelist declare TestDirList filelist declare ScanDirectory filepath script ${LavishScript.CurrentDirectory} TestFileList:GetFiles[${ScanDirectory}/*.txt] TestDirList:GetDirectories[${ScanDirectory}] ScanDirectory:Set[${ScanDirectory.File[1].FullPath}] TestFileList:GetFiles[${ScanDirectory}/*.txt] while (${Count:Inc}<=${TestFileList.Files}) { echo File #${Count} = ${TestFileList.File[${Count}].Filename} }
See Also
LavishScript Object Types
- Text
- string - mutablestring - unistring
- Numbers
- byte - float - float64 - int - uint - int64
- Boolean (TRUE/FALSE)
- bool
- Pointers
- boolptr - byteptr - floatptr - float64ptr - intptr - uintptr - int64ptr - rgbptr - stringptr
- Containers
- objectcontainer - array - index - collection - queue - stack - set - variablescope
- JSON
- jsonobject - jsonarray - jsonvaluecontainer - jsonvalue
- Iteration
- iterator - jsoniterator
- Date/Time
- time
- File Handling
- filepath - file - filelist - filelistentry
- Tasks
- lavishmachine - Accessed via the Top-Level Object LMAC
- task - tasklibrary - taskmanager - tasktype - taskpulseargs - elmactaskstate