roncm
asked on
EQUAVELENT OF xBASE AMPERSAND (&)
Using a table called DATADICT, it is possible in xBase languages to open a file without knowing the name of the file. For example:
cFileName := DATADICT->FILENAME {DATADICT-.FILENAME CONTAINING, SAY, "CUSTOMER.DBF"}
use &cFilename. {Evaluates at runtime to: CUSTOMER}
One responded pointed out that I could use a generic table component and simply put the filename from the data dictionary into the Table.Name property, yet I would prefer to use the table components in my data module. In xBase syntax, I guess it would look something like this:
var
sTblName := string;
begin
sTblName := datamod.tblDataDict['TABLN AME']; {where this field contains 'tableCustomer'}
datamod.&sTblName.Open;
end
Perhaps this is simply not possible in Object Pascal....:)
cFileName := DATADICT->FILENAME {DATADICT-.FILENAME CONTAINING, SAY, "CUSTOMER.DBF"}
use &cFilename. {Evaluates at runtime to: CUSTOMER}
One responded pointed out that I could use a generic table component and simply put the filename from the data dictionary into the Table.Name property, yet I would prefer to use the table components in my data module. In xBase syntax, I guess it would look something like this:
var
sTblName := string;
begin
sTblName := datamod.tblDataDict['TABLN
datamod.&sTblName.Open;
end
Perhaps this is simply not possible in Object Pascal....:)
ASKER
Sorry, no help....
ASKER
Edited text of question
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Not possible. I thought so. Thanks jhunt...
I think DATADICT->FILENAME is the field filename in the table DataDict...right??? oh well that's what I will take it for
so do this
if Table1.Active then Table1.Active := False;
Table1.TableName := tbDataDict.FieldByName('Fi
Table1.Active := True;
You will propbably also want to go into foxpro and type in this
delete all for database = sucky
pack :)