Lasso Soft Inc. > Home

[ dir->eachDirPath ]

Method

The [dir->eachDirPath] method returns a list of directory paths contained in the directory that the [dir] object represents. The return type is a [queriable_select] which allows you to work with it in query expressions.

  • Syntax
local(d) = dir(...)
#d->eachDirPath
Examples
  • Beginner
  • Intermediate

Display the list of directories in the web-root

The code below will display the list of directories in the web root. For purposes of the result, assume the web-root contains the following directories: 'css', 'img', and 'js'

Code

local(web_root) = dir('/')
#web_root->eachDirPath

Result

/css/, /img/, /js/

List directories in the web-root in an un-ordered list

The code below will display the list of directories in the web root as an un-ordered list. For purposes of the result, assume the web-root contains the following directories: 'css', 'img', and 'js'

Code

'<ul>'
local(web_root) = dir('/')
with d in #web_root->eachDirPath
do {^
    '<li>' + #d + '</li>'
^}
'</ul>'

Result

  • /css/
  • /img/
  • /js/

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft