Back

ListFolder

The ListFolder method lists all the files and sub folder names in a given path to a comma seperated list.

The 'filter' parameter is an optional text parameter which allows you to specify a filter pattern. For example to find only mp3 files, you would specify ".mp3" as a filter

Note: You can use the JavaScript 'split' function to convert the list to a JavaScript array if required.

 list = app.ListFolder( path, filter );

Example - Basic

function OnStart()
{
  list = app.ListFolder( "/sdcard" );
  app.ShowPopup( list );
}
  Copy   Copy All    Run   

Example - Filtered

function OnStart()
{
  list = app.ListFolder( "/sdcard", ".mp3" );
  app.ShowPopup( list );
}
  Copy   Copy All    Run