Amiga World Official AmigaDOS 2 Companion - eBook-ENG

Page 359

Practical ARexx if Find(in-line,"blocks used")

341

~= 0 then iterate

Another type of line put out by List ALL that you want to ignore are those that indicate how many blocks are used to store each directory. When this statement encounters such a line, it jumps the program to the end of the file-input loop. An input line that has failed all the above exception tests is one that con tains file information. This is the information we want in the catalog file. The following statements process such lines. timepos = LastPos("

",in_line)

The LastPos function searches a string (such as in_line) backwards from the last character in the string — as is the case here — or from a predetermined position in the string, as is the case below. In eflFect, this statement finds the position of the last space character in the input line. In List command out put, the last space always occurs just before the time information. datepos = LastPos ("

",in_line,timepos - 1)

The previous statement found the start of the time information by searching for the last space character in the line. This statement starts one character to the left of the last space (timepos - 1) and searches backwards for the next space character which, as a glance at the output of List will tell you, comes just before the data information on a line. propos

= LastPos("

",in_line,datepos

-

1)

Locates the beginning of the protection information. blockpos

= LastPos("

",in_line,propos

-

Locates the beginning of the size information. fpos

=

LastPos ("

",in_line,blockpos

Locates the end of the filename information. fname

= Left(in_line,fpos

-1

Puts the filename into a separate string. fname

=

Strip(fname,"T")

Strips trailing spaces from the filename.

)

-

1)

1)


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.