Define Files - Duplicate Files

Tracy LeBlanc tleblanc at avisalaska.com
Mon Oct 20 16:34:22 PDT 2014


> -----Original Message-----
> From: Filepro-list [mailto:filepro-list-
> bounces+rkreiss=verizon.net at lists.celestial.com] On Behalf Of Tracy 
> bounces+LeBlanc
> Sent: Monday, October 20, 2014 2:24 PM
> To: filepro-list at lists.celestial.com
> Subject: Define Files - Duplicate Files
> 
> Without using qualified files, is there an easy way to update specific 
> multiple files when I add/update fields (thru Define Files) from one file?
> 
> 
> 
> I have one file that handles the programming. This file will save the 
> information to other files based on a year. When I update fields in 
> the 'programming file', I am manually having to update multiple files 
> with the same fields.
> 
> 
> 
> filePro 5.7.00 running on Linux.
> 
> 
> 
> Tracy

Without seeing your file layout and knowing your indexes, I am going to make
some assumptions.

Since you haven't listed your file names or how many, you could setup an
array with the file names to be updated.  Then declare a variable such as
filename.

Then create your lookup using (filename).  To post the information,
increment an array counter setting filename to the file to be updated do the
lookup postings until all of the files have been updated.

Yr(4,.0)=year wanted

If:
Then:Dim files(NN);ct(2,.0)="1"
If: 
Then: files["1"]="first file;files["2"]="second file" etc Loop If:
Then: lookup foo = (filename)  -k yr   i=A -nx
If:
Then: foo(1);foo(2) or whatever field number is being posted to.
If: ct lt NN
Then ct=ct+"1";GOTO loop
If:
Then: END

If the field numbers are not the same, you could have a number of posting
lines.

If: ct = "1"
Then: foo(1);foo(2);write foo;ct=ct+"1";GOTO loop
If: ct = "2"
Then: foo(3);foo(4) ;write foo;ct=ct+"1";GOTO loop

At the last posting, just do an end or exit.

My question, why no use qualifiers id the file structures for these files
are all the same.  This would make things much easier as you could then read
the file qualify to get all of the qualifiers to post to.  It also solves
the problem of having to make changes in multiple maps if a field is changed
or added.  This hold true for screens and reports.  Do the work once.


Richard Kreiss
GCC Consulting

Office: 410-653-2813

-----Original Message-----
From: Richard Kreiss [mailto:rkreiss at gccconsulting.net] 
Sent: Monday, October 20, 2014 11:35 AM
To: Tracy LeBlanc; filepro-list at lists.celestial.com
Subject: RE: Define Files - Duplicate Files

I tried before setting up a qualified file but I didn't seem to get some
things set up correct (lookups, browsing, etc). Now that I 'played' with
that idea more, I believe you are right. Qualified files might be exactly
what I need. Thank you.



More information about the Filepro-list mailing list