PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
[Bottom][Contents][Search][Prev]: FindFileInPath()[Next]: FormatNumber()
\ -> Rexx -> Inbuilt PPWIZARD Functions -> Files4Mask()

Files4Mask()

This is an inbuilt function function provided by PPWIZARD.

The purpose of this function is to get a list of files matching a mask (such as "*.jpg"). The functioning of this call can be altered if required using a GETFILELIST hook. To get a list of directories you can use Dirs4Mask().

This function takes these parameters as follows:

  1. The name of a file or directory to look for (normally containing wildcard characters appropriate to the operating system being used).

    In linux specify a directory name with a terminating slash to capture all files or subdirectories in that directory.

  2. The name of a rexx stem (array) to place the list of matching files (example "Files"). On return "Files.0" contains the number of files, "Files.1" contains the first filename etc.

  3. Optional value which indicates whether you want subdirectories scanned as well. Any passed value should be "N" (the default) or "Y" to follow directories.

  4. Optional value which indicates whether you want the file list sorted. Any passed value should be "N" or "Y" (the default) to sort. The sort is always case insensitive.

There is no return code from this call, some circumstances can cause PPWIZARD to abort.

The full (absolute) name of files is always returned.

EXAMPLE

The following code lists all graphics files with the extension ".GIF" along with its height and width:

#DefineRexx ''
   ;--- Get list of GIF files (sort it) ---
   call Files4Mask "D:\DBAREIS\Projects\HOMEPAGE\graphics\*.gif", "gif",,"Y"
#DefineRexx

;--- The "GIF" array now holds the list of files (GIF.0 = count) ---
<p>There are <??gif.0> GIF files available as follows:
<OL>
   ;--- List all the GIFs ----------
   #{ FOR GifNumber = 1 to gif.0
      ;--- Output full filename ----
      <li><b><??gif.GifNumber></b>

      ;--- Lets output image size --
      #evaluate ^^ ^fsize = GetImageHeightWidth(gif.GifNumber)^
      (<??fsize>).
   #}
</OL>


email me  any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Search][Prev]: FindFileInPath()[Next]: FormatNumber()


PPWIZARD Manual
My whole website and this manual itself was developed using PPWIZARD (free preprocessor written by Dennis Bareis)
Saturday May 28 2022 at 2:55pm