home *** CD-ROM | disk | FTP | other *** search
- /*
- Listing 9.9. A function which lists the contents of any array.
- Author: Craig Yellick
- Excerpted from "Clipper 5: A Developer's Guide"
- Copyright (c) 1991 M&T Books
- 501 Galveston Drive
- Redwood City, CA 94063-4728
- (415) 366-3600
- */
-
- function DumpArray(a_, level)
- /*
- List the contents of any array.
- Listing is indented to show nesting of subarrays.
- This function uses a recursive call to itself.
- Do not specify the level parameter, it is used
- internally during the recursive calls.
- */
- local i
- if level = nil
- level := 0
- endif
- for i := 1 to len(a_)
- ? space(level *4) +str(i,4) +": "
- if valtype(a_[i]) = "A"
- ?? "{..}"
- DumpArray(a_[i], level +1)
- else
- ?? a_[i]
- endif
- next i
- return nil
-
- // end of file CHP0909.PRG
-