[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

XPL



Hi, If I remember your message correctly you want to grab some filenames from a
directory (all or as prompted by a user?) and then append to each other. No
problem! (The following design makes some assumptions about the nature of your
project that may not be true but it contains the elements that you would need
in any case, I think.) A little more thought would no doubt improve it, but it
is a good practice program. You should be able to piece together a program from
these hints plus the XPL programming guide. We're writing an XPL program. The
first thing to do is massage the standard directory screen. Let's assume that
a) it has no heading, i.e. that it starts immediately with a filename or
directory and b) that it is not a long directory (i.e. not generated by a
DIRL). First search for ___________________________________________. Issue a
Delete line three times (Then do a TF (top of file.). Then search for
 and delete the line it is on. (You need to loop using IF≪ER≫ to break
out.) Go to top of file again. Then do 13 cursor rights, hit a Define Column
(then a BF bottom file) then a cursor left, then a Define column and then a
rubdefine. No nothing is left but the file names. Go to top again. Go cursor
right eight times and type a period and then do two Rub Cursors. Then in a loop
that does an IF≪ER≫ check on the search to terminate it, search for a
carriage return followed by eight wildXs, then type a period and do two rub
cursors. What you now have is a list of filenames in proper format. (There
are other ways to do this using XS and other sophisticated XPL stuff.) Now
assume that nw=1 and that a window is free, create a file that will contain the
appended files--as in BC ne append.stf, and then store it away and abort the
window. Then for each file you want appended put up on the command line:
APPEND thatfile,append.stf and execute. The thatfile names could either be
each name in turn from your massaged list (use define, express right, define
and a ≪sv01≫ and a ≪pv01≫ to put it onto the command line). If you want
the user to Yes/No the choices then the ≪RC≫ will be fine. If you want more
elaborate input from the user a better way (since it permits the user to
correct typos, etc.) is to let the user type on the command line and then
capture the command in sgt00. There are various programs over in the file area
that do this stunt. Good luck.