Amiga World Official AmigaDOS 2 Companion - eBook-ENG

Page 358

340

AmigaWorld Official AmigaDOS 2 Companion if

in_line =

""

then

iterate

Some of the lines output by the List command are blank. By jumping from here to the end instruction, this statement effectively eliminates blank lines from the output file. if Left(in_line,l)

=

":"

then

iterate

Comment lines get the same treatment. They are not written to the output file. if

Left(in_line,ll)

=

"Directory"""

then do

Tests to see if the first 11 characters on the line are "Directory "as in Direc tory "Ram Disk:env"on Thursday 13-Sep-90. Such message lines are regularly output by a List ALL command, and must be dealt with. len = Length(in_line)

If the above test is true, Length returns the number of characters in in_line. in_line =

SubStr(in_line,12,len

+1-12)

This function takes in_line, pulls out all the characters in it except the first 11, and puts them back into in_line. In effect, it deletes the first 11 charac ters of the current input line. qpos

=

Pos ("",in_line)

Just when you thought you were safe from quotation marks. The Pos func tion looks for the first occurrence of a quotation character in in_line and returns its position in qpos. With the first 11 characters stripped away, the first quotation is located just after the pathname of the next group of files. curdir = Left(in_line,qpos

-

1)

Saves the directory pathname of the next group of files in the variable curdir. iterate

All you want to do with lines in the form Directory "xxxx" etc. is extract the new current directory. Once you've done that, you want to read from the file again. end

Marks the end of the block of statements that handle the directory message lines.


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