Let address your issues one at a time....
"I want to take out three different columns from three different dbf-files."
You want to
take out to where?
* To memory variables?
* To a different table?
* To where?
How many records worth of field values do you want to
take out?
* All record's values?
* One or more specific record(s) values based on some specific selection criteria?
* What?
Now, for purposes of better mutual understanding, lets address your syntax usage.
File1Val1 OK I get it that the Value is from File1, but what Field within File1 is the value from?
* Maybe the value from File1.ColA where ColA would be the desired Field from which to get the value?
* Or something else?
NOTE - the syntax is Table dot Field (example: File1.ColA) to specify a specific Field within a Table
The OLD syntax used to be Table -> Field but that is no longer currently used.
So, with that in mind, there is NO
File1Val1
File1 has one or more Fields (maybe named: ColA, Year, Qty, etc.) and those Fields each have an independent value.
Therefore you need to specify which
Field Value(s) you want to use for the calculation.
Maybe, again for example, something like the value from File1.ColA with the value from File2.Year and the value from File3.Qty
Designating the File and the specific Field equates to that specific Field's value.
Therefore the syntax File1.ColC designates the value from Field ColC in File1
Also, in order to run a calculation of values from different tables there has to be
something that can be used to match the individual records between the tables.
Think about 3 separate Excel worksheets
* For your calculation you might want to utilize the (1,2) cell value in WS1
* With the (2,5) cell value in WS2
* And the (5,3) cell value in WS3
So what tells the program what these 3 worksheets have in common so as to programatically 'know' which row (which Record) from each Worksheet (each Table/File) from which to get the specifically defined cell values?
So,
for example, that the program can 'know' that Record1 from File1 matches something in Record3 from File2.
And therefore the program would use the ColA value from Record1 in File1 and the ColB value from Record3 in File2, etc.
With that analogy in mind, how are the 3 separate tables '
related'?
* Is there one Field within all 3 tables whose values are supposed to match in order to do the calculation?
* Or is there one Field in 2 of the tables and a different Field in the 3rd table that matches one of the other 2 tables?
* Or what?
Again,
not knowing where you want these results to go, here is some sample code that
might work for you...
Code:
USE File1 IN 0 EXCLUSIVE
SELECT File1
INDEX ON ColA TAG ColA
USE File2 IN 0 EXCLUSIVE
SELECT File2
INDEX ON ColA TAG ColA && Assumption is that Field 'ColA' value matches in other File's
USE File3 IN 0 EXCLUSIVE
SELECT File3
INDEX ON ColA TAG ColA && Assumption is that Field 'ColA' value matches in other File's
* --- Establish a Relationship between all 3 tables ---
* --- based on the ColA value matching in all 3 tables ---
SELECT File1
SET RELATION TO ColA INTO File2 ADDITIVE
SET RELATION TO ColA INTO File3 ADDITIVE
* --- Now the program 'knows' which records in the other tables ---
* --- from which to get the values ---
* --- And Put Results Back into File1 field 'ColA' ---
REPLACE ALL File1.ColA WITH ((File1.ColA+File2.ColB)/File3.ColC
Good Luck